Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some .tsx files are throwing code:300 #561

Open
alexgorbatchev opened this issue Oct 24, 2024 · 2 comments
Open

Some .tsx files are throwing code:300 #561

alexgorbatchev opened this issue Oct 24, 2024 · 2 comments

Comments

@alexgorbatchev
Copy link

I was testing grit on a large corporate project and some .tsx files are throwing an error. Unfortunately I can't paste code here verbatim due to IP, but here's is one complete file and one snippet that fail to parse:

> grit --version
grit 0.1.1
import * as React from 'react';

import { ExternalLink } from 'internal';

import { SLACK_CHANNEL, SLACK_URL } from '../../constants';

export function OnboardingDocLink() {
  return (
    <ExternalLink
      to="https://edited/pages/viewpage.action?spaceKey=edited&title=edited"
                                                               ^----- grit pointed here
      testId="onboarding-doc-link"
    >
      Onboarding document
    </ExternalLink>
  );
}

export function SlackLink() {
  return (
    <ExternalLink to={SLACK_URL} testId="slack-link">
      {SLACK_CHANNEL}
    </ExternalLink>
  );
}

in another file

const renderButton = (props: { onClick: () => void }) => (
  <Button {...props}>Add Infrastructure & Onboard to Acme</Button>
   ^----- grit pointed here
);
@morgante
Copy link
Contributor

Thanks for the report, I think this is an upstream error in the typescript grammars: https://github.com/tree-sitter/tree-sitter-typescript

Note Grit will still do a best effort attempt even on files that fail to fully parse.

@alexgorbatchev
Copy link
Author

Thanks, I re-posted over at the grammar repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants