@infernodesign/eslint-config 2.10.2 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +22 -17
- package/dist/index.d.ts +2906 -1340
- package/dist/index.js +34 -6
- package/package.json +52 -48
package/dist/index.js
CHANGED
|
@@ -1438,6 +1438,27 @@ async function markdown(options = {}) {
|
|
|
1438
1438
|
];
|
|
1439
1439
|
}
|
|
1440
1440
|
//#endregion
|
|
1441
|
+
//#region src/configs/medusa.ts
|
|
1442
|
+
const MedusaPluginName = "@medusajs/eslint-plugin";
|
|
1443
|
+
async function medusa(options = {}) {
|
|
1444
|
+
const { overrides = {}, preset = "recommended" } = options;
|
|
1445
|
+
await ensurePackages([MedusaPluginName]);
|
|
1446
|
+
const presetConfigs = (await interopDefault(import(MedusaPluginName))).configs[preset];
|
|
1447
|
+
if (!presetConfigs) throw new Error(`[${PACKAGE_NAME}] Failed to find config ${preset} in ${MedusaPluginName}`);
|
|
1448
|
+
return presetConfigs.map(({ plugins, rules, ...config }, index) => {
|
|
1449
|
+
const scopedOverrides = Object.fromEntries(Object.entries(overrides).filter(([rule]) => rule in (rules ?? {})));
|
|
1450
|
+
return {
|
|
1451
|
+
...config,
|
|
1452
|
+
name: `config/medusa/${preset}/${index}`,
|
|
1453
|
+
...plugins ? { plugins } : {},
|
|
1454
|
+
...rules ? { rules: {
|
|
1455
|
+
...normalizeRules(rules),
|
|
1456
|
+
...scopedOverrides
|
|
1457
|
+
} } : {}
|
|
1458
|
+
};
|
|
1459
|
+
});
|
|
1460
|
+
}
|
|
1461
|
+
//#endregion
|
|
1441
1462
|
//#region src/configs/nextjs.ts
|
|
1442
1463
|
async function nextjs(options = {}) {
|
|
1443
1464
|
const { files = [GLOB_SRC], overrides = {} } = options;
|
|
@@ -1446,7 +1467,7 @@ async function nextjs(options = {}) {
|
|
|
1446
1467
|
function getRules(name) {
|
|
1447
1468
|
const rules = pluginNextJS.configs?.[name]?.rules;
|
|
1448
1469
|
if (!rules) throw new Error(`[${PACKAGE_NAME}] Failed to find config ${name} in @next/eslint-plugin-next`);
|
|
1449
|
-
return normalizeRules
|
|
1470
|
+
return normalizeRules(rules);
|
|
1450
1471
|
}
|
|
1451
1472
|
return [{
|
|
1452
1473
|
name: "config/nextjs/setup",
|
|
@@ -1469,9 +1490,6 @@ async function nextjs(options = {}) {
|
|
|
1469
1490
|
}
|
|
1470
1491
|
}];
|
|
1471
1492
|
}
|
|
1472
|
-
function normalizeRules$1(rules) {
|
|
1473
|
-
return Object.fromEntries(Object.entries(rules).map(([key, value]) => [key, typeof value === "string" ? [value] : value]));
|
|
1474
|
-
}
|
|
1475
1493
|
//#endregion
|
|
1476
1494
|
//#region src/configs/node.ts
|
|
1477
1495
|
async function node() {
|
|
@@ -2863,7 +2881,10 @@ async function typescript(options = {}) {
|
|
|
2863
2881
|
"ts/no-unused-vars": "off",
|
|
2864
2882
|
"ts/no-use-before-define": ["error", {
|
|
2865
2883
|
classes: false,
|
|
2884
|
+
enums: true,
|
|
2866
2885
|
functions: false,
|
|
2886
|
+
ignoreTypeReferences: true,
|
|
2887
|
+
typedefs: true,
|
|
2867
2888
|
variables: true
|
|
2868
2889
|
}],
|
|
2869
2890
|
"ts/no-useless-constructor": "off",
|
|
@@ -3251,6 +3272,7 @@ const defaultPluginRenaming = {
|
|
|
3251
3272
|
"@eslint-react": "react",
|
|
3252
3273
|
"@eslint-react/dom": "react-dom",
|
|
3253
3274
|
"@eslint-react/naming-convention": "react-naming-convention",
|
|
3275
|
+
"@medusajs": "medusa",
|
|
3254
3276
|
"@next/next": "next",
|
|
3255
3277
|
"@stylistic": "style",
|
|
3256
3278
|
"@typescript-eslint": "ts",
|
|
@@ -3271,7 +3293,7 @@ const defaultPluginRenaming = {
|
|
|
3271
3293
|
* The merged ESLint configurations.
|
|
3272
3294
|
*/
|
|
3273
3295
|
function config(options = {}, ...userConfigs) {
|
|
3274
|
-
const { astro: enableAstro = false, autoRenamePlugins = true, componentExts = [], e18e: enableE18e = true, gitignore: enableGitignore = true, ignores: userIgnores = [], imports: enableImports = true, jsdoc: enableJSDoc = false, jsx: enableJsx = true, nextjs: enableNextjs = false, pnpm: enableCatalogs = !!findUpSync("pnpm-workspace.yaml"), react: enableReact = false, regexp: enableRegexp = true, sanity: enableSanity = false, solid: enableSolid = false, storybook: enableStorybook = false, svelte: enableSvelte = false, tailwindcss: enableTailwindcss = false, typescript: enableTypeScript = isPackageExists("typescript"), unicorn: enableUnicorn = true, unocss: enableUnoCSS = false, vue: enableVue = VuePackages.some((i) => isPackageExists(i)) } = options;
|
|
3296
|
+
const { astro: enableAstro = false, autoRenamePlugins = true, componentExts = [], e18e: enableE18e = true, gitignore: enableGitignore = true, ignores: userIgnores = [], imports: enableImports = true, jsdoc: enableJSDoc = false, jsx: enableJsx = true, medusa: enableMedusa = false, nextjs: enableNextjs = false, pnpm: enableCatalogs = !!findUpSync("pnpm-workspace.yaml"), react: enableReact = false, regexp: enableRegexp = true, sanity: enableSanity = false, solid: enableSolid = false, storybook: enableStorybook = false, svelte: enableSvelte = false, tailwindcss: enableTailwindcss = false, typescript: enableTypeScript = isPackageExists("typescript"), unicorn: enableUnicorn = true, unocss: enableUnoCSS = false, vue: enableVue = VuePackages.some((i) => isPackageExists(i)) } = options;
|
|
3275
3297
|
let isInEditor = options.isInEditor;
|
|
3276
3298
|
if (isInEditor == null) {
|
|
3277
3299
|
isInEditor = isInEditorEnv();
|
|
@@ -3321,6 +3343,10 @@ function config(options = {}, ...userConfigs) {
|
|
|
3321
3343
|
overrides: getOverrides(options, "stylistic")
|
|
3322
3344
|
}));
|
|
3323
3345
|
if (enableRegexp) configs.push(regexp(typeof enableRegexp === "boolean" ? {} : enableRegexp));
|
|
3346
|
+
if (enableMedusa) configs.push(medusa({
|
|
3347
|
+
...resolveSubOptions(options, "medusa"),
|
|
3348
|
+
overrides: getOverrides(options, "medusa")
|
|
3349
|
+
}));
|
|
3324
3350
|
if (enableSanity) configs.push(sanity({
|
|
3325
3351
|
...resolveSubOptions(options, "sanity"),
|
|
3326
3352
|
overrides: getOverrides(options, "sanity")
|
|
@@ -3432,6 +3458,7 @@ const CONFIG_PRESET_FULL_ON = {
|
|
|
3432
3458
|
jsonc: true,
|
|
3433
3459
|
jsx: { a11y: true },
|
|
3434
3460
|
markdown: true,
|
|
3461
|
+
medusa: { preset: "strict" },
|
|
3435
3462
|
nextjs: true,
|
|
3436
3463
|
node: true,
|
|
3437
3464
|
pnpm: true,
|
|
@@ -3466,6 +3493,7 @@ const CONFIG_PRESET_FULL_OFF = {
|
|
|
3466
3493
|
jsonc: false,
|
|
3467
3494
|
jsx: false,
|
|
3468
3495
|
markdown: false,
|
|
3496
|
+
medusa: false,
|
|
3469
3497
|
nextjs: false,
|
|
3470
3498
|
node: false,
|
|
3471
3499
|
pnpm: false,
|
|
@@ -3486,4 +3514,4 @@ const CONFIG_PRESET_FULL_OFF = {
|
|
|
3486
3514
|
yaml: false
|
|
3487
3515
|
};
|
|
3488
3516
|
//#endregion
|
|
3489
|
-
export { CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SANITY, GLOB_SCSS, GLOB_SEARCH_EXCLUDE, GLOB_SRC, GLOB_SRC_EXT, GLOB_STORYBOOK, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, PACKAGE_NAME, StylisticConfigDefaults, astro, combine, command, comments, config, config as inferno, defaultPluginRenaming, disables, e18e, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInCursorAgent, isInEditorEnv, isInGitHooksOrLintStaged, isInVSCodeESLintExtension, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, normalizeRules, packageExportsSortOrder, packageSortOrder, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, sanity, solid, sortPackageJson, sortTsconfig, storybook, stylistic, svelte, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
|
|
3517
|
+
export { CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SANITY, GLOB_SCSS, GLOB_SEARCH_EXCLUDE, GLOB_SRC, GLOB_SRC_EXT, GLOB_STORYBOOK, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, PACKAGE_NAME, StylisticConfigDefaults, astro, combine, command, comments, config, config as inferno, defaultPluginRenaming, disables, e18e, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInCursorAgent, isInEditorEnv, isInGitHooksOrLintStaged, isInVSCodeESLintExtension, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, medusa, nextjs, node, normalizeRules, packageExportsSortOrder, packageSortOrder, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, sanity, solid, sortPackageJson, sortTsconfig, storybook, stylistic, svelte, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infernodesign/eslint-config",
|
|
3
3
|
"description": "ESLint config for Inferno Design.",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.12.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Inferno Design <support@infernodesign.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -43,107 +43,108 @@
|
|
|
43
43
|
"lint": "eslint --quiet",
|
|
44
44
|
"prepack": "bun run build",
|
|
45
45
|
"test": "vitest",
|
|
46
|
-
"typecheck": "
|
|
46
|
+
"typecheck": "tsc --noEmit"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@antfu/install-pkg": "
|
|
49
|
+
"@antfu/install-pkg": "2.0.1",
|
|
50
50
|
"@clack/prompts": "1.7.0",
|
|
51
|
-
"@e18e/eslint-plugin": "0.
|
|
51
|
+
"@e18e/eslint-plugin": "0.6.0",
|
|
52
52
|
"@eslint-community/eslint-plugin-eslint-comments": "4.7.2",
|
|
53
53
|
"@eslint/compat": "2.1.0",
|
|
54
54
|
"@eslint/config-array": "0.23.5",
|
|
55
|
-
"@eslint/config-helpers": "0.
|
|
55
|
+
"@eslint/config-helpers": "0.7.0",
|
|
56
56
|
"@eslint/markdown": "8.0.3",
|
|
57
57
|
"@stylistic/eslint-plugin": "5.10.0",
|
|
58
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
59
|
-
"@typescript-eslint/parser": "8.
|
|
60
|
-
"@typescript-eslint/utils": "8.
|
|
61
|
-
"@vitest/eslint-plugin": "1.6.
|
|
58
|
+
"@typescript-eslint/eslint-plugin": "8.65.0",
|
|
59
|
+
"@typescript-eslint/parser": "8.65.0",
|
|
60
|
+
"@typescript-eslint/utils": "8.65.0",
|
|
61
|
+
"@vitest/eslint-plugin": "1.6.24",
|
|
62
62
|
"ansis": "4.3.1",
|
|
63
63
|
"cac": "7.0.0",
|
|
64
64
|
"eslint-config-flat-gitignore": "2.3.0",
|
|
65
65
|
"eslint-flat-config-utils": "3.2.0",
|
|
66
66
|
"eslint-merge-processors": "2.0.0",
|
|
67
67
|
"eslint-plugin-antfu": "3.2.3",
|
|
68
|
-
"eslint-plugin-command": "3.5.
|
|
68
|
+
"eslint-plugin-command": "3.5.3",
|
|
69
69
|
"eslint-plugin-import-lite": "0.6.0",
|
|
70
|
-
"eslint-plugin-jsdoc": "63.
|
|
71
|
-
"eslint-plugin-jsonc": "3.
|
|
72
|
-
"eslint-plugin-n": "18.2.
|
|
70
|
+
"eslint-plugin-jsdoc": "63.3.2",
|
|
71
|
+
"eslint-plugin-jsonc": "3.3.0",
|
|
72
|
+
"eslint-plugin-n": "18.2.2",
|
|
73
73
|
"eslint-plugin-no-only-tests": "3.4.0",
|
|
74
|
-
"eslint-plugin-perfectionist": "5.
|
|
75
|
-
"eslint-plugin-pnpm": "1.
|
|
74
|
+
"eslint-plugin-perfectionist": "5.10.0",
|
|
75
|
+
"eslint-plugin-pnpm": "1.7.0",
|
|
76
76
|
"eslint-plugin-regexp": "3.1.1",
|
|
77
|
-
"eslint-plugin-toml": "1.
|
|
78
|
-
"eslint-plugin-unicorn": "
|
|
77
|
+
"eslint-plugin-toml": "1.5.0",
|
|
78
|
+
"eslint-plugin-unicorn": "72.0.0",
|
|
79
79
|
"eslint-plugin-unused-imports": "4.4.1",
|
|
80
|
-
"eslint-plugin-vue": "10.
|
|
81
|
-
"eslint-plugin-yml": "3.
|
|
80
|
+
"eslint-plugin-vue": "10.10.0",
|
|
81
|
+
"eslint-plugin-yml": "3.6.0",
|
|
82
82
|
"eslint-processor-vue-blocks": "2.0.0",
|
|
83
|
-
"globals": "17.
|
|
83
|
+
"globals": "17.8.0",
|
|
84
84
|
"jsonc-eslint-parser": "3.1.0",
|
|
85
85
|
"local-pkg": "1.2.1",
|
|
86
86
|
"parse-gitignore": "2.0.0",
|
|
87
87
|
"toml-eslint-parser": "1.0.3",
|
|
88
88
|
"vue-eslint-parser": "10.4.1",
|
|
89
|
-
"yaml-eslint-parser": "2.
|
|
89
|
+
"yaml-eslint-parser": "2.1.0"
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
92
|
-
"@eslint-react/eslint-plugin": "5.
|
|
93
|
-
"@eslint/config-inspector": "3.0
|
|
92
|
+
"@eslint-react/eslint-plugin": "5.18.0",
|
|
93
|
+
"@eslint/config-inspector": "3.1.0",
|
|
94
94
|
"@infernodesign/typescript-config": "workspace:*",
|
|
95
|
-
"@
|
|
95
|
+
"@medusajs/eslint-plugin": "2.18.0",
|
|
96
|
+
"@next/eslint-plugin-next": "16.2.12",
|
|
96
97
|
"@prettier/plugin-xml": "3.4.2",
|
|
97
98
|
"@sanity-labs/eslint-plugin": "1.0.0",
|
|
98
99
|
"@types/bun": "1.3.14",
|
|
99
100
|
"@types/eslint-plugin-jsx-a11y": "6.10.1",
|
|
100
|
-
"@types/node": "26.1.
|
|
101
|
-
"@
|
|
102
|
-
"
|
|
103
|
-
"
|
|
104
|
-
"eslint": "
|
|
105
|
-
"eslint-plugin-
|
|
106
|
-
"eslint-plugin-better-tailwindcss": "4.6.1",
|
|
101
|
+
"@types/node": "26.1.2",
|
|
102
|
+
"@unocss/eslint-plugin": "66.7.5",
|
|
103
|
+
"astro-eslint-parser": "3.0.0",
|
|
104
|
+
"eslint": "10.8.0",
|
|
105
|
+
"eslint-plugin-astro": "3.0.1",
|
|
106
|
+
"eslint-plugin-better-tailwindcss": "4.7.0",
|
|
107
107
|
"eslint-plugin-erasable-syntax-only": "0.4.2",
|
|
108
108
|
"eslint-plugin-format": "2.0.1",
|
|
109
109
|
"eslint-plugin-jsx-a11y": "6.10.2",
|
|
110
110
|
"eslint-plugin-react-refresh": "0.5.3",
|
|
111
111
|
"eslint-plugin-solid": "0.14.5",
|
|
112
|
-
"eslint-plugin-storybook": "10.
|
|
113
|
-
"eslint-plugin-svelte": "3.
|
|
112
|
+
"eslint-plugin-storybook": "10.5.5",
|
|
113
|
+
"eslint-plugin-svelte": "3.22.0",
|
|
114
114
|
"eslint-plugin-vuejs-accessibility": "2.5.0",
|
|
115
115
|
"eslint-typegen": "2.3.1",
|
|
116
|
-
"execa": "
|
|
116
|
+
"execa": "10.0.0",
|
|
117
117
|
"find-up-simple": "1.0.1",
|
|
118
118
|
"jiti": "2.7.0",
|
|
119
|
-
"pnpm-workspace-yaml": "1.
|
|
119
|
+
"pnpm-workspace-yaml": "1.7.0",
|
|
120
120
|
"prettier-plugin-astro": "0.14.1",
|
|
121
121
|
"prettier-plugin-slidev": "1.0.5",
|
|
122
|
-
"svelte": "5.56.
|
|
122
|
+
"svelte": "5.56.8",
|
|
123
123
|
"svelte-eslint-parser": "1.8.0",
|
|
124
124
|
"tinyglobby": "0.2.17",
|
|
125
|
-
"tsdown": "0.22.
|
|
125
|
+
"tsdown": "0.22.14",
|
|
126
126
|
"typescript": "6.0.3",
|
|
127
|
-
"vitest": "4.1.
|
|
128
|
-
"vue": "3.5.
|
|
127
|
+
"vitest": "4.1.10",
|
|
128
|
+
"vue": "3.5.40"
|
|
129
129
|
},
|
|
130
130
|
"peerDependencies": {
|
|
131
|
-
"@eslint-react/eslint-plugin": "^5.
|
|
132
|
-
"@
|
|
131
|
+
"@eslint-react/eslint-plugin": "^5.18.0",
|
|
132
|
+
"@medusajs/eslint-plugin": "^2.18.0",
|
|
133
|
+
"@next/eslint-plugin-next": "^16.2.12",
|
|
133
134
|
"@prettier/plugin-xml": "^3.4.2",
|
|
134
135
|
"@sanity-labs/eslint-plugin": "^1.0.0",
|
|
135
|
-
"@unocss/eslint-plugin": "^66.7.
|
|
136
|
-
"astro-eslint-parser": "^
|
|
137
|
-
"eslint": "^10.
|
|
138
|
-
"eslint-plugin-astro": "^
|
|
139
|
-
"eslint-plugin-better-tailwindcss": "^4.
|
|
136
|
+
"@unocss/eslint-plugin": "^66.7.5",
|
|
137
|
+
"astro-eslint-parser": "^3.0.0",
|
|
138
|
+
"eslint": "^10.8.0",
|
|
139
|
+
"eslint-plugin-astro": "^3.0.1",
|
|
140
|
+
"eslint-plugin-better-tailwindcss": "^4.7.0",
|
|
140
141
|
"eslint-plugin-erasable-syntax-only": "^0.4.2",
|
|
141
142
|
"eslint-plugin-format": "^2.0.1",
|
|
142
143
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
143
144
|
"eslint-plugin-react-refresh": "^0.5.3",
|
|
144
145
|
"eslint-plugin-solid": "^0.14.5",
|
|
145
|
-
"eslint-plugin-storybook": "^10.
|
|
146
|
-
"eslint-plugin-svelte": "^3.
|
|
146
|
+
"eslint-plugin-storybook": "^10.5.5",
|
|
147
|
+
"eslint-plugin-svelte": "^3.22.0",
|
|
147
148
|
"eslint-plugin-vuejs-accessibility": "^2.5.0",
|
|
148
149
|
"prettier-plugin-astro": "^0.14.1",
|
|
149
150
|
"prettier-plugin-slidev": "^1.0.5",
|
|
@@ -153,6 +154,9 @@
|
|
|
153
154
|
"@eslint-react/eslint-plugin": {
|
|
154
155
|
"optional": true
|
|
155
156
|
},
|
|
157
|
+
"@medusajs/eslint-plugin": {
|
|
158
|
+
"optional": true
|
|
159
|
+
},
|
|
156
160
|
"@next/eslint-plugin-next": {
|
|
157
161
|
"optional": true
|
|
158
162
|
},
|