Skip to content

Commit 113ca04

Browse files
committed
chore: fix jsonc file linting
Signed-off-by: Lexus Drumgold <[email protected]>
1 parent 1111aaa commit 113ca04

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

.eslintrc.base.cjs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -842,15 +842,14 @@ const config = {
842842
}
843843
},
844844
{
845-
files: ['*.json'],
845+
files: ['*.json', '*.jsonc'],
846846
extends: ['plugin:jsonc/prettier'],
847847
parser: 'jsonc-eslint-parser',
848848
plugins: ['jsonc'],
849849
rules: {
850850
'jsonc/no-bigint-literals': 2,
851851
'jsonc/no-binary-expression': 2,
852852
'jsonc/no-binary-numeric-literals': 2,
853-
'jsonc/no-comments': 2,
854853
'jsonc/no-escape-sequence-in-identifier': 2,
855854
'jsonc/no-hexadecimal-numeric-literals': 2,
856855
'jsonc/no-infinity': 2,
@@ -914,11 +913,16 @@ const config = {
914913
pathPattern: '^$'
915914
}
916915
],
917-
918916
'jsonc/valid-json-number': 2,
919917
'jsonc/vue-custom-block/no-parsing-error': 2
920918
}
921919
},
920+
{
921+
files: ['*.jsonc'],
922+
rules: {
923+
'jsonc/no-comments': 0
924+
}
925+
},
922926
{
923927
files: ['*.md'],
924928
parser: 'eslint-plugin-markdownlint/parser',

.lintstagedrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"*": ["yarn check:format", "yarn check:spelling"],
3-
"**/*.{cjs,cts,gql,json,json,md,mjs,ts,yml}": ["yarn check:lint"],
3+
"**/*.{cjs,cts,gql,json,jsonc,md,mjs,ts,yml}": ["yarn check:lint"],
44
"**/yarn.lock": "yarn dedupe --check"
55
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"build": "unbuild",
5454
"check:ci": "yarn dedupe --check && yarn check:format && yarn check:lint && yarn check:spelling && yarn check:types && yarn test && NODE_ENV=production yarn pack -o %s-%v.tgz && yarn clean:pack",
5555
"check:format": "prettier --check .",
56-
"check:lint": "eslint --cache --exit-on-fatal-error --ext cjs,cts,gql,json,json,md,mjs,ts,yml --max-warnings 0 .",
56+
"check:lint": "eslint --exit-on-fatal-error --ext cjs,cts,gql,json,jsonc,md,mjs,ts,yml --max-warnings 0 .",
5757
"check:spelling": "cspell lint --color --no-progress --relative $@ \"**\"",
5858
"check:types": "NODE_OPTIONS='--es-module-specifier-resolution=node --loader=./loader' tsc -p tsconfig.json",
5959
"check:upgrades": "yarn upgrade-interactive",

0 commit comments

Comments
 (0)