Open Byron2016 opened 5 hours ago
Isn't no-irregular-whitespace a JS rule?
Isn't no-irregular-whitespace a JS rule?
@bmeck if you comment eslint/json configuration section (eslint.config.mjs) the error dissapear, I think could exist a conflict with eslint?
Environment
ESLint version: 9.11.1 @eslint/json version: 9.11.1 Node version: v20.17.0 npm version: 10.8.3 Operating System: Windows 10 Pro 22H2 (19045.4894)
Which language are you using?
json
What did you do?
package.json
eslint.config.mjs
What did you expect to happen?
lint package.json without problem
What actually happened?
command executed
pnpm run lint
Error message
` Warning: React version not specified in eslint-plugin-react settings. See https://github.com/jsx-eslint/eslint-plugin-react#configuration .
Oops! Something went wrong! :(
ESLint: 9.11.1
TypeError: Error while loading rule 'no-irregular-whitespace': sourceCode.getAllComments is not a function Occurred while linting C:\Users\user_01\borrar_001\package.json at Object.create (C:\Users\user_01\borrar_001\node_modules.pnpm\eslint@9.11.1\node_modules\eslint\lib\rules\no-irregular-whitespace.js:87:41) at createRuleListeners (C:\Users\user_01\borrar_001\node_modules.pnpm\eslint@9.11.1\node_modules\eslint\lib\linter\linter.js:943:21) at C:\Users\user_01\borrar_001\node_modules.pnpm\eslint@9.11.1\node_modules\eslint\lib\linter\linter.js:1068:84 at Array.forEach ()
at runRules (C:\Users\user_01\borrar_001\node_modules.pnpm\eslint@9.11.1\node_modules\eslint\lib\linter\linter.js:999:34)
at #flatVerifyWithoutProcessors (C:\Users\user_01\borrar_001\node_modules.pnpm\eslint@9.11.1\node_modules\eslint\lib\linter\linter.js:1914:31)
at Linter._verifyWithFlatConfigArrayAndWithoutProcessors (C:\Users\user_01\borrar_001\node_modules.pnpm\eslint@9.11.1\node_modules\eslint\lib\linter\linter.js:1995:49)
at Linter._verifyWithFlatConfigArray (C:\Users\user_01\borrar_001\node_modules.pnpm\eslint@9.11.1\node_modules\eslint\lib\linter\linter.js:2084:21)
at Linter.verify (C:\Users\user_01\borrar_001\node_modules.pnpm\eslint@9.11.1\node_modules\eslint\lib\linter\linter.js:1528:61)
at Linter.verifyAndFix (C:\Users\user_01\borrar_001\node_modules.pnpm\eslint@9.11.1\node_modules\eslint\lib\linter\linter.js:2322:29)
ELIFECYCLE Command failed with exit code 2.
`
Link to Minimal Reproducible Example
https://github.com/Byron2016/b_eslint_json_error_001
Participation
Additional comments
No response