cartant / eslint-plugin-rxjs

ESLint rules for RxJS
MIT License
312 stars 37 forks source link

You have used a rule which requires parserServices to be generated. You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser. #97

Closed cathey191 closed 2 years ago

cathey191 commented 2 years ago

When running linting I'm getting the below error. Is there a fix for this?

Error: Error while loading rule 'rxjs/no-unsafe-takeuntil': You have used a rule which requires parserServices to be generated. You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser.

{ "root": true, "parser": "@typescript-eslint/parser", "plugins": [ "rxjs" ], "overrides": [{ "files": "src/app/**/*.ts", "rules": { "rxjs/no-unsafe-takeuntil": "error" }, "excludedFiles": ["**/*.spec.ts", "**/*.page.ts"] } ] }

cathey191 commented 2 years ago

Fixed with: "parserOptions": { "project": [ "tsconfig.json"] },

jokezer commented 2 years ago

This is working with NX:

...
    {
      files: ['*.ts', '*.tsx'],
      parserOptions: {
        project: ['tsconfig.?*.json'],
      },
      extends: [
        'plugin:rxjs/recommended',
      ],
      rules: {}
    },
    {
      files: ['*.js', '*.jsx'],
      extends: ['plugin:@nrwl/nx/javascript'],
...