hluisson / eslint-plugin-jsx-expressions

Rules for safe logical expressions in JSX
95 stars 12 forks source link

Peer dependency for @typescript-eslint/parser@^7.0.0 #16

Open kjetilkh-politiet opened 4 months ago

kjetilkh-politiet commented 4 months ago

Hi, is it possible to add peer dependency for @typescript-eslint/parser@^7.0.0?

karlhorky commented 1 month ago

To be clear, this is causing errors like this while linting, if the ESLint config uses a v7+ version of the typescript-eslint packages:

$ yarn eslint . --max-warnings 0
$ /home/runner/work/courses/courses/node_modules/.bin/eslint . --max-warnings 0
(node:2195) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
Oops! Something went wrong! :(
ESLint: 9.0.0
Error: Error while loading rule 'jsx-expressions/strict-logical-expressions': 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.
Occurred while linting /home/runner/work/courses/courses/eslint.config.js
    at Object.getParserServices (/home/runner/work/courses/courses/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js:21:15)
    at create (/home/runner/work/courses/courses/node_modules/eslint-plugin-jsx-expressions/dist/rules/strict-logical-expressions.js:60:52)
    at Object.create (/home/runner/work/courses/courses/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.js:38:20)
    at createRuleListeners (/home/runner/work/courses/courses/node_modules/eslint/lib/linter/linter.js:1003:21)
    at /home/runner/work/courses/courses/node_modules/eslint/lib/linter/linter.js:1129:84
    at Array.forEach (<anonymous>)
    at runRules (/home/runner/work/courses/courses/node_modules/eslint/lib/linter/linter.js:1061:34)
    at Linter._verifyWithFlatConfigArrayAndWithoutProcessors (/home/runner/work/courses/courses/node_modules/eslint/lib/linter/linter.js:1910:31)
    at Linter._verifyWithFlatConfigArray (/home/runner/work/courses/courses/node_modules/eslint/lib/linter/linter.js:2046:21)
    at Linter.verify (/home/runner/work/courses/courses/node_modules/eslint/lib/linter/linter.js:1535:61)