microsoft/vscode-eslint

Extension 'ESLint' is configured as formatter but it cannot format 'JSON with Comments'-files

josephdpurcell opened this issue · 4 comments

I have these versions:

  • eslint 8.56.0 (same issue on 8.57.0 and 8.57.1)
  • prettier 3.2.5
  • vscode 1.95.1 (Universal)
  • vscode eslint extension 3.0.10 (dbaeumer.vscode-eslint)
  • ESLint server running in node 20.18.0

I have set ESlint plugin as the default formatter in my vscode settings and useFlatConfig set to false:

  "editor.defaultFormatter": "dbaeumer.vscode-eslint",
  "eslint.experimental": {
    "useFlatConfig": false
  },

When attempting to format a .eslintrc.json file in VSCode I get this error:

Configure Default Formatter

Extension 'ESLint' is configured as formatter but it cannot format 'JSON with Comments'-files

Here is a screenshot:

Image

When I select "Configure" I only get JSON Language Features as an option, here is a screenshot:

Image

If I run eslint via the CLI it returns a 0 exit code but doesn't modify the file:

$ eslint .eslintrc.json --ignore-pattern '!.eslintrc.json' --fix
$ echo $?
0

Note: I had to add the --ignore-pattern flag since it was ignoring it.

If I run that with the debug flag I get this output... (click to expand)
2024-11-06T14:13:35.773Z eslint:cli CLI args: [ '.eslintrc.json', '--ignore-pattern', '!.eslintrc.json', '--debug' ]
2024-11-06T14:13:35.775Z eslint:cli Using flat config? false
2024-11-06T14:13:35.776Z eslint:cli Running on files
2024-11-06T14:13:35.781Z eslintrc:config-array-factory Loading .eslintignore file: /Users/myuser/myproject/.eslintignore
2024-11-06T14:13:35.782Z eslintrc:ignore-pattern Create with: [ IgnorePattern { patterns: [ '/**/node_modules/*' ], basePath: '/Users/myuser/myproject', loose: false } ]
2024-11-06T14:13:35.783Z eslintrc:ignore-pattern   processed: { basePath: '/Users/myuser/myproject', patterns: [ '/**/node_modules/*' ] }
2024-11-06T14:13:35.783Z eslintrc:ignore-pattern Create with: [ IgnorePattern { patterns: [ '/**/node_modules/*' ], basePath: '/Users/myuser/myproject', loose: false } ]
2024-11-06T14:13:35.783Z eslintrc:ignore-pattern   processed: { basePath: '/Users/myuser/myproject', patterns: [ '/**/node_modules/*' ] }
2024-11-06T14:13:35.783Z eslintrc:config-array-factory Loading .eslintignore file: /Users/myuser/myproject/.eslintignore
2024-11-06T14:13:35.784Z eslint:file-enumerator Start to iterate files: [ '.eslintrc.json' ]
2024-11-06T14:13:35.784Z eslint:file-enumerator File: /Users/myuser/myproject/.eslintrc.json
2024-11-06T14:13:35.784Z eslintrc:cascading-config-array-factory Load config files for /Users/myuser/myproject.
2024-11-06T14:13:35.784Z eslintrc:cascading-config-array-factory No cache found: /Users/myuser/myproject.
2024-11-06T14:13:35.784Z eslintrc:config-array-factory Loading JSON config file: /Users/myuser/myproject/.eslintrc.json
2024-11-06T14:13:35.785Z eslintrc:config-array-factory Config file found: /Users/myuser/myproject/.eslintrc.json
2024-11-06T14:13:35.785Z eslintrc:config-array-factory Loading plugin "@nrwl/nx" from /Users/myuser/myproject/.eslintrc.json
2024-11-06T14:13:35.786Z eslintrc:config-array-factory Loaded: @nrwl/eslint-plugin-nx@15.9.2 (/Users/myuser/myproject/node_modules/@nrwl/eslint-plugin-nx/src/index.js)
2024-11-06T14:13:36.235Z eslintrc:config-array-factory Plugin /Users/myuser/myproject/node_modules/@nrwl/eslint-plugin-nx/src/index.js loaded in: 449ms
2024-11-06T14:13:36.235Z eslintrc:config-array-factory Loading plugin "prettier" from /Users/myuser/myproject/.eslintrc.json
2024-11-06T14:13:36.235Z eslintrc:config-array-factory Loaded: eslint-plugin-prettier@4.2.1 (/Users/myuser/myproject/node_modules/eslint-plugin-prettier/eslint-plugin-prettier.js)
2024-11-06T14:13:36.237Z eslintrc:config-array-factory Plugin /Users/myuser/myproject/node_modules/eslint-plugin-prettier/eslint-plugin-prettier.js loaded in: 2ms
2024-11-06T14:13:36.237Z eslintrc:config-array-factory Loading plugin "jsdoc" from /Users/myuser/myproject/.eslintrc.json
2024-11-06T14:13:36.238Z eslintrc:config-array-factory package.json was not found: Package subpath './package.json' is not defined by "exports" in /Users/myuser/myproject/node_modules/eslint-plugin-jsdoc/package.json
2024-11-06T14:13:36.238Z eslintrc:config-array-factory Loaded: eslint-plugin-jsdoc (/Users/myuser/myproject/node_modules/eslint-plugin-jsdoc/dist/index.cjs)
2024-11-06T14:13:36.274Z eslintrc:config-array-factory Plugin /Users/myuser/myproject/node_modules/eslint-plugin-jsdoc/dist/index.cjs loaded in: 36ms
2024-11-06T14:13:36.275Z eslintrc:config-array-factory Loading {extends:"plugin:@nrwl/nx/typescript"} relative to /Users/myuser/myproject/.eslintrc.json
2024-11-06T14:13:36.275Z eslintrc:config-array-factory Loading plugin "@nrwl/nx" from /Users/myuser/myproject/.eslintrc.json
2024-11-06T14:13:36.275Z eslintrc:config-array-factory Loaded: @nrwl/eslint-plugin-nx@15.9.2 (/Users/myuser/myproject/node_modules/@nrwl/eslint-plugin-nx/src/index.js)
2024-11-06T14:13:36.275Z eslintrc:config-array-factory Plugin /Users/myuser/myproject/node_modules/@nrwl/eslint-plugin-nx/src/index.js loaded in: 0ms
2024-11-06T14:13:36.275Z eslintrc:config-array-factory Loading {extends:"eslint:recommended"} relative to /Users/myuser/myproject/node_modules/@nrwl/eslint-plugin-nx/src/index.js
2024-11-06T14:13:36.275Z eslintrc:config-array-factory Loading {extends:"plugin:@typescript-eslint/eslint-recommended"} relative to /Users/myuser/myproject/node_modules/@nrwl/eslint-plugin-nx/src/index.js
2024-11-06T14:13:36.275Z eslintrc:config-array-factory Loading plugin "@typescript-eslint" from /Users/myuser/myproject/node_modules/@nrwl/eslint-plugin-nx/src/index.js
2024-11-06T14:13:36.275Z eslintrc:config-array-factory Loaded: @typescript-eslint/eslint-plugin@5.59.0 (/Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/index.js)
2024-11-06T14:13:36.348Z eslint:rules Loading rule 'block-spacing' (remaining=289)
2024-11-06T14:13:36.351Z eslint:rules Loading rule 'brace-style' (remaining=288)
2024-11-06T14:13:36.352Z eslint:rules Loading rule 'comma-dangle' (remaining=287)
2024-11-06T14:13:36.356Z eslint:rules Loading rule 'dot-notation' (remaining=286)
2024-11-06T14:13:36.359Z eslint:rules Loading rule 'indent' (remaining=285)
2024-11-06T14:13:36.367Z eslint:rules Loading rule 'init-declarations' (remaining=284)
2024-11-06T14:13:36.367Z eslint:rules Loading rule 'key-spacing' (remaining=283)
2024-11-06T14:13:36.368Z eslint:rules Loading rule 'keyword-spacing' (remaining=282)
2024-11-06T14:13:36.369Z eslint:rules Loading rule 'lines-around-comment' (remaining=281)
2024-11-06T14:13:36.370Z eslint:rules Loading rule 'lines-between-class-members' (remaining=280)
2024-11-06T14:13:36.378Z eslint:rules Loading rule 'no-dupe-class-members' (remaining=279)
2024-11-06T14:13:36.379Z eslint:rules Loading rule 'no-duplicate-imports' (remaining=278)
2024-11-06T14:13:36.380Z eslint:rules Loading rule 'no-empty-function' (remaining=277)
2024-11-06T14:13:36.381Z eslint:rules Loading rule 'no-extra-parens' (remaining=276)
2024-11-06T14:13:36.382Z eslint:rules Loading rule 'no-extra-semi' (remaining=275)
2024-11-06T14:13:36.387Z eslint:rules Loading rule 'no-invalid-this' (remaining=274)
2024-11-06T14:13:36.388Z eslint:rules Loading rule 'no-loop-func' (remaining=273)
2024-11-06T14:13:36.389Z eslint:rules Loading rule 'no-loss-of-precision' (remaining=272)
2024-11-06T14:13:36.389Z eslint:rules Loading rule 'no-magic-numbers' (remaining=271)
2024-11-06T14:13:36.403Z eslint:rules Loading rule 'no-restricted-imports' (remaining=270)
2024-11-06T14:13:36.422Z eslint:rules Loading rule 'no-unused-expressions' (remaining=269)
2024-11-06T14:13:36.423Z eslint:rules Loading rule 'no-useless-constructor' (remaining=268)
2024-11-06T14:13:36.426Z eslint:rules Loading rule 'object-curly-spacing' (remaining=267)
2024-11-06T14:13:36.439Z eslint:rules Loading rule 'quotes' (remaining=266)
2024-11-06T14:13:36.445Z eslint:rules Loading rule 'semi' (remaining=265)
2024-11-06T14:13:36.446Z eslint:rules Loading rule 'space-before-blocks' (remaining=264)
2024-11-06T14:13:36.447Z eslint:rules Loading rule 'space-infix-ops' (remaining=263)
2024-11-06T14:13:36.453Z eslintrc:config-array-factory Plugin /Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/index.js loaded in: 178ms
2024-11-06T14:13:36.453Z eslintrc:config-array-factory Loading {extends:"plugin:@typescript-eslint/recommended"} relative to /Users/myuser/myproject/node_modules/@nrwl/eslint-plugin-nx/src/index.js
2024-11-06T14:13:36.453Z eslintrc:config-array-factory Loading plugin "@typescript-eslint" from /Users/myuser/myproject/node_modules/@nrwl/eslint-plugin-nx/src/index.js
2024-11-06T14:13:36.453Z eslintrc:config-array-factory Loaded: @typescript-eslint/eslint-plugin@5.59.0 (/Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/index.js)
2024-11-06T14:13:36.453Z eslintrc:config-array-factory Plugin /Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/index.js loaded in: 0ms
2024-11-06T14:13:36.453Z eslintrc:config-array-factory Loading {extends:"./configs/base"} relative to /Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/index.js
2024-11-06T14:13:36.453Z eslintrc:config-array-factory package.json was not found: Cannot find module './configs/base/package.json'
Require stack:
- /Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/index.js
2024-11-06T14:13:36.453Z eslintrc:config-array-factory Loaded: ./configs/base (/Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/configs/base.js)
2024-11-06T14:13:36.453Z eslintrc:config-array-factory Loading JS config file: /Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/configs/base.js
2024-11-06T14:13:36.454Z eslintrc:config-array-factory Loading parser "@typescript-eslint/parser" from /Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/configs/base.js
2024-11-06T14:13:36.454Z eslintrc:config-array-factory Loaded: @typescript-eslint/parser@5.59.0 (/Users/myuser/myproject/node_modules/@typescript-eslint/parser/dist/index.js)
2024-11-06T14:13:36.455Z eslintrc:config-array-factory Loading plugin "@typescript-eslint" from /Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/configs/base.js
2024-11-06T14:13:36.455Z eslintrc:config-array-factory Loaded: @typescript-eslint/eslint-plugin@5.59.0 (/Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/index.js)
2024-11-06T14:13:36.455Z eslintrc:config-array-factory Plugin /Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/index.js loaded in: 0ms
2024-11-06T14:13:36.455Z eslintrc:config-array-factory Loading {extends:"./configs/eslint-recommended"} relative to /Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/index.js
2024-11-06T14:13:36.455Z eslintrc:config-array-factory package.json was not found: Cannot find module './configs/eslint-recommended/package.json'
Require stack:
- /Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/index.js
2024-11-06T14:13:36.455Z eslintrc:config-array-factory Loaded: ./configs/eslint-recommended (/Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/configs/eslint-recommended.js)
2024-11-06T14:13:36.455Z eslintrc:config-array-factory Loading JS config file: /Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/configs/eslint-recommended.js
2024-11-06T14:13:36.455Z eslintrc:config-array-factory Loading {extends:"prettier"} relative to /Users/myuser/myproject/node_modules/@nrwl/eslint-plugin-nx/src/index.js
2024-11-06T14:13:36.456Z eslintrc:config-array-factory Loaded: eslint-config-prettier@8.8.0 (/Users/myuser/myproject/node_modules/eslint-config-prettier/index.js)
2024-11-06T14:13:36.456Z eslintrc:config-array-factory Loading JS config file: /Users/myuser/myproject/node_modules/eslint-config-prettier/index.js
2024-11-06T14:13:36.456Z eslintrc:config-array-factory Loading parser "@typescript-eslint/parser" from /Users/myuser/myproject/node_modules/@nrwl/eslint-plugin-nx/src/index.js
2024-11-06T14:13:36.456Z eslintrc:config-array-factory Loaded: @typescript-eslint/parser@5.59.0 (/Users/myuser/myproject/node_modules/@typescript-eslint/parser/dist/index.js)
2024-11-06T14:13:36.456Z eslintrc:config-array-factory Loading plugin "@typescript-eslint" from /Users/myuser/myproject/node_modules/@nrwl/eslint-plugin-nx/src/index.js
2024-11-06T14:13:36.456Z eslintrc:config-array-factory Loaded: @typescript-eslint/eslint-plugin@5.59.0 (/Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/index.js)
2024-11-06T14:13:36.456Z eslintrc:config-array-factory Plugin /Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/index.js loaded in: 0ms
2024-11-06T14:13:36.456Z eslintrc:config-array-factory Loading {extends:"prettier"} relative to /Users/myuser/myproject/.eslintrc.json
2024-11-06T14:13:36.457Z eslintrc:config-array-factory Loaded: eslint-config-prettier@8.8.0 (/Users/myuser/myproject/node_modules/eslint-config-prettier/index.js)
2024-11-06T14:13:36.457Z eslintrc:config-array-factory Loading JS config file: /Users/myuser/myproject/node_modules/eslint-config-prettier/index.js
2024-11-06T14:13:36.457Z eslintrc:config-array-factory Loading {extends:"plugin:@nrwl/nx/javascript"} relative to /Users/myuser/myproject/.eslintrc.json
2024-11-06T14:13:36.457Z eslintrc:config-array-factory Loading plugin "@nrwl/nx" from /Users/myuser/myproject/.eslintrc.json
2024-11-06T14:13:36.457Z eslintrc:config-array-factory Loaded: @nrwl/eslint-plugin-nx@15.9.2 (/Users/myuser/myproject/node_modules/@nrwl/eslint-plugin-nx/src/index.js)
2024-11-06T14:13:36.457Z eslintrc:config-array-factory Plugin /Users/myuser/myproject/node_modules/@nrwl/eslint-plugin-nx/src/index.js loaded in: 0ms
2024-11-06T14:13:36.457Z eslintrc:config-array-factory Loading {extends:"eslint:recommended"} relative to /Users/myuser/myproject/node_modules/@nrwl/eslint-plugin-nx/src/index.js
2024-11-06T14:13:36.457Z eslintrc:config-array-factory Loading {extends:"plugin:@typescript-eslint/eslint-recommended"} relative to /Users/myuser/myproject/node_modules/@nrwl/eslint-plugin-nx/src/index.js
2024-11-06T14:13:36.457Z eslintrc:config-array-factory Loading plugin "@typescript-eslint" from /Users/myuser/myproject/node_modules/@nrwl/eslint-plugin-nx/src/index.js
2024-11-06T14:13:36.457Z eslintrc:config-array-factory Loaded: @typescript-eslint/eslint-plugin@5.59.0 (/Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/index.js)
2024-11-06T14:13:36.457Z eslintrc:config-array-factory Plugin /Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/index.js loaded in: 0ms
2024-11-06T14:13:36.457Z eslintrc:config-array-factory Loading {extends:"plugin:@typescript-eslint/recommended"} relative to /Users/myuser/myproject/node_modules/@nrwl/eslint-plugin-nx/src/index.js
2024-11-06T14:13:36.457Z eslintrc:config-array-factory Loading plugin "@typescript-eslint" from /Users/myuser/myproject/node_modules/@nrwl/eslint-plugin-nx/src/index.js
2024-11-06T14:13:36.457Z eslintrc:config-array-factory Loaded: @typescript-eslint/eslint-plugin@5.59.0 (/Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/index.js)
2024-11-06T14:13:36.457Z eslintrc:config-array-factory Plugin /Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/index.js loaded in: 0ms
2024-11-06T14:13:36.457Z eslintrc:config-array-factory Loading {extends:"./configs/base"} relative to /Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/index.js
2024-11-06T14:13:36.457Z eslintrc:config-array-factory package.json was not found: Cannot find module './configs/base/package.json'
Require stack:
- /Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/index.js
2024-11-06T14:13:36.457Z eslintrc:config-array-factory Loaded: ./configs/base (/Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/configs/base.js)
2024-11-06T14:13:36.457Z eslintrc:config-array-factory Loading JS config file: /Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/configs/base.js
2024-11-06T14:13:36.457Z eslintrc:config-array-factory Loading parser "@typescript-eslint/parser" from /Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/configs/base.js
2024-11-06T14:13:36.457Z eslintrc:config-array-factory Loaded: @typescript-eslint/parser@5.59.0 (/Users/myuser/myproject/node_modules/@typescript-eslint/parser/dist/index.js)
2024-11-06T14:13:36.457Z eslintrc:config-array-factory Loading plugin "@typescript-eslint" from /Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/configs/base.js
2024-11-06T14:13:36.457Z eslintrc:config-array-factory Loaded: @typescript-eslint/eslint-plugin@5.59.0 (/Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/index.js)
2024-11-06T14:13:36.457Z eslintrc:config-array-factory Plugin /Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/index.js loaded in: 0ms
2024-11-06T14:13:36.457Z eslintrc:config-array-factory Loading {extends:"./configs/eslint-recommended"} relative to /Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/index.js
2024-11-06T14:13:36.457Z eslintrc:config-array-factory package.json was not found: Cannot find module './configs/eslint-recommended/package.json'
Require stack:
- /Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/index.js
2024-11-06T14:13:36.457Z eslintrc:config-array-factory Loaded: ./configs/eslint-recommended (/Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/configs/eslint-recommended.js)
2024-11-06T14:13:36.457Z eslintrc:config-array-factory Loading JS config file: /Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/configs/eslint-recommended.js
2024-11-06T14:13:36.458Z eslintrc:config-array-factory Loading {extends:"prettier"} relative to /Users/myuser/myproject/node_modules/@nrwl/eslint-plugin-nx/src/index.js
2024-11-06T14:13:36.458Z eslintrc:config-array-factory Loaded: eslint-config-prettier@8.8.0 (/Users/myuser/myproject/node_modules/eslint-config-prettier/index.js)
2024-11-06T14:13:36.458Z eslintrc:config-array-factory Loading JS config file: /Users/myuser/myproject/node_modules/eslint-config-prettier/index.js
2024-11-06T14:13:36.458Z eslintrc:config-array-factory Loading parser "@typescript-eslint/parser" from /Users/myuser/myproject/node_modules/@nrwl/eslint-plugin-nx/src/index.js
2024-11-06T14:13:36.458Z eslintrc:config-array-factory Loaded: @typescript-eslint/parser@5.59.0 (/Users/myuser/myproject/node_modules/@typescript-eslint/parser/dist/index.js)
2024-11-06T14:13:36.458Z eslintrc:config-array-factory Loading plugin "@typescript-eslint" from /Users/myuser/myproject/node_modules/@nrwl/eslint-plugin-nx/src/index.js
2024-11-06T14:13:36.458Z eslintrc:config-array-factory Loaded: @typescript-eslint/eslint-plugin@5.59.0 (/Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/index.js)
2024-11-06T14:13:36.458Z eslintrc:config-array-factory Plugin /Users/myuser/myproject/node_modules/@typescript-eslint/eslint-plugin/dist/index.js loaded in: 0ms
2024-11-06T14:13:36.458Z eslintrc:config-array-factory Loading parser "jsonc-eslint-parser" from /Users/myuser/myproject/.eslintrc.json
2024-11-06T14:13:36.458Z eslintrc:config-array-factory Loaded: jsonc-eslint-parser@2.2.0 (/Users/myuser/myproject/node_modules/jsonc-eslint-parser/lib/index.js)
2024-11-06T14:13:36.463Z eslintrc:cascading-config-array-factory Stop traversing because of 'root:true'.
2024-11-06T14:13:36.463Z eslint:rules Loading rule 'no-restricted-imports' (remaining=290)
2024-11-06T14:13:36.468Z eslint:rules Loading rule 'constructor-super' (remaining=289)
2024-11-06T14:13:36.469Z eslint:rules Loading rule 'for-direction' (remaining=288)
2024-11-06T14:13:36.469Z eslint:rules Loading rule 'getter-return' (remaining=287)
2024-11-06T14:13:36.470Z eslint:rules Loading rule 'no-async-promise-executor' (remaining=286)
2024-11-06T14:13:36.470Z eslint:rules Loading rule 'no-case-declarations' (remaining=285)
2024-11-06T14:13:36.470Z eslint:rules Loading rule 'no-class-assign' (remaining=284)
2024-11-06T14:13:36.470Z eslint:rules Loading rule 'no-compare-neg-zero' (remaining=283)
2024-11-06T14:13:36.470Z eslint:rules Loading rule 'no-cond-assign' (remaining=282)
2024-11-06T14:13:36.471Z eslint:rules Loading rule 'no-const-assign' (remaining=281)
2024-11-06T14:13:36.471Z eslint:rules Loading rule 'no-constant-condition' (remaining=280)
2024-11-06T14:13:36.472Z eslint:rules Loading rule 'no-control-regex' (remaining=279)
2024-11-06T14:13:36.474Z eslint:rules Loading rule 'no-debugger' (remaining=278)
2024-11-06T14:13:36.474Z eslint:rules Loading rule 'no-delete-var' (remaining=277)
2024-11-06T14:13:36.474Z eslint:rules Loading rule 'no-dupe-args' (remaining=276)
2024-11-06T14:13:36.474Z eslint:rules Loading rule 'no-dupe-class-members' (remaining=275)
2024-11-06T14:13:36.475Z eslint:rules Loading rule 'no-dupe-else-if' (remaining=274)
2024-11-06T14:13:36.475Z eslint:rules Loading rule 'no-dupe-keys' (remaining=273)
2024-11-06T14:13:36.475Z eslint:rules Loading rule 'no-duplicate-case' (remaining=272)
2024-11-06T14:13:36.475Z eslint:rules Loading rule 'no-empty' (remaining=271)
2024-11-06T14:13:36.476Z eslint:rules Loading rule 'no-empty-character-class' (remaining=270)
2024-11-06T14:13:36.476Z eslint:rules Loading rule 'no-empty-pattern' (remaining=269)
2024-11-06T14:13:36.477Z eslint:rules Loading rule 'no-ex-assign' (remaining=268)
2024-11-06T14:13:36.477Z eslint:rules Loading rule 'no-extra-boolean-cast' (remaining=267)
2024-11-06T14:13:36.477Z eslint:rules Loading rule 'no-extra-semi' (remaining=266)
2024-11-06T14:13:36.478Z eslint:rules Loading rule 'no-fallthrough' (remaining=265)
2024-11-06T14:13:36.479Z eslint:rules Loading rule 'no-func-assign' (remaining=264)
2024-11-06T14:13:36.479Z eslint:rules Loading rule 'no-global-assign' (remaining=263)
2024-11-06T14:13:36.480Z eslint:rules Loading rule 'no-import-assign' (remaining=262)
2024-11-06T14:13:36.480Z eslint:rules Loading rule 'no-inner-declarations' (remaining=261)
2024-11-06T14:13:36.481Z eslint:rules Loading rule 'no-invalid-regexp' (remaining=260)
2024-11-06T14:13:36.483Z eslint:rules Loading rule 'no-irregular-whitespace' (remaining=259)
2024-11-06T14:13:36.484Z eslint:rules Loading rule 'no-loss-of-precision' (remaining=258)
2024-11-06T14:13:36.484Z eslint:rules Loading rule 'no-misleading-character-class' (remaining=257)
2024-11-06T14:13:36.486Z eslint:rules Loading rule 'no-mixed-spaces-and-tabs' (remaining=256)
2024-11-06T14:13:36.486Z eslint:rules Loading rule 'no-new-symbol' (remaining=255)
2024-11-06T14:13:36.486Z eslint:rules Loading rule 'no-nonoctal-decimal-escape' (remaining=254)
2024-11-06T14:13:36.487Z eslint:rules Loading rule 'no-obj-calls' (remaining=253)
2024-11-06T14:13:36.487Z eslint:rules Loading rule 'no-octal' (remaining=252)
2024-11-06T14:13:36.487Z eslint:rules Loading rule 'no-prototype-builtins' (remaining=251)
2024-11-06T14:13:36.487Z eslint:rules Loading rule 'no-redeclare' (remaining=250)
2024-11-06T14:13:36.488Z eslint:rules Loading rule 'no-regex-spaces' (remaining=249)
2024-11-06T14:13:36.488Z eslint:rules Loading rule 'no-self-assign' (remaining=248)
2024-11-06T14:13:36.489Z eslint:rules Loading rule 'no-setter-return' (remaining=247)
2024-11-06T14:13:36.489Z eslint:rules Loading rule 'no-shadow-restricted-names' (remaining=246)
2024-11-06T14:13:36.489Z eslint:rules Loading rule 'no-sparse-arrays' (remaining=245)
2024-11-06T14:13:36.490Z eslint:rules Loading rule 'no-this-before-super' (remaining=244)
2024-11-06T14:13:36.490Z eslint:rules Loading rule 'no-undef' (remaining=243)
2024-11-06T14:13:36.490Z eslint:rules Loading rule 'no-unexpected-multiline' (remaining=242)
2024-11-06T14:13:36.491Z eslint:rules Loading rule 'no-unreachable' (remaining=241)
2024-11-06T14:13:36.491Z eslint:rules Loading rule 'no-unsafe-finally' (remaining=240)
2024-11-06T14:13:36.491Z eslint:rules Loading rule 'no-unsafe-negation' (remaining=239)
2024-11-06T14:13:36.492Z eslint:rules Loading rule 'no-unsafe-optional-chaining' (remaining=238)
2024-11-06T14:13:36.492Z eslint:rules Loading rule 'no-unused-labels' (remaining=237)
2024-11-06T14:13:36.492Z eslint:rules Loading rule 'no-unused-vars' (remaining=236)
2024-11-06T14:13:36.493Z eslint:rules Loading rule 'no-useless-backreference' (remaining=235)
2024-11-06T14:13:36.494Z eslint:rules Loading rule 'no-useless-catch' (remaining=234)
2024-11-06T14:13:36.494Z eslint:rules Loading rule 'no-useless-escape' (remaining=233)
2024-11-06T14:13:36.494Z eslint:rules Loading rule 'no-with' (remaining=232)
2024-11-06T14:13:36.495Z eslint:rules Loading rule 'require-yield' (remaining=231)
2024-11-06T14:13:36.495Z eslint:rules Loading rule 'use-isnan' (remaining=230)
2024-11-06T14:13:36.495Z eslint:rules Loading rule 'valid-typeof' (remaining=229)
2024-11-06T14:13:36.496Z eslint:rules Loading rule 'no-var' (remaining=228)
2024-11-06T14:13:36.496Z eslint:rules Loading rule 'prefer-const' (remaining=227)
2024-11-06T14:13:36.497Z eslint:rules Loading rule 'prefer-rest-params' (remaining=226)
2024-11-06T14:13:36.497Z eslint:rules Loading rule 'prefer-spread' (remaining=225)
2024-11-06T14:13:36.498Z eslint:rules Loading rule 'no-array-constructor' (remaining=224)
2024-11-06T14:13:36.498Z eslint:rules Loading rule 'no-empty-function' (remaining=223)
2024-11-06T14:13:36.499Z eslint:rules Loading rule 'curly' (remaining=222)
2024-11-06T14:13:36.500Z eslint:rules Loading rule 'lines-around-comment' (remaining=221)
2024-11-06T14:13:36.500Z eslint:rules Loading rule 'max-len' (remaining=220)
2024-11-06T14:13:36.501Z eslint:rules Loading rule 'no-confusing-arrow' (remaining=219)
2024-11-06T14:13:36.501Z eslint:rules Loading rule 'no-mixed-operators' (remaining=218)
2024-11-06T14:13:36.501Z eslint:rules Loading rule 'no-tabs' (remaining=217)
2024-11-06T14:13:36.502Z eslint:rules Loading rule 'quotes' (remaining=216)
2024-11-06T14:13:36.502Z eslint:rules Loading rule 'array-bracket-newline' (remaining=215)
2024-11-06T14:13:36.502Z eslint:rules Loading rule 'array-bracket-spacing' (remaining=214)
2024-11-06T14:13:36.502Z eslint:rules Loading rule 'array-element-newline' (remaining=213)
2024-11-06T14:13:36.503Z eslint:rules Loading rule 'arrow-parens' (remaining=212)
2024-11-06T14:13:36.503Z eslint:rules Loading rule 'arrow-spacing' (remaining=211)
2024-11-06T14:13:36.503Z eslint:rules Loading rule 'block-spacing' (remaining=210)
2024-11-06T14:13:36.503Z eslint:rules Loading rule 'brace-style' (remaining=209)
2024-11-06T14:13:36.504Z eslint:rules Loading rule 'comma-dangle' (remaining=208)
2024-11-06T14:13:36.504Z eslint:rules Loading rule 'comma-spacing' (remaining=207)
2024-11-06T14:13:36.504Z eslint:rules Loading rule 'comma-style' (remaining=206)
2024-11-06T14:13:36.505Z eslint:rules Loading rule 'computed-property-spacing' (remaining=205)
2024-11-06T14:13:36.505Z eslint:rules Loading rule 'dot-location' (remaining=204)
2024-11-06T14:13:36.505Z eslint:rules Loading rule 'eol-last' (remaining=203)
2024-11-06T14:13:36.505Z eslint:rules Loading rule 'func-call-spacing' (remaining=202)
2024-11-06T14:13:36.506Z eslint:rules Loading rule 'function-call-argument-newline' (remaining=201)
2024-11-06T14:13:36.506Z eslint:rules Loading rule 'function-paren-newline' (remaining=200)
2024-11-06T14:13:36.506Z eslint:rules Loading rule 'generator-star-spacing' (remaining=199)
2024-11-06T14:13:36.506Z eslint:rules Loading rule 'implicit-arrow-linebreak' (remaining=198)
2024-11-06T14:13:36.507Z eslint:rules Loading rule 'indent' (remaining=197)
2024-11-06T14:13:36.507Z eslint:rules Loading rule 'jsx-quotes' (remaining=196)
2024-11-06T14:13:36.508Z eslint:rules Loading rule 'key-spacing' (remaining=195)
2024-11-06T14:13:36.513Z eslint:rules Loading rule 'keyword-spacing' (remaining=194)
2024-11-06T14:13:36.514Z eslint:rules Loading rule 'linebreak-style' (remaining=193)
2024-11-06T14:13:36.514Z eslint:rules Loading rule 'multiline-ternary' (remaining=192)
2024-11-06T14:13:36.514Z eslint:rules Loading rule 'newline-per-chained-call' (remaining=191)
2024-11-06T14:13:36.515Z eslint:rules Loading rule 'new-parens' (remaining=190)
2024-11-06T14:13:36.515Z eslint:rules Loading rule 'no-extra-parens' (remaining=189)
2024-11-06T14:13:36.515Z eslint:rules Loading rule 'no-floating-decimal' (remaining=188)
2024-11-06T14:13:36.516Z eslint:rules Loading rule 'no-multi-spaces' (remaining=187)
2024-11-06T14:13:36.516Z eslint:rules Loading rule 'no-multiple-empty-lines' (remaining=186)
2024-11-06T14:13:36.516Z eslint:rules Loading rule 'no-trailing-spaces' (remaining=185)
2024-11-06T14:13:36.516Z eslint:rules Loading rule 'no-whitespace-before-property' (remaining=184)
2024-11-06T14:13:36.517Z eslint:rules Loading rule 'nonblock-statement-body-position' (remaining=183)
2024-11-06T14:13:36.517Z eslint:rules Loading rule 'object-curly-newline' (remaining=182)
2024-11-06T14:13:36.517Z eslint:rules Loading rule 'object-curly-spacing' (remaining=181)
2024-11-06T14:13:36.518Z eslint:rules Loading rule 'object-property-newline' (remaining=180)
2024-11-06T14:13:36.518Z eslint:rules Loading rule 'one-var-declaration-per-line' (remaining=179)
2024-11-06T14:13:36.518Z eslint:rules Loading rule 'operator-linebreak' (remaining=178)
2024-11-06T14:13:36.518Z eslint:rules Loading rule 'padded-blocks' (remaining=177)
2024-11-06T14:13:36.519Z eslint:rules Loading rule 'quote-props' (remaining=176)
2024-11-06T14:13:36.519Z eslint:rules Loading rule 'rest-spread-spacing' (remaining=175)
2024-11-06T14:13:36.519Z eslint:rules Loading rule 'semi' (remaining=174)
2024-11-06T14:13:36.520Z eslint:rules Loading rule 'semi-spacing' (remaining=173)
2024-11-06T14:13:36.520Z eslint:rules Loading rule 'semi-style' (remaining=172)
2024-11-06T14:13:36.520Z eslint:rules Loading rule 'space-before-blocks' (remaining=171)
2024-11-06T14:13:36.521Z eslint:rules Loading rule 'space-before-function-paren' (remaining=170)
2024-11-06T14:13:36.521Z eslint:rules Loading rule 'space-in-parens' (remaining=169)
2024-11-06T14:13:36.521Z eslint:rules Loading rule 'space-infix-ops' (remaining=168)
2024-11-06T14:13:36.522Z eslint:rules Loading rule 'space-unary-ops' (remaining=167)
2024-11-06T14:13:36.522Z eslint:rules Loading rule 'switch-colon-spacing' (remaining=166)
2024-11-06T14:13:36.522Z eslint:rules Loading rule 'template-curly-spacing' (remaining=165)
2024-11-06T14:13:36.523Z eslint:rules Loading rule 'template-tag-spacing' (remaining=164)
2024-11-06T14:13:36.523Z eslint:rules Loading rule 'unicode-bom' (remaining=163)
2024-11-06T14:13:36.523Z eslint:rules Loading rule 'wrap-iife' (remaining=162)
2024-11-06T14:13:36.524Z eslint:rules Loading rule 'wrap-regex' (remaining=161)
2024-11-06T14:13:36.524Z eslint:rules Loading rule 'yield-star-spacing' (remaining=160)
2024-11-06T14:13:36.524Z eslint:rules Loading rule 'indent-legacy' (remaining=159)
2024-11-06T14:13:36.525Z eslint:rules Loading rule 'no-spaced-func' (remaining=158)
2024-11-06T14:13:36.526Z eslint:rules Loading rule 'consistent-return' (remaining=157)
2024-11-06T14:13:36.527Z eslint:rules Loading rule 'no-self-compare' (remaining=156)
2024-11-06T14:13:36.527Z eslint:rules Loading rule 'complexity' (remaining=155)
2024-11-06T14:13:36.528Z eslint:rules Loading rule 'eqeqeq' (remaining=154)
2024-11-06T14:13:36.529Z eslint:rules Loading rule 'max-depth' (remaining=153)
2024-11-06T14:13:36.529Z eslint:rules Loading rule 'no-console' (remaining=152)
2024-11-06T14:13:36.529Z eslint:rules Loading rule 'no-eval' (remaining=151)
2024-11-06T14:13:36.530Z eslint:rules Loading rule 'no-implied-eval' (remaining=150)
2024-11-06T14:13:36.530Z eslint:rules Loading rule 'no-lonely-if' (remaining=149)
2024-11-06T14:13:36.531Z eslint:rules Loading rule 'no-multi-assign' (remaining=148)
2024-11-06T14:13:36.531Z eslint:rules Loading rule 'no-new' (remaining=147)
2024-11-06T14:13:36.531Z eslint:rules Loading rule 'no-new-object' (remaining=146)
2024-11-06T14:13:36.531Z eslint:rules Loading rule 'no-new-wrappers' (remaining=145)
2024-11-06T14:13:36.532Z eslint:rules Loading rule 'no-return-await' (remaining=144)
2024-11-06T14:13:36.532Z eslint:rules Loading rule 'no-return-assign' (remaining=143)
2024-11-06T14:13:36.532Z eslint:rules Loading rule 'no-sequences' (remaining=142)
2024-11-06T14:13:36.532Z eslint:rules Loading rule 'no-throw-literal' (remaining=141)
2024-11-06T14:13:36.533Z eslint:rules Loading rule 'no-useless-return' (remaining=140)
2024-11-06T14:13:36.533Z eslint:rules Loading rule 'no-implicit-coercion' (remaining=139)
2024-11-06T14:13:36.534Z eslint:rules Loading rule 'max-lines-per-function' (remaining=138)
2024-11-06T14:13:36.534Z eslint:rules Loading rule 'no-duplicate-imports' (remaining=137)
2024-11-06T14:13:36.538Z eslintrc:cascading-config-array-factory Configuration was determined: ConfigArray(27) [ { type: 'config', name: 'DefaultIgnorePattern', filePath: '', criteria: null, env: undefined, globals: undefined, ignorePattern: IgnorePattern { patterns: [Array], basePath: '/Users/myuser/myproject
2024-11-06T14:13:36.539Z eslintrc:ignore-pattern Create with: [ IgnorePattern { patterns: [ '/**/node_modules/*' ], basePath: '/Users/myuser/myproject', loose: false } ]
2024-11-06T14:13:36.539Z eslintrc:ignore-pattern   processed: { basePath: '/Users/myuser/myproject', patterns: [ '/**/node_modules/*', '**/*', 'node_modules', '!.eslintrc.json' ] }
2024-11-06T14:13:36.540Z eslintrc:ignore-pattern Check {
  filePath: '/Users/myuser/myproject/.eslintrc.json',
  dot: false,
  relativePath: '.eslintrc.json',
  result: false
}
2024-11-06T14:13:36.540Z eslint:cli-engine Lint /Users/myuser/myproject/.eslintrc.json
2024-11-06T14:13:36.540Z eslint:linter Linting code for /Users/myuser/myproject/.eslintrc.json (pass 1)
2024-11-06T14:13:36.540Z eslint:linter Verify
2024-11-06T14:13:36.540Z eslint:linter With ConfigArray: /Users/myuser/myproject/.eslintrc.json
2024-11-06T14:13:36.540Z eslint:linter Parsing: /Users/myuser/myproject/.eslintrc.json
2024-11-06T14:13:36.546Z eslint:linter Parsing successful: /Users/myuser/myproject/.eslintrc.json
2024-11-06T14:13:36.546Z eslint:linter Scope analysis: /Users/myuser/myproject/.eslintrc.json
2024-11-06T14:13:36.546Z eslint:linter Scope analysis successful: /Users/myuser/myproject/.eslintrc.json
2024-11-06T14:13:36.549Z eslint:linter Generating fixed text for /Users/myuser/myproject/.eslintrc.json (pass 1)
2024-11-06T14:13:36.549Z eslint:source-code-fixer Applying fixes
2024-11-06T14:13:36.549Z eslint:source-code-fixer shouldFix parameter was false, not attempting fixes
2024-11-06T14:13:36.549Z eslint:file-enumerator Complete iterating files: [".eslintrc.json"]
2024-11-06T14:13:36.549Z eslint:cli-engine Linting complete in: 765ms

It seems like the relevant line from the debug output is:

2024-11-06T14:13:36.549Z eslint:source-code-fixer shouldFix parameter was false, not attempting fixes

How can I use ESLint to format JSON files with comments?

It's plausible that this issue goes away on version 9. I know I'm using .eslintrc.json instead of the proper flat file version (see link).

Perhaps what I'd like to know still is whether or not eslint version 8 is able to validate json files with comments at all?

My current plan is to have this in my VSCode settings:

  "editor.defaultFormatter": "dbaeumer.vscode-eslint",
  "[jsonc]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },

So that by default VSCode ESlint will be used except json files with comments will use prettier.

You need to allow eslint to register itself as a formatter. This is not on by default because most users use other formatters. The setting is eslint.format.enable. Have you tried setting this to true.

Oh! I missed that setting. I'll check that and report back, thank you so much for offering something I can try!

Confirmed! The error I reported goes away when I set this in my VSCode settings:

  "eslint.format.enable": true,

I totally missed that setting, thank you for pointing that out!

Now, I still have a different issue which is that the contents are not actually getting formatted. Both CLI and VSCode if I turn debug on (VSCode setting is eslint.debug: true I see this error:

2024-11-06T14:13:36.549Z eslint:source-code-fixer shouldFix parameter was false, not attempting fixes

I assume this is caused by being on an older version of eslint which is out of scope for this project. I believe the next step for addressing that issue is likely to upgrade where these types are officially supported, see also https://eslint.org/blog/2024/10/eslint-json-markdown-support/.

I will close this issue since the issue I reported is resolved. Thank you again!