Skip to content

Commit a9b7aa4

Browse files
authored
feat(jsonc): use jsonc/x language (#824)
1 parent 6742db8 commit a9b7aa4

11 files changed

Lines changed: 15 additions & 59 deletions

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@
157157
"eslint-plugin-yml": "catalog:prod",
158158
"eslint-processor-vue-blocks": "catalog:prod",
159159
"globals": "catalog:prod",
160-
"jsonc-eslint-parser": "catalog:prod",
161160
"local-pkg": "catalog:prod",
162161
"parse-gitignore": "catalog:prod",
163162
"toml-eslint-parser": "catalog:prod",

pnpm-lock.yaml

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ catalogs:
9393
eslint-plugin-yml: ^3.3.0
9494
eslint-processor-vue-blocks: ^2.0.0
9595
globals: ^17.3.0
96-
jsonc-eslint-parser: ^3.1.0
9796
local-pkg: ^1.1.2
9897
parse-gitignore: ^2.0.0
9998
toml-eslint-parser: ^1.0.3

src/configs/jsonc.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,7 @@ export async function jsonc(
1616
indent = 2,
1717
} = typeof stylistic === 'boolean' ? {} : stylistic
1818

19-
const [
20-
pluginJsonc,
21-
parserJsonc,
22-
] = await Promise.all([
23-
interopDefault(import('eslint-plugin-jsonc')),
24-
interopDefault(import('jsonc-eslint-parser')),
25-
] as const)
19+
const pluginJsonc = await interopDefault(import('eslint-plugin-jsonc'))
2620

2721
return [
2822
{
@@ -33,9 +27,7 @@ export async function jsonc(
3327
},
3428
{
3529
files,
36-
languageOptions: {
37-
parser: parserJsonc,
38-
},
30+
language: 'jsonc/x',
3931
name: 'antfu/jsonc/rules',
4032
rules: {
4133
'jsonc/no-bigint-literals': 'error',

src/configs/pnpm.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,10 @@ export async function pnpm(
2020
pluginPnpm,
2121
pluginYaml,
2222
yamlParser,
23-
jsoncParser,
2423
] = await Promise.all([
2524
interopDefault(import('eslint-plugin-pnpm')),
2625
interopDefault(import('eslint-plugin-yml')),
2726
interopDefault(import('yaml-eslint-parser')),
28-
interopDefault(import('jsonc-eslint-parser')),
2927
])
3028

3129
const {
@@ -45,9 +43,7 @@ export async function pnpm(
4543
'package.json',
4644
'**/package.json',
4745
],
48-
languageOptions: {
49-
parser: jsoncParser,
50-
},
46+
language: 'jsonc/x',
5147
name: 'antfu/pnpm/package-json',
5248
plugins: {
5349
pnpm: pluginPnpm,

test/__snapshots__/factory/default.snap.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -740,9 +740,7 @@
740740
"**/*.json5",
741741
"**/*.jsonc",
742742
],
743-
"languageOptions": {
744-
"parser": "jsonc-eslint-parser",
745-
},
743+
"language": "jsonc/x",
746744
"name": "antfu/jsonc/rules",
747745
"rules": [
748746
"jsonc/no-bigint-literals",
@@ -808,9 +806,7 @@
808806
"package.json",
809807
"**/package.json",
810808
],
811-
"languageOptions": {
812-
"parser": "jsonc-eslint-parser",
813-
},
809+
"language": "jsonc/x",
814810
"name": "antfu/pnpm/package-json",
815811
"plugins": [
816812
"pnpm",

test/__snapshots__/factory/full-on.snap.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,9 +1251,7 @@
12511251
"**/*.json5",
12521252
"**/*.jsonc",
12531253
],
1254-
"languageOptions": {
1255-
"parser": "jsonc-eslint-parser",
1256-
},
1254+
"language": "jsonc/x",
12571255
"name": "antfu/jsonc/rules",
12581256
"rules": [
12591257
"jsonc/no-bigint-literals",
@@ -1319,9 +1317,7 @@
13191317
"package.json",
13201318
"**/package.json",
13211319
],
1322-
"languageOptions": {
1323-
"parser": "jsonc-eslint-parser",
1324-
},
1320+
"language": "jsonc/x",
13251321
"name": "antfu/pnpm/package-json",
13261322
"plugins": [
13271323
"pnpm",

test/__snapshots__/factory/in-editor.snap.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -740,9 +740,7 @@
740740
"**/*.json5",
741741
"**/*.jsonc",
742742
],
743-
"languageOptions": {
744-
"parser": "jsonc-eslint-parser",
745-
},
743+
"language": "jsonc/x",
746744
"name": "antfu/jsonc/rules",
747745
"rules": [
748746
"jsonc/no-bigint-literals",
@@ -808,9 +806,7 @@
808806
"package.json",
809807
"**/package.json",
810808
],
811-
"languageOptions": {
812-
"parser": "jsonc-eslint-parser",
813-
},
809+
"language": "jsonc/x",
814810
"name": "antfu/pnpm/package-json",
815811
"plugins": [
816812
"pnpm",

test/__snapshots__/factory/javascript-vue.snap.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -643,9 +643,7 @@
643643
"**/*.json5",
644644
"**/*.jsonc",
645645
],
646-
"languageOptions": {
647-
"parser": "jsonc-eslint-parser",
648-
},
646+
"language": "jsonc/x",
649647
"name": "antfu/jsonc/rules",
650648
"rules": [
651649
"jsonc/no-bigint-literals",
@@ -711,9 +709,7 @@
711709
"package.json",
712710
"**/package.json",
713711
],
714-
"languageOptions": {
715-
"parser": "jsonc-eslint-parser",
716-
},
712+
"language": "jsonc/x",
717713
"name": "antfu/pnpm/package-json",
718714
"plugins": [
719715
"pnpm",

test/__snapshots__/factory/less-opinionated.snap.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -738,9 +738,7 @@
738738
"**/*.json5",
739739
"**/*.jsonc",
740740
],
741-
"languageOptions": {
742-
"parser": "jsonc-eslint-parser",
743-
},
741+
"language": "jsonc/x",
744742
"name": "antfu/jsonc/rules",
745743
"rules": [
746744
"jsonc/no-bigint-literals",
@@ -806,9 +804,7 @@
806804
"package.json",
807805
"**/package.json",
808806
],
809-
"languageOptions": {
810-
"parser": "jsonc-eslint-parser",
811-
},
807+
"language": "jsonc/x",
812808
"name": "antfu/pnpm/package-json",
813809
"plugins": [
814810
"pnpm",

0 commit comments

Comments
 (0)