-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Bug: parserService
allowDefaultProject just isn't working
#9739
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
Comments
👋 Hey thanks for trying out the new project service! We'd love to help, except your issue doesn't have a reproduction for us to work with. We'd need more th 8000 an just a few config files and package versions. See https://antfu.me/posts/why-reproductions-are-required#why-reproduction for an explanation of what we'd need. |
I'll dig into the repro in a bit (getting a templated StackBlitz for a monorepo set up is surprisingly annoying). In the meantime -- Can you maybe explain a bit more about Now with the above setup with |
The project service uses the same infra as your IDE. So it should just work the same - automatically. It doesn't use a |
Yup, understand that. Was just stating that previously (in Eslint 8, legacy config), our setup (and probably common) was using a |
Repro: https://stackblitz.com/edit/vitejs-vite-rv1ac6?file=eslint.config.js Run |
I get these errors, is that right?
If so, a few notes:
Once we have #9023, it'll be easier to add "see more" docs to error messages, such as https://typescript-eslint.io/packages/parser#projectserviceoptions and the docs we'll write in #7350. In the meantime https://typescript-eslint.io/blog/announcing-typescript-eslint-v8#project-service has the info you'd need here. Would that have helped @samesfahani-tuplehealth? |
Yup those are the errors.
Yeah this was just automatically done from the ESLint auto migration script. Can clean up later.
Per the error message, adding And do I really want to add e.g. |
Hey all,
EDIT: It seems to be working in the simple setup; there might be an issue with more complex setups. After I disabled the |
UpdateTurns out when using a But@JoshuaKGoldberg Wondering whether Original post, (No need to read)Yeah I do really want to have a detailed guide how should we migrate from e.g. Honestly @JoshuaKGoldberg , I can see the effort that you are trying to guide users to use It doesn't explain exactly what's I'm so confused how I should make them work. projectService: {
allowDefaultProject: ['vite.config.ts'],
defaultProject: './tsconfig.json',
} Even with this config, I just want to make Of course in the |
parserOptions: {
projectService: true,
allowDefaultProject: ['*.js'],
tsconfigRootDir: import.meta.dirname,
},
parserOptions: {
projectService: {
allowDefaultProject: ['*.js'],
defaultProject: true,
},
tsconfigRootDir: import.meta.dirname,
}, Relevant issues:
When I make that change (https://stackblitz.com/edit/vitejs-vite-bvs5pb?file=eslint.config.js), the ESLint failure reduce down to:
|
Yup, you got it! The project service itself doesn't treat |
Anyway! I added those bits to #9753 (comment), our tracking issue for FAQs. Which I think is a good place for this issue's comments - those really are frequently asked questions that we should document. Thanks for the feedback, this was really helpful! I'm going to go ahead and close this issue for now as |
Oh, and:
Added to #9753 (comment) as well. In this case, my advice would be to use |
Well, in doing so, I hit this error:
I'm setting The one weird thing about all of this is that I need to explicitly add config files to |
…ross 1 directory (#52) * ⬆️ Bump typescript-eslint in the eslint group across 1 directory Bumps the eslint group with 1 update in the / directory: [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint). Updates `typescript-eslint` from 7.18.0 to 8.0.1 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.0.1/packages/typescript-eslint) --- updated-dependencies: - dependency-name: typescript-eslint dependency-type: direct:development update-type: version-update:semver-major dependency-group: eslint ... Signed-off-by: dependabot[bot] <support@github.com> * 🐛 Enable checkJs in tsconfig.eslint.json typescript-eslint/typescript-eslint#9739 (comment) --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Nato Boram <nato.boram+git@gmail.com>
Before You File a Bug Report Please Confirm You Have Done The Following...
Repro link
https://stackblitz.com/edit/vitejs-vite-rv1ac6?file=eslint.config.js
Relevant Package
parser
I am in the process of upgrading to ESLint 9 from 8, but running into issues with this package complaining about files that are not source code (they are config files, script files, etc)
ESLint Config
tsconfig
Expected Result
I expect no errors as previously was the case on ESLint 8.57.
Actual Result
A bunch of errors similar to:
Additional Info
No response
Versions
@typescript-eslint/eslint-plugin
8.0.1
@typescript-eslint/parser
8.0.1
@typescript-eslint/rule-tester
X.Y.Z
@typescript-eslint/scope-manager
X.Y.Z
@typescript-eslint/typescript-estree
X.Y.Z
@typescript-eslint/type-utils
X.Y.Z
@typescript-eslint/utils
X.Y.Z
TypeScript
5.5.4
ESLint
9.8.0
node
20.12.2
The text was updated successfully, but these errors were encountered: