-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
The @nx/eslint:convert-to-flat-config migration generator does not migrate parserOptions property correctly #22782
Comments
today I try an attempt to migrate config to flat and got incorrect migration (nx 18.3.1): got: languageSettings: { parserOptions: { project: ["./tsconfig.*?.json"] } } got Error: You have attempted to use the lint rule @typescript-eslint/prefer-optional-chain which requires the full TypeScript type-checker to be available, but you do not have `parserOptions.project` configured to point at your project tsconfig.json files in the relevant TypeScript file "overrides" block of your project ESLint config /Users/iam/org-folder/project-folder/libs/app-layout/eslint.config.js
Please see https://nx.dev/guides/eslint for full guidance on how to resolve this issue.
Looks like global override in main |
Also when I run the migration and change the no-unused-vars will error with every var, even if they are used |
…ig migration partially closes nrwl#22782
…ig migration partially closes nrwl#22782
@jahusa02 please open a new issue with full details of your situation and setup, that does not sound related to the OP |
We are also seeing the following error, even though the parsetOptions.project is correctly set (I think)
Any ideas on how to get round this? |
@joewIST you should provide languageOptions to your libs with project.
|
@pumano I have already done that, still no luck. |
@joewIST that should be in each lib, global override not working Also Try to set It in latest in each lib |
@pumano This is what Nx generated for this library, plus the languageOptions that you suggest:
However, this still doesn't work and I get the same errors! I also had to convert the file to .cjs to prevent errors. |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
Currently, the migration generator moves the
parserOptions
property value from the old configuration file next to thefiles
andrules
properties within the neweslint.config.js
file.Before
The
.eslintrc.json
file before the migration:After (wrong)
The
eslint.config.json
file after the migration:The current state produces following linting error:
Expected Behavior
The flat configuration model has changed so that it expects the
parserOptions
property under the top-levellanguageOptions
property as stated in the official docs.Before
The
.eslintrc.json
file before the migration:After (correct)
The
eslint.config.json
file after the migration:GitHub Repo
No response
Steps to Reproduce
.eslintrc.json
) specify theparserOptions
property and run the following migration generatornx g @nx/eslint:convert-to-flat-config
Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: