|
1 | | -// https://github.com/super-linter/super-linter/blob/644fff4cf8f9c402888e29313139dd6e7cbce40e/TEMPLATES/eslint.config.mjs |
| 1 | +// https://github.com/super-linter/super-linter/blob/58ee821839c7e0d8979f759a8e5ca0d99bb50737/TEMPLATES/eslint.config.mjs |
2 | 2 | import { defineConfig, globalIgnores } from "eslint/config"; |
3 | 3 | import n from "eslint-plugin-n"; |
4 | 4 | import prettier from "eslint-plugin-prettier"; |
5 | 5 | import globals from "globals"; |
6 | | -import jsoncParser from "jsonc-eslint-parser"; |
| 6 | +import eslintPluginJsonc from "eslint-plugin-jsonc"; |
7 | 7 | import typescriptEslint from "@typescript-eslint/eslint-plugin"; |
8 | 8 | import tsParser from "@typescript-eslint/parser"; |
9 | 9 | import pluginVue from "eslint-plugin-vue"; |
@@ -38,48 +38,18 @@ export default defineConfig([ |
38 | 38 | }, |
39 | 39 | }, |
40 | 40 | }, |
41 | | - { |
| 41 | + ...eslintPluginJsonc.configs["recommended-with-json"].map((config) => ({ |
| 42 | + ...config, |
42 | 43 | files: ["**/*.json"], |
43 | | - extends: compat.extends("plugin:jsonc/recommended-with-json"), |
44 | | - |
45 | | - languageOptions: { |
46 | | - parser: jsoncParser, |
47 | | - ecmaVersion: "latest", |
48 | | - sourceType: "script", |
49 | | - |
50 | | - parserOptions: { |
51 | | - jsonSyntax: "JSON", |
52 | | - }, |
53 | | - }, |
54 | | - }, |
55 | | - { |
| 44 | + })), |
| 45 | + ...eslintPluginJsonc.configs["recommended-with-jsonc"].map((config) => ({ |
| 46 | + ...config, |
56 | 47 | files: ["**/*.jsonc"], |
57 | | - extends: compat.extends("plugin:jsonc/recommended-with-jsonc"), |
58 | | - |
59 | | - languageOptions: { |
60 | | - parser: jsoncParser, |
61 | | - ecmaVersion: "latest", |
62 | | - sourceType: "script", |
63 | | - |
64 | | - parserOptions: { |
65 | | - jsonSyntax: "JSONC", |
66 | | - }, |
67 | | - }, |
68 | | - }, |
69 | | - { |
| 48 | + })), |
| 49 | + ...eslintPluginJsonc.configs["recommended-with-json5"].map((config) => ({ |
| 50 | + ...config, |
70 | 51 | files: ["**/*.json5"], |
71 | | - extends: compat.extends("plugin:jsonc/recommended-with-json5"), |
72 | | - |
73 | | - languageOptions: { |
74 | | - parser: jsoncParser, |
75 | | - ecmaVersion: "latest", |
76 | | - sourceType: "script", |
77 | | - |
78 | | - parserOptions: { |
79 | | - jsonSyntax: "JSON5", |
80 | | - }, |
81 | | - }, |
82 | | - }, |
| 52 | + })), |
83 | 53 | { |
84 | 54 | files: ["**/*.js", "**/*.mjs", "**/*.cjs", "**/*.jsx"], |
85 | 55 | extends: compat.extends("plugin:react/recommended"), |
|
0 commit comments