Error when using with eslint-plugin-rxjs
See original GitHub issueDescribe the bug We have https://www.npmjs.com/package/eslint-plugin-rxjs rules, and with configuration from the docs, we get following error:
Error: Error while loading rule 'rxjs/no-async-subscribe': 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.
To Reproduce Steps to reproduce the behavior: 1 Setup eslint-plugin-rxjs rules 2 Setup graphql-eslint according to the docs(via overrides)
{
files: ['*.mutation.ts'],
processor: '@graphql-eslint/graphql'
},
{
files: ['*.graphql'],
plugins: ['@graphql-eslint'],
parser: '@graphql-eslint/eslint-plugin',
parserOptions: {
skipGraphQLConfig: true,
schema: resolve(__dirname, './backends/client-api-backend/schema.graphql')
// operations: [resolve(__dirname, './components/**/*.graphql')]
},
rules: {
'@graphql-eslint/avoid-duplicate-fields': 'error',
'@graphql-eslint/avoid-operation-name-prefix': 'error',
'@graphql-eslint/avoid-typename-prefix': 'error',
'@graphql-eslint/description-style': 'error',
'@graphql-eslint/executable-definitions': 'error',
'@graphql-eslint/fields-on-correct-type': 'error',
'@graphql-eslint/fragments-on-composite-type': 'error',
'@graphql-eslint/input-name': 'error',
'@graphql-eslint/known-argument-names': 'error',
'@graphql-eslint/known-directives': 'error',
'@graphql-eslint/known-fragment-names': 'error',
'@graphql-eslint/known-type-names': 'error',
'@graphql-eslint/lone-anonymous-operation': 'error',
'@graphql-eslint/lone-schema-definition': 'error',
'@graphql-eslint/naming-convention': 'error',
'@graphql-eslint/no-anonymous-operations': 'error',
'@graphql-eslint/no-case-insensitive-enum-values-duplicates': 'error',
'@graphql-eslint/no-deprecated': 'error',
'@graphql-eslint/no-fragment-cycles': 'error',
'@graphql-eslint/no-hashtag-description': 'error',
'@graphql-eslint/no-operation-name-suffix': 'error',
'@graphql-eslint/no-undefined-variables': 'error',
'@graphql-eslint/no-unreachable-types': 'error',
'@graphql-eslint/no-unused-fields': 'error',
'@graphql-eslint/no-unused-fragments': 'error',
'@graphql-eslint/no-unused-variables': 'error',
'@graphql-eslint/one-field-subscriptions': 'error',
'@graphql-eslint/overlapping-fields-can-be-merged': 'error',
'@graphql-eslint/possible-fragment-spread': 'error',
'@graphql-eslint/possible-type-extension': 'error',
'@graphql-eslint/provided-required-arguments': 'error',
'@graphql-eslint/require-deprecation-reason': 'error',
'@graphql-eslint/require-id-when-available': 'error',
'@graphql-eslint/scalar-leafs': 'error',
// '@graphql-eslint/selection-set-depth': ['error', { maxDepth: 3 }],
'@graphql-eslint/strict-id-in-types': 'error',
'@graphql-eslint/unique-argument-names': 'error',
'@graphql-eslint/unique-directive-names': 'error',
'@graphql-eslint/unique-directive-names-per-location': 'error',
'@graphql-eslint/unique-enum-value-names': 'error',
'@graphql-eslint/unique-field-definition-names': 'error',
'@graphql-eslint/unique-fragment-name': 'error',
'@graphql-eslint/unique-input-field-names': 'error',
'@graphql-eslint/unique-operation-name': 'error',
'@graphql-eslint/unique-operation-types': 'error',
'@graphql-eslint/unique-type-names': 'error',
'@graphql-eslint/unique-variable-names': 'error',
'@graphql-eslint/value-literals-of-correct-type': 'error',
'@graphql-eslint/variables-are-input-types': 'error',
'@graphql-eslint/variables-in-allowed-position': 'error'
}
}
Expected behavior GraphQL linter should work.
Environment:
- OS: MacOS 11.2.3
- “@graphql-eslint/eslint-plugin”: “^1.1.4”
- NodeJS: 16.1.0
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Error when using with eslint-plugin-rxjs · Issue #544 - GitHub
We have https://www.npmjs.com/package/eslint-plugin-rxjs rules, and with configuration from the docs, we get following error: Error: Error while ...
Read more >eslint-plugin-rxjs - npm
Start using eslint-plugin-rxjs in your project by running `npm i ... Forbids the calling of subscribe without specifying an error handler.
Read more >Eslint import report TS+rxjs always failed on ...
Issue: When we generate esLint report by json format, and we define correct path in config of sonar we always get errors on...
Read more >eslint-plugin-rxjs - npm Package Health Analysis - Snyk
Ensure you're using the healthiest npm packages. Snyk scans all the packages in your projects for vulnerabilities and provides automated fix advice.
Read more >Eslint-plugin-rxjs - npm.io
Install the package using npm: npm install eslint-plugin-rxjs --save-dev. Configure the parser and the parserOptions for ESLint. Here, I use a .eslintrc.js ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Solved it by restructuring eslint files to have all rules inside overrides.
Nope, it’s important that you don’t have any rules configured at top level config, and to move all configurations into overrides section. Since JavaScript rules can’t run on GraphQL files and vice versa, if you have rules configured at the top level, they will try to also execute for all overrides, as ESLint’s configs cascade.