@infernodesign/eslint-config 1.9.1 → 1.10.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/dist/cli.js +7 -7
- package/dist/index.d.ts +60 -4
- package/dist/index.js +59 -9
- package/package.json +34 -34
package/dist/cli.js
CHANGED
|
@@ -8,7 +8,7 @@ import parse from "parse-gitignore";
|
|
|
8
8
|
import { execSync } from "node:child_process";
|
|
9
9
|
|
|
10
10
|
//#region package.json
|
|
11
|
-
var version = "1.
|
|
11
|
+
var version = "1.10.0";
|
|
12
12
|
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region src/cli/constants.ts
|
|
@@ -171,20 +171,20 @@ async function updateEslintFiles(result) {
|
|
|
171
171
|
//#endregion
|
|
172
172
|
//#region src/cli/constants-generated.ts
|
|
173
173
|
const versionsMap = {
|
|
174
|
-
"@eslint-react/eslint-plugin": "^2.3.
|
|
175
|
-
"@next/eslint-plugin-next": "^16.0.
|
|
176
|
-
"@unocss/eslint-plugin": "^66.5.
|
|
174
|
+
"@eslint-react/eslint-plugin": "^2.3.12",
|
|
175
|
+
"@next/eslint-plugin-next": "^16.0.7",
|
|
176
|
+
"@unocss/eslint-plugin": "^66.5.10",
|
|
177
177
|
"astro-eslint-parser": "^1.2.2",
|
|
178
178
|
"eslint": "^9.39.1",
|
|
179
|
-
"eslint-plugin-astro": "^1.
|
|
180
|
-
"eslint-plugin-format": "^1.0
|
|
179
|
+
"eslint-plugin-astro": "^1.5.0",
|
|
180
|
+
"eslint-plugin-format": "^1.1.0",
|
|
181
181
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
182
182
|
"eslint-plugin-react-refresh": "^0.4.24",
|
|
183
183
|
"eslint-plugin-solid": "^0.14.5",
|
|
184
184
|
"eslint-plugin-svelte": "^3.13.0",
|
|
185
185
|
"prettier-plugin-astro": "^0.14.1",
|
|
186
186
|
"prettier-plugin-slidev": "^1.0.5",
|
|
187
|
-
"svelte-eslint-parser": "^1.4.
|
|
187
|
+
"svelte-eslint-parser": "^1.4.1"
|
|
188
188
|
};
|
|
189
189
|
|
|
190
190
|
//#endregion
|
package/dist/index.d.ts
CHANGED
|
@@ -959,6 +959,11 @@ interface RuleOptions {
|
|
|
959
959
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-property-type.md#repos-sticky-header
|
|
960
960
|
*/
|
|
961
961
|
'jsdoc/require-property-type'?: Linter.RuleEntry<[]>;
|
|
962
|
+
/**
|
|
963
|
+
* Requires that Promise rejections are documented with `@rejects` tags.
|
|
964
|
+
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-rejects.md#repos-sticky-header
|
|
965
|
+
*/
|
|
966
|
+
'jsdoc/require-rejects'?: Linter.RuleEntry<JsdocRequireRejects>;
|
|
962
967
|
/**
|
|
963
968
|
* Requires that returns are documented with `@returns`.
|
|
964
969
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-returns.md#repos-sticky-header
|
|
@@ -3508,6 +3513,7 @@ interface RuleOptions {
|
|
|
3508
3513
|
/**
|
|
3509
3514
|
* Disallow certain props on components.
|
|
3510
3515
|
* @see https://eslint-react.xyz/docs/rules/no-forbidden-props
|
|
3516
|
+
* @deprecated
|
|
3511
3517
|
*/
|
|
3512
3518
|
'react/no-forbidden-props'?: Linter.RuleEntry<ReactNoForbiddenProps>;
|
|
3513
3519
|
/**
|
|
@@ -3629,7 +3635,7 @@ interface RuleOptions {
|
|
|
3629
3635
|
* Prevents using referential-type values as default props in object destructuring.
|
|
3630
3636
|
* @see https://eslint-react.xyz/docs/rules/no-unstable-default-props
|
|
3631
3637
|
*/
|
|
3632
|
-
'react/no-unstable-default-props'?: Linter.RuleEntry<
|
|
3638
|
+
'react/no-unstable-default-props'?: Linter.RuleEntry<ReactNoUnstableDefaultProps>;
|
|
3633
3639
|
/**
|
|
3634
3640
|
* Warns unused class component methods and properties.
|
|
3635
3641
|
* @see https://eslint-react.xyz/docs/rules/no-unused-class-component-members
|
|
@@ -5275,6 +5281,11 @@ interface RuleOptions {
|
|
|
5275
5281
|
* @deprecated
|
|
5276
5282
|
*/
|
|
5277
5283
|
'template-tag-spacing'?: Linter.RuleEntry<TemplateTagSpacing>;
|
|
5284
|
+
/**
|
|
5285
|
+
* enforce using `.each` or `.for` consistently
|
|
5286
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-each-for.md
|
|
5287
|
+
*/
|
|
5288
|
+
'test/consistent-each-for'?: Linter.RuleEntry<TestConsistentEachFor>;
|
|
5278
5289
|
/**
|
|
5279
5290
|
* require test file pattern
|
|
5280
5291
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-test-filename.md
|
|
@@ -5497,7 +5508,7 @@ interface RuleOptions {
|
|
|
5497
5508
|
*/
|
|
5498
5509
|
'test/prefer-each'?: Linter.RuleEntry<[]>;
|
|
5499
5510
|
/**
|
|
5500
|
-
* enforce using the built-in
|
|
5511
|
+
* enforce using the built-in equality matchers
|
|
5501
5512
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-equality-matcher.md
|
|
5502
5513
|
*/
|
|
5503
5514
|
'test/prefer-equality-matcher'?: Linter.RuleEntry<[]>;
|
|
@@ -5606,11 +5617,21 @@ interface RuleOptions {
|
|
|
5606
5617
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-vi-mocked.md
|
|
5607
5618
|
*/
|
|
5608
5619
|
'test/prefer-vi-mocked'?: Linter.RuleEntry<[]>;
|
|
5620
|
+
/**
|
|
5621
|
+
* ensure that every `expect.poll` call is awaited
|
|
5622
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-awaited-expect-poll.md
|
|
5623
|
+
*/
|
|
5624
|
+
'test/require-awaited-expect-poll'?: Linter.RuleEntry<[]>;
|
|
5609
5625
|
/**
|
|
5610
5626
|
* require setup and teardown to be within a hook
|
|
5611
5627
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-hook.md
|
|
5612
5628
|
*/
|
|
5613
5629
|
'test/require-hook'?: Linter.RuleEntry<TestRequireHook>;
|
|
5630
|
+
/**
|
|
5631
|
+
* require usage of import in vi.mock()
|
|
5632
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-import-vi-mock.md
|
|
5633
|
+
*/
|
|
5634
|
+
'test/require-import-vi-mock'?: Linter.RuleEntry<[]>;
|
|
5614
5635
|
/**
|
|
5615
5636
|
* require local Test Context for concurrent snapshot tests
|
|
5616
5637
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-local-test-context-for-concurrent-snapshots.md
|
|
@@ -6210,6 +6231,11 @@ interface RuleOptions {
|
|
|
6210
6231
|
* @see https://typescript-eslint.io/rules/no-unused-expressions
|
|
6211
6232
|
*/
|
|
6212
6233
|
'ts/no-unused-expressions'?: Linter.RuleEntry<TsNoUnusedExpressions>;
|
|
6234
|
+
/**
|
|
6235
|
+
* Disallow unused private class members
|
|
6236
|
+
* @see https://typescript-eslint.io/rules/no-unused-private-class-members
|
|
6237
|
+
*/
|
|
6238
|
+
'ts/no-unused-private-class-members'?: Linter.RuleEntry<[]>;
|
|
6213
6239
|
/**
|
|
6214
6240
|
* Disallow unused variables
|
|
6215
6241
|
* @see https://typescript-eslint.io/rules/no-unused-vars
|
|
@@ -7657,6 +7683,11 @@ interface RuleOptions {
|
|
|
7657
7683
|
* @see https://eslint.vuejs.org/rules/no-duplicate-attributes.html
|
|
7658
7684
|
*/
|
|
7659
7685
|
'vue/no-duplicate-attributes'?: Linter.RuleEntry<VueNoDuplicateAttributes>;
|
|
7686
|
+
/**
|
|
7687
|
+
* disallow duplication of class names in class attributes
|
|
7688
|
+
* @see https://eslint.vuejs.org/rules/no-duplicate-class-names.html
|
|
7689
|
+
*/
|
|
7690
|
+
'vue/no-duplicate-class-names'?: Linter.RuleEntry<[]>;
|
|
7660
7691
|
/**
|
|
7661
7692
|
* disallow the `<template>` `<script>` `<style>` block to be empty
|
|
7662
7693
|
* @see https://eslint.vuejs.org/rules/no-empty-component-block.html
|
|
@@ -9198,6 +9229,7 @@ type JsdocCheckExamples = [] | [{
|
|
|
9198
9229
|
}];
|
|
9199
9230
|
// ----- jsdoc/check-indentation -----
|
|
9200
9231
|
type JsdocCheckIndentation = [] | [{
|
|
9232
|
+
allowIndentedSections?: boolean;
|
|
9201
9233
|
excludeTags?: string[];
|
|
9202
9234
|
}];
|
|
9203
9235
|
// ----- jsdoc/check-line-alignment -----
|
|
@@ -9544,6 +9576,14 @@ type JsdocRequireParamType = [] | [{
|
|
|
9544
9576
|
defaultDestructuredRootType?: string;
|
|
9545
9577
|
setDefaultDestructuredRootType?: boolean;
|
|
9546
9578
|
}];
|
|
9579
|
+
// ----- jsdoc/require-rejects -----
|
|
9580
|
+
type JsdocRequireRejects = [] | [{
|
|
9581
|
+
contexts?: (string | {
|
|
9582
|
+
comment?: string;
|
|
9583
|
+
context?: string;
|
|
9584
|
+
})[];
|
|
9585
|
+
exemptedBy?: string[];
|
|
9586
|
+
}];
|
|
9547
9587
|
// ----- jsdoc/require-returns -----
|
|
9548
9588
|
type JsdocRequireReturns = [] | [{
|
|
9549
9589
|
checkConstructors?: boolean;
|
|
@@ -9634,6 +9674,9 @@ type JsdocSortTags = [] | [{
|
|
|
9634
9674
|
linesBetween?: number;
|
|
9635
9675
|
reportIntraTagGroupSpacing?: boolean;
|
|
9636
9676
|
reportTagGroupSpacing?: boolean;
|
|
9677
|
+
tagExceptions?: {
|
|
9678
|
+
[k: string]: number;
|
|
9679
|
+
};
|
|
9637
9680
|
tagSequence?: {
|
|
9638
9681
|
tags?: string[];
|
|
9639
9682
|
}[];
|
|
@@ -13450,8 +13493,13 @@ type ReactNoForbiddenProps = [] | [{
|
|
|
13450
13493
|
prop: string;
|
|
13451
13494
|
})[];
|
|
13452
13495
|
}];
|
|
13496
|
+
// ----- react/no-unstable-default-props -----
|
|
13497
|
+
type ReactNoUnstableDefaultProps = [] | [{
|
|
13498
|
+
safeDefaultProps?: string[];
|
|
13499
|
+
}];
|
|
13453
13500
|
// ----- react/no-useless-fragment -----
|
|
13454
13501
|
type ReactNoUselessFragment = [] | [{
|
|
13502
|
+
allowEmptyFragment?: boolean;
|
|
13455
13503
|
allowExpressions?: boolean;
|
|
13456
13504
|
}];
|
|
13457
13505
|
// ----- regexp/hexadecimal-escape -----
|
|
@@ -15164,6 +15212,13 @@ type SwitchColonSpacing = [] | [{
|
|
|
15164
15212
|
type TemplateCurlySpacing = [] | [("always" | "never")];
|
|
15165
15213
|
// ----- template-tag-spacing -----
|
|
15166
15214
|
type TemplateTagSpacing = [] | [("always" | "never")];
|
|
15215
|
+
// ----- test/consistent-each-for -----
|
|
15216
|
+
type TestConsistentEachFor = [] | [{
|
|
15217
|
+
test?: ("each" | "for");
|
|
15218
|
+
it?: ("each" | "for");
|
|
15219
|
+
describe?: ("each" | "for");
|
|
15220
|
+
suite?: ("each" | "for");
|
|
15221
|
+
}];
|
|
15167
15222
|
// ----- test/consistent-test-filename -----
|
|
15168
15223
|
type TestConsistentTestFilename = [] | [{
|
|
15169
15224
|
pattern?: string;
|
|
@@ -15197,7 +15252,7 @@ type TestNoFocusedTests = [] | [{
|
|
|
15197
15252
|
}];
|
|
15198
15253
|
// ----- test/no-hooks -----
|
|
15199
15254
|
type TestNoHooks = [] | [{
|
|
15200
|
-
allow?:
|
|
15255
|
+
allow?: ("beforeAll" | "beforeEach" | "afterAll" | "afterEach")[];
|
|
15201
15256
|
}];
|
|
15202
15257
|
// ----- test/no-large-snapshots -----
|
|
15203
15258
|
type TestNoLargeSnapshots = [] | [{
|
|
@@ -18370,6 +18425,7 @@ declare function ensurePackages(packages: (string | undefined)[]): Promise<void>
|
|
|
18370
18425
|
declare function interopDefault<T>(m: Awaitable<T>): Promise<T extends {
|
|
18371
18426
|
default: infer U;
|
|
18372
18427
|
} ? U : T>;
|
|
18428
|
+
declare function isInCursorAgent(): boolean;
|
|
18373
18429
|
declare function isInEditorEnv(): boolean;
|
|
18374
18430
|
declare function isInGitHooksOrLintStaged(): boolean;
|
|
18375
18431
|
declare function isInVSCodeESLintExtension(): boolean;
|
|
@@ -18379,4 +18435,4 @@ declare function renamePluginInConfigs(configs: TypedFlatConfigItem[], map: Reco
|
|
|
18379
18435
|
declare function renameRules(rules: Record<string, any>, map: Record<string, string>): Record<string, any>;
|
|
18380
18436
|
declare function toArray<T>(value: T | T[]): T[];
|
|
18381
18437
|
//#endregion
|
|
18382
|
-
export { Awaitable, type ConfigNames, 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_SCSS, 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, OptionsComponentExts, OptionsConfig, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIsInEditor, OptionsJSX, OptionsJSXA11y, OptionsNextjs, OptionsOverrides, OptionsProjectType, OptionsRegExp, OptionsStylistic, OptionsTailwindcss, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsUnicorn, OptionsUnoCSS, OptionsVue, ResolvedOptions, Rules, StylisticConfig, StylisticConfigDefaults, StylisticOptions, TypedFlatConfigItem, astro, combine, command, comments, inferno as default, inferno, defaultPluginRenaming, disables, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isInVSCodeESLintExtension, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, normalizeRules, packageExportsSortOrder, packageSortOrder, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, storybook, stylistic, svelte, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
|
|
18438
|
+
export { Awaitable, type ConfigNames, 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_SCSS, 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, OptionsComponentExts, OptionsConfig, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIsInEditor, OptionsJSX, OptionsJSXA11y, OptionsNextjs, OptionsOverrides, OptionsProjectType, OptionsRegExp, OptionsStylistic, OptionsTailwindcss, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsUnicorn, OptionsUnoCSS, OptionsVue, ResolvedOptions, Rules, StylisticConfig, StylisticConfigDefaults, StylisticOptions, TypedFlatConfigItem, astro, combine, command, comments, inferno as default, inferno, defaultPluginRenaming, disables, 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, solid, sortPackageJson, sortTsconfig, storybook, stylistic, svelte, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
|
package/dist/index.js
CHANGED
|
@@ -110,6 +110,11 @@ const GLOB_EXCLUDE = [
|
|
|
110
110
|
//#region src/utils.ts
|
|
111
111
|
const scopeUrl = fileURLToPath(new URL(".", import.meta.url));
|
|
112
112
|
const isCwdInScope = isPackageExists("@infernodesign/eslint-config");
|
|
113
|
+
/**
|
|
114
|
+
* Plain parser.
|
|
115
|
+
*
|
|
116
|
+
* @returns {Linter.Parser} The plain parser.
|
|
117
|
+
*/
|
|
113
118
|
const parserPlain = {
|
|
114
119
|
meta: { name: "parser-plain" },
|
|
115
120
|
parseForESLint: (code) => ({
|
|
@@ -138,6 +143,12 @@ const parserPlain = {
|
|
|
138
143
|
async function combine(...configs$1) {
|
|
139
144
|
return (await Promise.all(configs$1)).flat();
|
|
140
145
|
}
|
|
146
|
+
/**
|
|
147
|
+
* Ensure packages are installed.
|
|
148
|
+
*
|
|
149
|
+
* @param {string[]} packages The packages to ensure are installed.
|
|
150
|
+
* @returns {Promise<void>} The promise to ensure packages are installed.
|
|
151
|
+
*/
|
|
141
152
|
async function ensurePackages(packages) {
|
|
142
153
|
if (process.env.CI || process.stdout.isTTY === false || isCwdInScope === false) return;
|
|
143
154
|
const nonExistingPackages = packages.filter((i) => i && !isPackageInScope(i));
|
|
@@ -148,14 +159,38 @@ async function ensurePackages(packages) {
|
|
|
148
159
|
}
|
|
149
160
|
if (await (await import("@clack/prompts")).confirm({ message: `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?` })) await import("@antfu/install-pkg").then((i) => i.installPackage(nonExistingPackages, { dev: true }));
|
|
150
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
* Interop default.
|
|
164
|
+
*
|
|
165
|
+
* @param {Awaitable<T>} m The module to interop default from.
|
|
166
|
+
* @returns {Promise<T extends { default: infer U } ? U : T>} The interop default.
|
|
167
|
+
*/
|
|
151
168
|
async function interopDefault(m) {
|
|
152
169
|
const resolved = await m;
|
|
153
170
|
return resolved.default || resolved;
|
|
154
171
|
}
|
|
172
|
+
/**
|
|
173
|
+
* Check if running in Cursor Agent.
|
|
174
|
+
*
|
|
175
|
+
* @returns {boolean} True if running in Cursor Agent, false otherwise.
|
|
176
|
+
*/
|
|
177
|
+
function isInCursorAgent() {
|
|
178
|
+
return !!process.env.CURSOR_AGENT;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Check if running in editor environment.
|
|
182
|
+
*
|
|
183
|
+
* @returns {boolean} True if running in editor environment, false otherwise.
|
|
184
|
+
*/
|
|
155
185
|
function isInEditorEnv() {
|
|
156
|
-
if (process.env.CI || isInGitHooksOrLintStaged()) return false;
|
|
186
|
+
if (process.env.CI || isInGitHooksOrLintStaged() || isInCursorAgent()) return false;
|
|
157
187
|
return !!(process.env.VSCODE_PID || process.env.VSCODE_CWD || process.env.JETBRAINS_IDE || process.env.VIM || process.env.NVIM);
|
|
158
188
|
}
|
|
189
|
+
/**
|
|
190
|
+
* Check if running in git hooks or lint staged.
|
|
191
|
+
*
|
|
192
|
+
* @returns {boolean} True if running in git hooks or lint staged, false otherwise.
|
|
193
|
+
*/
|
|
159
194
|
function isInGitHooksOrLintStaged() {
|
|
160
195
|
return !!(process.env.GIT_PARAMS || process.env.VSCODE_GIT_COMMAND || process.env.npm_lifecycle_script?.startsWith("lint-staged") || process.env.npm_lifecycle_script?.startsWith("lefthook pre-commit"));
|
|
161
196
|
}
|
|
@@ -167,9 +202,21 @@ function isInGitHooksOrLintStaged() {
|
|
|
167
202
|
function isInVSCodeESLintExtension() {
|
|
168
203
|
return !!(typeof process.send === "function" && (process.env.VSCODE_PID || process.env.VSCODE_CWD) || process.env.VSCODE_ESL_DEBUG);
|
|
169
204
|
}
|
|
205
|
+
/**
|
|
206
|
+
* Check if package is in scope.
|
|
207
|
+
*
|
|
208
|
+
* @param {string} name The name of the package to check.
|
|
209
|
+
* @returns {boolean} True if package is in scope, false otherwise.
|
|
210
|
+
*/
|
|
170
211
|
function isPackageInScope(name) {
|
|
171
212
|
return isPackageExists(name, { paths: [scopeUrl] });
|
|
172
213
|
}
|
|
214
|
+
/**
|
|
215
|
+
* Normalize rules.
|
|
216
|
+
*
|
|
217
|
+
* @param {Record<string, any>} rules The rules to normalize.
|
|
218
|
+
* @returns {Record<string, any>} The normalized rules.
|
|
219
|
+
*/
|
|
173
220
|
function normalizeRules(rules) {
|
|
174
221
|
return Object.fromEntries(Object.entries(rules).map(([key, value]) => [key, typeof value === "string" ? [value] : value]));
|
|
175
222
|
}
|
|
@@ -231,6 +278,12 @@ function renameRules(rules, map) {
|
|
|
231
278
|
return [key, value];
|
|
232
279
|
}));
|
|
233
280
|
}
|
|
281
|
+
/**
|
|
282
|
+
* Convert value to array.
|
|
283
|
+
*
|
|
284
|
+
* @param {T | T[]} value The value to convert to array.
|
|
285
|
+
* @returns {T[]} The value as array.
|
|
286
|
+
*/
|
|
234
287
|
function toArray(value) {
|
|
235
288
|
return Array.isArray(value) ? value : [value];
|
|
236
289
|
}
|
|
@@ -301,7 +354,7 @@ async function comments() {
|
|
|
301
354
|
rules: {
|
|
302
355
|
"eslint-comments/no-aggregating-enable": "error",
|
|
303
356
|
"eslint-comments/no-duplicate-disable": "error",
|
|
304
|
-
"eslint-comments/no-unlimited-disable": "
|
|
357
|
+
"eslint-comments/no-unlimited-disable": "off",
|
|
305
358
|
"eslint-comments/no-unused-enable": "error"
|
|
306
359
|
}
|
|
307
360
|
}];
|
|
@@ -467,10 +520,7 @@ async function stylistic(options = {}) {
|
|
|
467
520
|
}],
|
|
468
521
|
"style/template-curly-spacing": ["error", "never"],
|
|
469
522
|
"style/template-tag-spacing": ["error", "never"],
|
|
470
|
-
"style/type-annotation-spacing":
|
|
471
|
-
after: true,
|
|
472
|
-
before: false
|
|
473
|
-
}],
|
|
523
|
+
"style/type-annotation-spacing": "off",
|
|
474
524
|
"style/type-generic-spacing": ["error"],
|
|
475
525
|
"style/type-named-tuple-spacing": ["error"],
|
|
476
526
|
"style/wrap-iife": ["error", "outside"],
|
|
@@ -888,7 +938,7 @@ async function javascript(options = {}) {
|
|
|
888
938
|
"symbol-description": "error",
|
|
889
939
|
"unicode-bom": ["error", "never"],
|
|
890
940
|
"unused-imports/no-unused-imports": isInEditor ? "warn" : "error",
|
|
891
|
-
"unused-imports/no-unused-vars": ["
|
|
941
|
+
"unused-imports/no-unused-vars": ["warn", {
|
|
892
942
|
args: "after-used",
|
|
893
943
|
argsIgnorePattern: "^_",
|
|
894
944
|
ignoreRestSiblings: true,
|
|
@@ -2059,7 +2109,7 @@ async function svelte(options = {}) {
|
|
|
2059
2109
|
"svelte/require-store-callbacks-use-set-param": "error",
|
|
2060
2110
|
"svelte/system": "error",
|
|
2061
2111
|
"svelte/valid-each-key": "error",
|
|
2062
|
-
"unused-imports/no-unused-vars": ["
|
|
2112
|
+
"unused-imports/no-unused-vars": ["warn", {
|
|
2063
2113
|
args: "after-used",
|
|
2064
2114
|
argsIgnorePattern: "^_",
|
|
2065
2115
|
vars: "all",
|
|
@@ -2845,4 +2895,4 @@ function resolveSubOptions(options, key) {
|
|
|
2845
2895
|
var src_default = inferno;
|
|
2846
2896
|
|
|
2847
2897
|
//#endregion
|
|
2848
|
-
export { 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_SCSS, 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, StylisticConfigDefaults, astro, combine, command, comments, src_default as default, defaultPluginRenaming, disables, ensurePackages, formatters, getOverrides, ignores, imports, inferno, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isInVSCodeESLintExtension, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, normalizeRules, packageExportsSortOrder, packageSortOrder, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, storybook, stylistic, svelte, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
|
|
2898
|
+
export { 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_SCSS, 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, StylisticConfigDefaults, astro, combine, command, comments, src_default as default, defaultPluginRenaming, disables, ensurePackages, formatters, getOverrides, ignores, imports, inferno, interopDefault, isInCursorAgent, isInEditorEnv, isInGitHooksOrLintStaged, isInVSCodeESLintExtension, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, normalizeRules, packageExportsSortOrder, packageSortOrder, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, 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": "1.
|
|
4
|
+
"version": "1.10.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Inferno Design <support@infernodesign.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -38,31 +38,31 @@
|
|
|
38
38
|
"@antfu/install-pkg": "^1.1.0",
|
|
39
39
|
"@clack/prompts": "^0.11.0",
|
|
40
40
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
41
|
-
"@eslint/markdown": "^7.5.
|
|
42
|
-
"@stylistic/eslint-plugin": "^5.
|
|
43
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
44
|
-
"@typescript-eslint/parser": "^8.
|
|
45
|
-
"@vitest/eslint-plugin": "^1.
|
|
41
|
+
"@eslint/markdown": "^7.5.1",
|
|
42
|
+
"@stylistic/eslint-plugin": "^5.6.1",
|
|
43
|
+
"@typescript-eslint/eslint-plugin": "^8.48.1",
|
|
44
|
+
"@typescript-eslint/parser": "^8.48.1",
|
|
45
|
+
"@vitest/eslint-plugin": "^1.5.1",
|
|
46
46
|
"ansis": "^4.2.0",
|
|
47
47
|
"cac": "^6.7.14",
|
|
48
48
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
49
49
|
"eslint-flat-config-utils": "^2.1.4",
|
|
50
50
|
"eslint-merge-processors": "^2.0.0",
|
|
51
51
|
"eslint-plugin-antfu": "^3.1.1",
|
|
52
|
-
"eslint-plugin-better-tailwindcss": "^3.7.
|
|
52
|
+
"eslint-plugin-better-tailwindcss": "^3.7.11",
|
|
53
53
|
"eslint-plugin-command": "^3.3.1",
|
|
54
54
|
"eslint-plugin-import-lite": "^0.3.0",
|
|
55
|
-
"eslint-plugin-jsdoc": "^61.1
|
|
55
|
+
"eslint-plugin-jsdoc": "^61.4.1",
|
|
56
56
|
"eslint-plugin-jsonc": "^2.21.0",
|
|
57
57
|
"eslint-plugin-n": "^17.23.1",
|
|
58
58
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
59
59
|
"eslint-plugin-perfectionist": "^4.15.1",
|
|
60
|
-
"eslint-plugin-pnpm": "^1.
|
|
60
|
+
"eslint-plugin-pnpm": "^1.4.0",
|
|
61
61
|
"eslint-plugin-regexp": "^2.10.0",
|
|
62
62
|
"eslint-plugin-toml": "^0.12.0",
|
|
63
63
|
"eslint-plugin-unicorn": "^62.0.0",
|
|
64
64
|
"eslint-plugin-unused-imports": "^4.3.0",
|
|
65
|
-
"eslint-plugin-vue": "^10.
|
|
65
|
+
"eslint-plugin-vue": "^10.6.2",
|
|
66
66
|
"eslint-plugin-yml": "^1.19.0",
|
|
67
67
|
"eslint-processor-vue-blocks": "^2.0.0",
|
|
68
68
|
"globals": "^16.5.0",
|
|
@@ -71,62 +71,62 @@
|
|
|
71
71
|
"parse-gitignore": "^2.0.0",
|
|
72
72
|
"toml-eslint-parser": "^0.10.0",
|
|
73
73
|
"vue-eslint-parser": "^10.2.0",
|
|
74
|
-
"yaml-eslint-parser": "^1.3.
|
|
74
|
+
"yaml-eslint-parser": "^1.3.2"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
|
-
"@eslint-react/eslint-plugin": "^2.3.
|
|
78
|
-
"@eslint/config-inspector": "^1.
|
|
79
|
-
"@next/eslint-plugin-next": "^16.0.
|
|
77
|
+
"@eslint-react/eslint-plugin": "^2.3.12",
|
|
78
|
+
"@eslint/config-inspector": "^1.4.2",
|
|
79
|
+
"@next/eslint-plugin-next": "^16.0.7",
|
|
80
80
|
"@prettier/plugin-xml": "^3.4.2",
|
|
81
81
|
"@types/eslint-plugin-jsx-a11y": "^6.10.1",
|
|
82
|
-
"@types/node": "^24.10.
|
|
83
|
-
"@unocss/eslint-plugin": "^66.5.
|
|
82
|
+
"@types/node": "^24.10.1",
|
|
83
|
+
"@unocss/eslint-plugin": "^66.5.10",
|
|
84
84
|
"astro-eslint-parser": "^1.2.2",
|
|
85
85
|
"eslint": "^9.39.1",
|
|
86
|
-
"eslint-plugin-astro": "^1.
|
|
87
|
-
"eslint-plugin-format": "^1.0
|
|
86
|
+
"eslint-plugin-astro": "^1.5.0",
|
|
87
|
+
"eslint-plugin-format": "^1.1.0",
|
|
88
88
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
89
89
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
90
90
|
"eslint-plugin-react-refresh": "^0.4.24",
|
|
91
91
|
"eslint-plugin-solid": "^0.14.5",
|
|
92
|
-
"eslint-plugin-storybook": "^10.
|
|
92
|
+
"eslint-plugin-storybook": "^10.1.4",
|
|
93
93
|
"eslint-plugin-svelte": "^3.13.0",
|
|
94
94
|
"eslint-plugin-vuejs-accessibility": "^2.4.1",
|
|
95
95
|
"eslint-typegen": "^2.3.0",
|
|
96
|
-
"execa": "^9.6.
|
|
96
|
+
"execa": "^9.6.1",
|
|
97
97
|
"jiti": "^2.6.1",
|
|
98
|
-
"pnpm-workspace-yaml": "^1.
|
|
98
|
+
"pnpm-workspace-yaml": "^1.4.0",
|
|
99
99
|
"prettier-plugin-astro": "^0.14.1",
|
|
100
100
|
"prettier-plugin-slidev": "^1.0.5",
|
|
101
|
-
"svelte": "^5.
|
|
102
|
-
"svelte-eslint-parser": "^1.4.
|
|
101
|
+
"svelte": "^5.45.5",
|
|
102
|
+
"svelte-eslint-parser": "^1.4.1",
|
|
103
103
|
"tinyglobby": "^0.2.15",
|
|
104
|
-
"tsdown": "^0.
|
|
105
|
-
"tsx": "^4.
|
|
104
|
+
"tsdown": "^0.17.0",
|
|
105
|
+
"tsx": "^4.21.0",
|
|
106
106
|
"typescript": "^5.9.3",
|
|
107
|
-
"vitest": "^4.0.
|
|
108
|
-
"vue": "^3.5.
|
|
107
|
+
"vitest": "^4.0.15",
|
|
108
|
+
"vue": "^3.5.25",
|
|
109
109
|
"@infernodesign/typescript-config": "1.3.0"
|
|
110
110
|
},
|
|
111
111
|
"peerDependencies": {
|
|
112
|
-
"@eslint-react/eslint-plugin": "^2.3.
|
|
113
|
-
"@next/eslint-plugin-next": "^16.0.
|
|
112
|
+
"@eslint-react/eslint-plugin": "^2.3.12",
|
|
113
|
+
"@next/eslint-plugin-next": "^16.0.7",
|
|
114
114
|
"@prettier/plugin-xml": "^3.4.2",
|
|
115
|
-
"@unocss/eslint-plugin": "^66.5.
|
|
115
|
+
"@unocss/eslint-plugin": "^66.5.10",
|
|
116
116
|
"astro-eslint-parser": "^1.2.2",
|
|
117
117
|
"eslint": "^9.39.1",
|
|
118
|
-
"eslint-plugin-astro": "^1.
|
|
119
|
-
"eslint-plugin-format": "^1.0
|
|
118
|
+
"eslint-plugin-astro": "^1.5.0",
|
|
119
|
+
"eslint-plugin-format": "^1.1.0",
|
|
120
120
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
121
121
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
122
122
|
"eslint-plugin-react-refresh": "^0.4.24",
|
|
123
123
|
"eslint-plugin-solid": "^0.14.5",
|
|
124
|
-
"eslint-plugin-storybook": "^10.
|
|
124
|
+
"eslint-plugin-storybook": "^10.1.4",
|
|
125
125
|
"eslint-plugin-svelte": "^3.13.0",
|
|
126
126
|
"eslint-plugin-vuejs-accessibility": "^2.4.1",
|
|
127
127
|
"prettier-plugin-astro": "^0.14.1",
|
|
128
128
|
"prettier-plugin-slidev": "^1.0.5",
|
|
129
|
-
"svelte-eslint-parser": "^1.4.
|
|
129
|
+
"svelte-eslint-parser": "^1.4.1"
|
|
130
130
|
},
|
|
131
131
|
"peerDependenciesMeta": {
|
|
132
132
|
"@eslint-react/eslint-plugin": {
|