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

Support typescript-eslint v8 to use the Project Service #73

Open
Samuel-Therrien-Beslogic opened this issue Sep 19, 2024 · 5 comments
Open

Comments

@Samuel-Therrien-Beslogic

See https://typescript-eslint.io/blog/announcing-typescript-eslint-v8#project-service

As a temporary workaround, I'm still setting EXPERIMENTAL_useProjectService:

/** @type {import("eslint").Linter.Config} */
module.exports = {
  parserOptions: {
    projectService: true,
    // Still needed for plugins that haven't updated to typescript-eslint@8 yet
    EXPERIMENTAL_useProjectService: true,
  },
}
@last-Programmer
Copy link

@Samuel-Therrien-Beslogic how did you solve this error

Error while loading rule 'etc/no-deprecated': You have used a rule which requires parserServices to be generated. You must therefore provide a value for the "parserOptions.project" property

@Samuel-Therrien-Beslogic
Copy link
Author

Samuel-Therrien-Beslogic commented Oct 3, 2024

@last-Programmer depends on the exact version of typescript-eslint you have:
Either use the god old https://typescript-eslint.io/packages/parser#project
Before v8 you can try EXPERIMENTAL_useProjectService instead of https://typescript-eslint.io/packages/parser#projectservice

Read more: https://typescript-eslint.io/getting-started/typed-linting

@last-Programmer
Copy link

I have this

    "@typescript-eslint/eslint-plugin": "8.8.0 || eslint - typescript rules",
    "@typescript-eslint/parser": "8.8.0 || eslint - typescript code parser",
        languageOptions: {
            ecmaVersion: 2022, // Allows for the parsing of modern ECMAScript features

            parser: parserTsEslint, // Specifies the TS ESLint parser
            sourceType: "module",
            parserOptions: {
                projectService: true,
                tsconfigRootDir: import.meta.dirname,
            }
        },

still getting the error with eslint 9

@last-Programmer
Copy link

@Samuel-Therrien-Beslogic i tried with EXPERIMENTAL_useProjectService: true,. The same error is happening for the following rules in eslint 9. with eslint 9 i need to use npm install --force to install this plugin otherwise it npm install fails.

            //"etc/no-const-enum": "error",
            //"etc/no-deprecated": "error",
//"etc/no-internal": "error",
//"etc/underscore-internal": "error",

@Samuel-Therrien-Beslogic
Copy link
Author

Samuel-Therrien-Beslogic commented Oct 3, 2024

Sorry I'm not using ESLint 9 yet. I still have too many plugins that don't support yet. It's possible you're hitting more unresolvable version ranges than I am.
This issue is about typescript-eslint v8. Feel free to open a new one for ESLint 9 support if that's lacking.
Edit: Just saw you did 😄 #74

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