You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The json plugin parses JSONC files with @humanwhocodes/momoa. In version 3.3.0 of momoa, there is now the option to allow trailing commas in JSONC files, using the allowTrailingCommas: true option. See the decision for more information.
As a new feature in @eslint/json, it would be nice to either:
a) Turn on this option by default for JSONC
b) Allow setting this in the languageOptions for JSONC, with default to true
c) Allow setting this in the languageOptions for JSONC, with default to false
Because many common JSONC files (all of the vscode config files and the tsconfig.json file) allow trailing commas, a-c are my order of preference. However, since the Microsoft JSONC parser defaults to false, it is completely reasonable to pick c.
Environment
ESLint version: 9.12.0
@eslint/json version: 0.5.0
Node version: 22.9.0
npm version: 10.9.0
Operating System: MacOS 15.0.1
What problem do you want to solve?
The json plugin parses JSONC files with @humanwhocodes/momoa. In version 3.3.0 of momoa, there is now the option to allow trailing commas in JSONC files, using the
allowTrailingCommas: true
option. See the decision for more information.As a new feature in @eslint/json, it would be nice to either:
a) Turn on this option by default for JSONC
b) Allow setting this in the languageOptions for JSONC, with default to true
c) Allow setting this in the languageOptions for JSONC, with default to false
Because many common JSONC files (all of the vscode config files and the tsconfig.json file) allow trailing commas, a-c are my order of preference. However, since the Microsoft JSONC parser defaults to false, it is completely reasonable to pick c.
link to momoa issue.
What do you think is the correct solution?
Turn on allowTrailingCommas in the call to momoa.
Participation
Additional comments
No response
The text was updated successfully, but these errors were encountered: