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

Cannot do type-aware lints with gts files #1770

Closed
wagenet opened this issue Feb 3, 2023 · 3 comments · Fixed by #1920 or #1942
Closed

Cannot do type-aware lints with gts files #1770

wagenet opened this issue Feb 3, 2023 · 3 comments · Fixed by #1920 or #1942

Comments

@wagenet
Copy link
Contributor

wagenet commented Feb 3, 2023

Initially, I was prompted to set parserOptions.extraFileExtensions. I did this and then received the following error:

{
  message: {
    ruleId: null,
    fatal: true,
    severity: 2,
    message: 'Parsing error: ESLint was configured to run on `<tsconfigRootDir>/addons/luna/addon/components/util/cache-state.gts/0_/Users/pwagenet/Development/AuditBoard/auditboard-frontend/addons/luna/addon/components/util/cache-state.gts/0_/Users/pwagenet/Development/AuditBoard/auditboard-frontend/addons/luna/addon/components/util/cache-state.gts/0_/Users/pwagenet/Development/AuditBoard/auditboard-frontend/addons/luna/addon/components/util/cache-state.gts` using `parserOptions.project`: <tsconfigRootDir>/../../../../../users/pwagenet/development/auditboard/auditboard-frontend/tsconfig.json\n' +
      'However, that TSConfig does not include this file. Either:\n' +
      "- Change ESLint's list of included files to not include this file\n" +
      '- Change that TSConfig to include this file\n' +
      '- Create a new TSConfig that includes this file and include it in your parserOptions.project\n' +
      'See the typescript-eslint docs for more info: https://typescript-eslint.io/linting/troubleshooting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file',
    line: undefined,
    column: undefined
  }
}

Unfortunately, it's not possible to add unrecognized file extensions to the tsconfig.

(Note I had to edit the source to log the error due to the missing line. See also #1667.)

@patricklx
Copy link
Contributor

patricklx commented May 12, 2023

Eslint mdx is compatible with typescript eslint, it has a custom parser. I think it then passes the result on to the eslint-typescript parser:
mdx-js/eslint-mdx#209
https://github.com/mdx-js/eslint-mdx/blob/master/packages/eslint-mdx/src/parser.ts

@patricklx
Copy link
Contributor

patricklx commented May 15, 2023

actually. it looks like it works for me... without any changes to eslintrc or command parameters.
how are you runnning it?

eslint addon/
\addon\components\tabs\index.gts
  21:13  error  Expected a semicolon                    @typescript-eslint/member-delimiter-style
  22:26  error  Expected a semicolon                    @typescript-eslint/member-delimiter-style
  24:16  error  Expected a semicolon                    @typescript-eslint/member-delimiter-style
  25:4   error  Expected a semicolon                    @typescript-eslint/member-delimiter-style

@bmish
Copy link
Member

bmish commented Aug 22, 2023

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