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

chore: Point ESLint at all tsconfig.jsons #636

Merged
merged 2 commits into from
Aug 30, 2024
Merged

chore: Point ESLint at all tsconfig.jsons #636

merged 2 commits into from
Aug 30, 2024

Conversation

Peeja
Copy link
Member

@Peeja Peeja commented Aug 30, 2024

Otherwise it can't lint everything. This is solved with the projectService option in @typescript-eslint/parser v8. However, we're stuck firmly on v5 for now.

Before

$ pnpm exec eslint packages/react/src/Uploader.tsx

/Users/peeja/clients/storacha/w3ui/packages/react/src/Uploader.tsx
  0:0  error  Parsing error: ESLint was configured to run on `<tsconfigRootDir>/packages/react/src/Uploader.tsx` using `parserOptions.project`: /users/peeja/clients/storacha/w3ui/tsconfig.json
However, that TSConfig does not include this file. Either:
- Change ESLint's list of included files to not include this file
- Change that TSConfig to include this file
- Create a new TSConfig that includes this file and include it in your parserOptions.project
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

✖ 1 problem (1 error, 0 warnings)

After

pnpm exec eslint packages/react/src/Uploader.tsx

/Users/peeja/clients/storacha/w3ui/packages/react/src/Uploader.tsx
  188:23  warning  Do not nest ternary expressions                                                                                                                                                      no-nested-ternary
  190:16  warning  Do not nest ternary expressions                                                                                                                                                      no-nested-ternary
  230:9   warning  React Hook useMemo has missing dependencies: 'files', 'storedDAGShards', 'uploadAsCAR', 'uploadProgress', and 'wrapInDirectory'. Either include them or remove the dependency array  react-hooks/exhaustive-deps
  294:5   warning  React Hook useCallback has a missing dependency: 'setWrapInDirectory'. Either include it or remove the dependency array                                                              react-hooks/exhaustive-deps

✖ 4 problems (0 errors, 4 warnings)

(Which, y'know, still not ideal, but at least it's running.)

Otherwise it can't lint everything. This is solved with the
[`projectService` option][1] in [`@typescript-eslint/parser` v8][2].
However, we're stuck firmly on v5 for now.

[1]: https://github.com/typescript-eslint/typescript-eslint/pull/8031/files?short_path=f55b3fe#diff-f55b3fe275ea73e5e0cbfaf72c238d8fa863819992fe17e23668d1f0376a18b4
[2]: typescript-eslint/typescript-eslint@b9796c1
@Peeja Peeja changed the title Point ESLint at all tsconfig.jsons chore: Point ESLint at all tsconfig.jsons Aug 30, 2024
Copy link
Member

@hannahhoward hannahhoward left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Peeja Peeja merged commit fb14fd4 into main Aug 30, 2024
2 checks passed
@Peeja Peeja deleted the eslint-tsconfigs branch August 30, 2024 19:01
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

Successfully merging this pull request may close these issues.

2 participants