@ariel-salgado/eslint-config 0.4.0 → 0.5.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/index.d.mts +135 -29
- package/dist/index.mjs +109 -75
- package/package.json +56 -54
package/dist/index.d.mts
CHANGED
|
@@ -209,6 +209,87 @@ interface RuleOptions {
|
|
|
209
209
|
* @see https://eslint.org/docs/latest/rules/dot-notation
|
|
210
210
|
*/
|
|
211
211
|
'dot-notation'?: Linter.RuleEntry<DotNotation>;
|
|
212
|
+
/**
|
|
213
|
+
* Bans a list of dependencies from being used
|
|
214
|
+
* @see https://github.com/es-tooling/eslint-plugin-depend/blob/main/docs/rules/ban-dependencies.md
|
|
215
|
+
*/
|
|
216
|
+
'e18e/ban-dependencies'?: Linter.RuleEntry<E18EBanDependencies>;
|
|
217
|
+
/**
|
|
218
|
+
* Prefer optimized alternatives to `indexOf()` equality checks
|
|
219
|
+
*/
|
|
220
|
+
'e18e/no-indexof-equality'?: Linter.RuleEntry<[]>;
|
|
221
|
+
/**
|
|
222
|
+
* Prefer Array.prototype.at() over length-based indexing
|
|
223
|
+
*/
|
|
224
|
+
'e18e/prefer-array-at'?: Linter.RuleEntry<[]>;
|
|
225
|
+
/**
|
|
226
|
+
* Prefer Array.prototype.fill() over Array.from or map with constant values
|
|
227
|
+
*/
|
|
228
|
+
'e18e/prefer-array-fill'?: Linter.RuleEntry<[]>;
|
|
229
|
+
/**
|
|
230
|
+
* Prefer Array.from(iterable, mapper) over [...iterable].map(mapper) to avoid intermediate array allocation
|
|
231
|
+
*/
|
|
232
|
+
'e18e/prefer-array-from-map'?: Linter.RuleEntry<[]>;
|
|
233
|
+
/**
|
|
234
|
+
* Prefer Array.some() over Array.find() when checking for element existence
|
|
235
|
+
*/
|
|
236
|
+
'e18e/prefer-array-some'?: Linter.RuleEntry<[]>;
|
|
237
|
+
/**
|
|
238
|
+
* Prefer Array.prototype.toReversed() over copying and reversing arrays
|
|
239
|
+
*/
|
|
240
|
+
'e18e/prefer-array-to-reversed'?: Linter.RuleEntry<[]>;
|
|
241
|
+
/**
|
|
242
|
+
* Prefer Array.prototype.toSorted() over copying and sorting arrays
|
|
243
|
+
*/
|
|
244
|
+
'e18e/prefer-array-to-sorted'?: Linter.RuleEntry<[]>;
|
|
245
|
+
/**
|
|
246
|
+
* Prefer Array.prototype.toSpliced() over copying and splicing arrays
|
|
247
|
+
*/
|
|
248
|
+
'e18e/prefer-array-to-spliced'?: Linter.RuleEntry<[]>;
|
|
249
|
+
/**
|
|
250
|
+
* Prefer Date.now() over new Date().getTime() and +new Date()
|
|
251
|
+
*/
|
|
252
|
+
'e18e/prefer-date-now'?: Linter.RuleEntry<[]>;
|
|
253
|
+
/**
|
|
254
|
+
* Prefer the exponentiation operator ** over Math.pow()
|
|
255
|
+
*/
|
|
256
|
+
'e18e/prefer-exponentiation-operator'?: Linter.RuleEntry<[]>;
|
|
257
|
+
/**
|
|
258
|
+
* Prefer .includes() over indexOf() comparisons for arrays and strings
|
|
259
|
+
*/
|
|
260
|
+
'e18e/prefer-includes'?: Linter.RuleEntry<[]>;
|
|
261
|
+
/**
|
|
262
|
+
* Prefer inline equality checks over temporary object creation for simple comparisons
|
|
263
|
+
*/
|
|
264
|
+
'e18e/prefer-inline-equality'?: Linter.RuleEntry<[]>;
|
|
265
|
+
/**
|
|
266
|
+
* Prefer nullish coalescing operator (?? and ??=) over verbose null checks
|
|
267
|
+
*/
|
|
268
|
+
'e18e/prefer-nullish-coalescing'?: Linter.RuleEntry<[]>;
|
|
269
|
+
/**
|
|
270
|
+
* Prefer Object.hasOwn() over Object.prototype.hasOwnProperty.call() and obj.hasOwnProperty()
|
|
271
|
+
*/
|
|
272
|
+
'e18e/prefer-object-has-own'?: Linter.RuleEntry<[]>;
|
|
273
|
+
/**
|
|
274
|
+
* prefer `RegExp.test()` over `String.match()` and `RegExp.exec()` when only checking for match existence
|
|
275
|
+
*/
|
|
276
|
+
'e18e/prefer-regex-test'?: Linter.RuleEntry<[]>;
|
|
277
|
+
/**
|
|
278
|
+
* Prefer spread syntax over Array.concat(), Array.from(), Object.assign({}, ...), and Function.apply()
|
|
279
|
+
*/
|
|
280
|
+
'e18e/prefer-spread-syntax'?: Linter.RuleEntry<[]>;
|
|
281
|
+
/**
|
|
282
|
+
* Prefer defining regular expressions at module scope to avoid re-compilation on every function call
|
|
283
|
+
*/
|
|
284
|
+
'e18e/prefer-static-regex'?: Linter.RuleEntry<[]>;
|
|
285
|
+
/**
|
|
286
|
+
* Prefer passing function and arguments directly to setTimeout/setInterval instead of wrapping in an arrow function or using bind
|
|
287
|
+
*/
|
|
288
|
+
'e18e/prefer-timer-args'?: Linter.RuleEntry<[]>;
|
|
289
|
+
/**
|
|
290
|
+
* Prefer URL.canParse() over try-catch blocks for URL validation
|
|
291
|
+
*/
|
|
292
|
+
'e18e/prefer-url-canparse'?: Linter.RuleEntry<[]>;
|
|
212
293
|
/**
|
|
213
294
|
* Require or disallow newline at the end of files
|
|
214
295
|
* @see https://eslint.org/docs/latest/rules/eol-last
|
|
@@ -248,6 +329,7 @@ interface RuleOptions {
|
|
|
248
329
|
/**
|
|
249
330
|
* disallow unused `eslint-disable` comments
|
|
250
331
|
* @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-unused-disable.html
|
|
332
|
+
* @deprecated
|
|
251
333
|
*/
|
|
252
334
|
'eslint-comments/no-unused-disable'?: Linter.RuleEntry<[]>;
|
|
253
335
|
/**
|
|
@@ -7341,6 +7423,11 @@ type DotLocation = [] | [("object" | "property")]; // ----- dot-notation -----
|
|
|
7341
7423
|
type DotNotation = [] | [{
|
|
7342
7424
|
allowKeywords?: boolean;
|
|
7343
7425
|
allowPattern?: string;
|
|
7426
|
+
}]; // ----- e18e/ban-dependencies -----
|
|
7427
|
+
type E18EBanDependencies = [] | [{
|
|
7428
|
+
presets?: string[];
|
|
7429
|
+
modules?: string[];
|
|
7430
|
+
allowed?: string[];
|
|
7344
7431
|
}]; // ----- eol-last -----
|
|
7345
7432
|
type EolLast = [] | [("always" | "never" | "unix" | "windows")]; // ----- eqeqeq -----
|
|
7346
7433
|
type Eqeqeq = ([] | ["always"] | ["always", {
|
|
@@ -12587,33 +12674,33 @@ type StyleExpListStyle = [] | [{
|
|
|
12587
12674
|
singleLine?: _StyleExpListStyle_SingleLineConfig;
|
|
12588
12675
|
multiLine?: _StyleExpListStyle_MultiLineConfig;
|
|
12589
12676
|
overrides?: {
|
|
12590
|
-
"()"?: _StyleExpListStyle_BaseConfig;
|
|
12591
|
-
"[]"?: _StyleExpListStyle_BaseConfig;
|
|
12592
|
-
"{}"?: _StyleExpListStyle_BaseConfig;
|
|
12593
|
-
"<>"?: _StyleExpListStyle_BaseConfig;
|
|
12594
|
-
ArrayExpression?: _StyleExpListStyle_BaseConfig;
|
|
12595
|
-
ArrayPattern?: _StyleExpListStyle_BaseConfig;
|
|
12596
|
-
ArrowFunctionExpression?: _StyleExpListStyle_BaseConfig;
|
|
12597
|
-
CallExpression?: _StyleExpListStyle_BaseConfig;
|
|
12598
|
-
ExportNamedDeclaration?: _StyleExpListStyle_BaseConfig;
|
|
12599
|
-
FunctionDeclaration?: _StyleExpListStyle_BaseConfig;
|
|
12600
|
-
FunctionExpression?: _StyleExpListStyle_BaseConfig;
|
|
12601
|
-
IfStatement?: _StyleExpListStyle_BaseConfig;
|
|
12602
|
-
ImportAttributes?: _StyleExpListStyle_BaseConfig;
|
|
12603
|
-
ImportDeclaration?: _StyleExpListStyle_BaseConfig;
|
|
12604
|
-
JSONArrayExpression?: _StyleExpListStyle_BaseConfig;
|
|
12605
|
-
JSONObjectExpression?: _StyleExpListStyle_BaseConfig;
|
|
12606
|
-
NewExpression?: _StyleExpListStyle_BaseConfig;
|
|
12607
|
-
ObjectExpression?: _StyleExpListStyle_BaseConfig;
|
|
12608
|
-
ObjectPattern?: _StyleExpListStyle_BaseConfig;
|
|
12609
|
-
TSDeclareFunction?: _StyleExpListStyle_BaseConfig;
|
|
12610
|
-
TSEnumBody?: _StyleExpListStyle_BaseConfig;
|
|
12611
|
-
TSFunctionType?: _StyleExpListStyle_BaseConfig;
|
|
12612
|
-
TSInterfaceBody?: _StyleExpListStyle_BaseConfig;
|
|
12613
|
-
TSTupleType?: _StyleExpListStyle_BaseConfig;
|
|
12614
|
-
TSTypeLiteral?: _StyleExpListStyle_BaseConfig;
|
|
12615
|
-
TSTypeParameterDeclaration?: _StyleExpListStyle_BaseConfig;
|
|
12616
|
-
TSTypeParameterInstantiation?: _StyleExpListStyle_BaseConfig;
|
|
12677
|
+
"()"?: (_StyleExpListStyle_BaseConfig | "off");
|
|
12678
|
+
"[]"?: (_StyleExpListStyle_BaseConfig | "off");
|
|
12679
|
+
"{}"?: (_StyleExpListStyle_BaseConfig | "off");
|
|
12680
|
+
"<>"?: (_StyleExpListStyle_BaseConfig | "off");
|
|
12681
|
+
ArrayExpression?: (_StyleExpListStyle_BaseConfig | "off");
|
|
12682
|
+
ArrayPattern?: (_StyleExpListStyle_BaseConfig | "off");
|
|
12683
|
+
ArrowFunctionExpression?: (_StyleExpListStyle_BaseConfig | "off");
|
|
12684
|
+
CallExpression?: (_StyleExpListStyle_BaseConfig | "off");
|
|
12685
|
+
ExportNamedDeclaration?: (_StyleExpListStyle_BaseConfig | "off");
|
|
12686
|
+
FunctionDeclaration?: (_StyleExpListStyle_BaseConfig | "off");
|
|
12687
|
+
FunctionExpression?: (_StyleExpListStyle_BaseConfig | "off");
|
|
12688
|
+
IfStatement?: (_StyleExpListStyle_BaseConfig | "off");
|
|
12689
|
+
ImportAttributes?: (_StyleExpListStyle_BaseConfig | "off");
|
|
12690
|
+
ImportDeclaration?: (_StyleExpListStyle_BaseConfig | "off");
|
|
12691
|
+
JSONArrayExpression?: (_StyleExpListStyle_BaseConfig | "off");
|
|
12692
|
+
JSONObjectExpression?: (_StyleExpListStyle_BaseConfig | "off");
|
|
12693
|
+
NewExpression?: (_StyleExpListStyle_BaseConfig | "off");
|
|
12694
|
+
ObjectExpression?: (_StyleExpListStyle_BaseConfig | "off");
|
|
12695
|
+
ObjectPattern?: (_StyleExpListStyle_BaseConfig | "off");
|
|
12696
|
+
TSDeclareFunction?: (_StyleExpListStyle_BaseConfig | "off");
|
|
12697
|
+
TSEnumBody?: (_StyleExpListStyle_BaseConfig | "off");
|
|
12698
|
+
TSFunctionType?: (_StyleExpListStyle_BaseConfig | "off");
|
|
12699
|
+
TSInterfaceBody?: (_StyleExpListStyle_BaseConfig | "off");
|
|
12700
|
+
TSTupleType?: (_StyleExpListStyle_BaseConfig | "off");
|
|
12701
|
+
TSTypeLiteral?: (_StyleExpListStyle_BaseConfig | "off");
|
|
12702
|
+
TSTypeParameterDeclaration?: (_StyleExpListStyle_BaseConfig | "off");
|
|
12703
|
+
TSTypeParameterInstantiation?: (_StyleExpListStyle_BaseConfig | "off");
|
|
12617
12704
|
};
|
|
12618
12705
|
}];
|
|
12619
12706
|
interface _StyleExpListStyle_SingleLineConfig {
|
|
@@ -13484,6 +13571,7 @@ type StylePaddingLineBetweenStatements = {
|
|
|
13484
13571
|
}[];
|
|
13485
13572
|
interface _StylePaddingLineBetweenStatements_SelectorOption {
|
|
13486
13573
|
selector: string;
|
|
13574
|
+
lineMode?: ("any" | "singleline" | "multiline");
|
|
13487
13575
|
} // ----- style/quote-props -----
|
|
13488
13576
|
type StyleQuoteProps = ([] | [("always" | "as-needed" | "consistent" | "consistent-as-needed")] | [] | [("always" | "as-needed" | "consistent" | "consistent-as-needed")] | [("always" | "as-needed" | "consistent" | "consistent-as-needed"), {
|
|
13489
13577
|
keywords?: boolean;
|
|
@@ -16608,7 +16696,7 @@ type Yoda = [] | [("always" | "never")] | [("always" | "never"), {
|
|
|
16608
16696
|
exceptRange?: boolean;
|
|
16609
16697
|
onlyEquality?: boolean;
|
|
16610
16698
|
}]; // Names of all the configs
|
|
16611
|
-
type ConfigNames = 'ariel/gitignore' | 'ariel/ignores' | 'ariel/javascript/setup' | 'ariel/javascript/rules' | 'ariel/eslint-comments/rules' | 'ariel/perfectionist/setup' | 'ariel/morgan/rules' | 'ariel/node/setup' | 'ariel/node/rules' | 'ariel/jsdoc/setup' | 'ariel/jsdoc/rules' | 'ariel/imports/rules' | 'ariel/unicorn/rules' | 'ariel/jsx/setup' | 'ariel/typescript/setup' | 'ariel/typescript/parser' | 'ariel/typescript/type-aware-parser' | 'ariel/typescript/rules' | 'ariel/typescript/rules-type-aware' | 'ariel/stylistic/rules' | 'ariel/regexp/rules' | 'ariel/test/setup' | 'ariel/test/rules' | 'ariel/react/setup' | 'ariel/react/rules' | 'ariel/react/typescript' | 'ariel/react/type-aware-rules' | 'ariel/nextjs/setup' | 'ariel/nextjs/rules' | 'ariel/solid/setup' | 'ariel/solid/rules' | 'ariel/svelte/setup' | 'ariel/svelte/rules' | 'ariel/tailwindcss/setup' | 'ariel/tailwindcss/rules' | 'ariel/jsonc/setup' | 'ariel/jsonc/rules' | 'ariel/sort/package-json' | 'ariel/sort/tsconfig-json' | 'ariel/pnpm/package-json' | 'ariel/pnpm/pnpm-workspace-yaml' | 'ariel/pnpm/pnpm-workspace-yaml-sort' | 'ariel/yaml/setup' | 'ariel/yaml/rules' | 'ariel/toml/setup' | 'ariel/toml/rules' | 'ariel/markdown/setup' | 'ariel/markdown/processor' | 'ariel/markdown/parser' | 'ariel/markdown/rules' | 'ariel/markdown/disables/markdown' | 'ariel/markdown/disables/code' | 'ariel/disables/scripts' | 'ariel/disables/dts' | 'ariel/disables/cjs' | 'ariel/disables/config-files';
|
|
16699
|
+
type ConfigNames = 'ariel/gitignore' | 'ariel/ignores' | 'ariel/javascript/setup' | 'ariel/javascript/rules' | 'ariel/eslint-comments/rules' | 'ariel/perfectionist/setup' | 'ariel/morgan/rules' | 'ariel/node/setup' | 'ariel/node/rules' | 'ariel/jsdoc/setup' | 'ariel/jsdoc/rules' | 'ariel/imports/rules' | 'ariel/e18e/rules' | 'ariel/unicorn/rules' | 'ariel/jsx/setup' | 'ariel/typescript/setup' | 'ariel/typescript/parser' | 'ariel/typescript/type-aware-parser' | 'ariel/typescript/rules' | 'ariel/typescript/rules-type-aware' | 'ariel/stylistic/rules' | 'ariel/regexp/rules' | 'ariel/test/setup' | 'ariel/test/rules' | 'ariel/react/setup' | 'ariel/react/rules' | 'ariel/react/typescript' | 'ariel/react/type-aware-rules' | 'ariel/nextjs/setup' | 'ariel/nextjs/rules' | 'ariel/solid/setup' | 'ariel/solid/rules' | 'ariel/svelte/setup' | 'ariel/svelte/rules' | 'ariel/tailwindcss/setup' | 'ariel/tailwindcss/rules' | 'ariel/jsonc/setup' | 'ariel/jsonc/rules' | 'ariel/sort/package-json' | 'ariel/sort/tsconfig-json' | 'ariel/pnpm/package-json' | 'ariel/pnpm/pnpm-workspace-yaml' | 'ariel/pnpm/pnpm-workspace-yaml-sort' | 'ariel/yaml/setup' | 'ariel/yaml/rules' | 'ariel/toml/setup' | 'ariel/toml/rules' | 'ariel/markdown/setup' | 'ariel/markdown/processor' | 'ariel/markdown/parser' | 'ariel/markdown/rules' | 'ariel/markdown/disables/markdown' | 'ariel/markdown/disables/code' | 'ariel/disables/scripts' | 'ariel/disables/dts' | 'ariel/disables/cjs' | 'ariel/disables/config-files';
|
|
16612
16700
|
//#endregion
|
|
16613
16701
|
//#region src/types.d.ts
|
|
16614
16702
|
type Awaitable<T> = T | Promise<T>;
|
|
@@ -16628,6 +16716,11 @@ type OptionsTypescript = (OptionsTypeScriptWithTypes & OptionsOverrides) | (Opti
|
|
|
16628
16716
|
interface OptionsComponentExts {
|
|
16629
16717
|
componentExts?: string[];
|
|
16630
16718
|
}
|
|
16719
|
+
interface OptionsE18e extends OptionsOverrides {
|
|
16720
|
+
modernization?: boolean;
|
|
16721
|
+
moduleReplacements?: boolean;
|
|
16722
|
+
performanceImprovements?: boolean;
|
|
16723
|
+
}
|
|
16631
16724
|
interface OptionsUnicorn extends OptionsOverrides {
|
|
16632
16725
|
allRecommended?: boolean;
|
|
16633
16726
|
}
|
|
@@ -16728,6 +16821,12 @@ interface OptionsConfig extends OptionsComponentExts, OptionsProjectType {
|
|
|
16728
16821
|
* @default auto-detect based on the dependencies
|
|
16729
16822
|
*/
|
|
16730
16823
|
typescript?: boolean | OptionsTypescript;
|
|
16824
|
+
/**
|
|
16825
|
+
* Options for [@e18e/eslint-plugin](https://github.com/e18e/eslint-plugin)
|
|
16826
|
+
*
|
|
16827
|
+
* @default true
|
|
16828
|
+
*/
|
|
16829
|
+
e18e?: boolean | OptionsE18e;
|
|
16731
16830
|
/**
|
|
16732
16831
|
* Enable JSX related rules.
|
|
16733
16832
|
*
|
|
@@ -16914,6 +17013,9 @@ declare function comments(): Promise<TypedFlatConfigItem[]>;
|
|
|
16914
17013
|
//#region src/configs/disables.d.ts
|
|
16915
17014
|
declare function disables(): Promise<TypedFlatConfigItem[]>;
|
|
16916
17015
|
//#endregion
|
|
17016
|
+
//#region src/configs/e18e.d.ts
|
|
17017
|
+
declare function e18e(options?: OptionsE18e): Promise<TypedFlatConfigItem[]>;
|
|
17018
|
+
//#endregion
|
|
16917
17019
|
//#region src/configs/ignores.d.ts
|
|
16918
17020
|
declare function ignores(userIgnores?: string[] | ((originals: string[]) => string[])): Promise<TypedFlatConfigItem[]>;
|
|
16919
17021
|
//#endregion
|
|
@@ -17016,6 +17118,10 @@ declare const GLOB_TESTS: string[];
|
|
|
17016
17118
|
declare const GLOB_ALL_SRC: string[];
|
|
17017
17119
|
declare const GLOB_EXCLUDE: string[];
|
|
17018
17120
|
//#endregion
|
|
17121
|
+
//#region src/presets.d.ts
|
|
17122
|
+
declare const PRESET_FULL_ON: OptionsConfig;
|
|
17123
|
+
declare const PRESET_FULL_OFF: OptionsConfig;
|
|
17124
|
+
//#endregion
|
|
17019
17125
|
//#region src/utils.d.ts
|
|
17020
17126
|
declare const parser_plain: {
|
|
17021
17127
|
meta: {
|
|
@@ -17052,4 +17158,4 @@ declare function interop_default<T>(m: Awaitable<T>): Promise<T extends {
|
|
|
17052
17158
|
declare function is_package_in_scope(name: string): boolean;
|
|
17053
17159
|
declare function ensure_packages(packages: (string | undefined)[]): Promise<void>;
|
|
17054
17160
|
//#endregion
|
|
17055
|
-
export { Awaitable, type ConfigNames, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, 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_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_XML, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsFiles, OptionsHasTailwindCSS, OptionsHasTypeScript, OptionsJSX, OptionsJSXA11y, OptionsMarkdown, OptionsOverrides, OptionsPnpm, OptionsProjectType, OptionsReact, OptionsRegExp, OptionsStylistic, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsUnicorn, ResolvedOptions, type RuleOptions, Rules, StylisticConfig, StylisticOptions, TailwindCSSOptions, TypedFlatConfigItem, combine, comments, defineConfig as default, defineConfig, default_plugin_renaming, defaults, disables, ensure_packages, get_overrides, ignores, imports, interop_default, is_package_in_scope, javascript, jsdoc, jsonc, jsx, markdown, morgan, nextjs, node, parser_plain, perfectionist, pnpm, react, regexp, rename_plugin_in_configs, rename_rules, resolve_sub_options, solid, sort_package_json, sort_ts_config, stylistic, svelte, tailwindcss, test, to_array, toml, typescript, unicorn, yaml };
|
|
17161
|
+
export { Awaitable, type ConfigNames, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, 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_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_XML, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsE18e, OptionsFiles, OptionsHasTailwindCSS, OptionsHasTypeScript, OptionsJSX, OptionsJSXA11y, OptionsMarkdown, OptionsOverrides, OptionsPnpm, OptionsProjectType, OptionsReact, OptionsRegExp, OptionsStylistic, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsUnicorn, PRESET_FULL_OFF, PRESET_FULL_ON, ResolvedOptions, type RuleOptions, Rules, StylisticConfig, StylisticOptions, TailwindCSSOptions, TypedFlatConfigItem, combine, comments, defineConfig as default, defineConfig, default_plugin_renaming, defaults, disables, e18e, ensure_packages, get_overrides, ignores, imports, interop_default, is_package_in_scope, javascript, jsdoc, jsonc, jsx, markdown, morgan, nextjs, node, parser_plain, perfectionist, pnpm, react, regexp, rename_plugin_in_configs, rename_rules, resolve_sub_options, solid, sort_package_json, sort_ts_config, stylistic, svelte, tailwindcss, test, to_array, toml, typescript, unicorn, yaml };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
2
2
|
import { findUp, findUpSync } from "find-up-simple";
|
|
3
|
+
import plugin_e18e from "@e18e/eslint-plugin";
|
|
3
4
|
import plugin_comments from "@eslint-community/eslint-plugin-eslint-comments";
|
|
4
5
|
import "eslint-config-flat-gitignore";
|
|
5
6
|
import plugin_ariel from "eslint-plugin-ariel";
|
|
@@ -10,13 +11,12 @@ import plugin_perfectionist from "eslint-plugin-perfectionist";
|
|
|
10
11
|
import { configs as plugin_regexp } from "eslint-plugin-regexp";
|
|
11
12
|
import plugin_unicorn from "eslint-plugin-unicorn";
|
|
12
13
|
import plugin_unused_imports from "eslint-plugin-unused-imports";
|
|
13
|
-
import globals from "globals";
|
|
14
14
|
import process$1 from "node:process";
|
|
15
15
|
import { readFile } from "node:fs/promises";
|
|
16
16
|
import { isPackageExists } from "local-pkg";
|
|
17
|
+
import globals from "globals";
|
|
17
18
|
import { fileURLToPath } from "node:url";
|
|
18
19
|
import { mergeProcessors, processorPassThrough } from "eslint-merge-processors";
|
|
19
|
-
|
|
20
20
|
//#region src/configs/comments.ts
|
|
21
21
|
async function comments() {
|
|
22
22
|
return [{
|
|
@@ -30,7 +30,6 @@ async function comments() {
|
|
|
30
30
|
}
|
|
31
31
|
}];
|
|
32
32
|
}
|
|
33
|
-
|
|
34
33
|
//#endregion
|
|
35
34
|
//#region src/globs.ts
|
|
36
35
|
const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
@@ -102,7 +101,6 @@ const GLOB_EXCLUDE = [
|
|
|
102
101
|
"**/auto-import?(s).d.ts",
|
|
103
102
|
"**/components.d.ts"
|
|
104
103
|
];
|
|
105
|
-
|
|
106
104
|
//#endregion
|
|
107
105
|
//#region src/configs/disables.ts
|
|
108
106
|
async function disables() {
|
|
@@ -139,7 +137,56 @@ async function disables() {
|
|
|
139
137
|
}
|
|
140
138
|
];
|
|
141
139
|
}
|
|
142
|
-
|
|
140
|
+
//#endregion
|
|
141
|
+
//#region src/env.ts
|
|
142
|
+
function has_typescript() {
|
|
143
|
+
return isPackageExists("typescript");
|
|
144
|
+
}
|
|
145
|
+
function has_svelte() {
|
|
146
|
+
return isPackageExists("svelte") || isPackageExists("@sveltejs/kit");
|
|
147
|
+
}
|
|
148
|
+
function has_tailwindcss() {
|
|
149
|
+
return isPackageExists("tailwindcss") || isPackageExists("@tailwindcss/vite");
|
|
150
|
+
}
|
|
151
|
+
function has_react() {
|
|
152
|
+
return isPackageExists("react") || isPackageExists("react-dom");
|
|
153
|
+
}
|
|
154
|
+
function has_nextjs() {
|
|
155
|
+
return isPackageExists("next");
|
|
156
|
+
}
|
|
157
|
+
function has_solid() {
|
|
158
|
+
return isPackageExists("solid-js");
|
|
159
|
+
}
|
|
160
|
+
async function has_pnpm_catalogs() {
|
|
161
|
+
const workspace_file = await findUp("pnpm-workspace.yaml");
|
|
162
|
+
if (!workspace_file) return false;
|
|
163
|
+
const yaml = await readFile(workspace_file, "utf8");
|
|
164
|
+
return yaml.includes("catalog:") || yaml.includes("catalogs:");
|
|
165
|
+
}
|
|
166
|
+
function is_in_git_hooks_or_lint_staged() {
|
|
167
|
+
return !!(process$1.env.GIT_PARAMS || process$1.env.VSCODE_GIT_COMMAND || process$1.env.npm_lifecycle_script?.startsWith("lint-staged"));
|
|
168
|
+
}
|
|
169
|
+
function is_in_editor_env() {
|
|
170
|
+
if (process$1.env.CI) return false;
|
|
171
|
+
if (is_in_git_hooks_or_lint_staged()) return false;
|
|
172
|
+
return !!(process$1.env.VSCODE_PID || process$1.env.VSCODE_CWD || process$1.env.JETBRAINS_IDE || process$1.env.VIM || process$1.env.NVIM);
|
|
173
|
+
}
|
|
174
|
+
//#endregion
|
|
175
|
+
//#region src/configs/e18e.ts
|
|
176
|
+
async function e18e(options = {}) {
|
|
177
|
+
const { modernization = true, moduleReplacements = is_in_editor_env(), overrides = {}, performanceImprovements = true } = options;
|
|
178
|
+
const configs = plugin_e18e.configs;
|
|
179
|
+
return [{
|
|
180
|
+
name: "ariel/e18e/rules",
|
|
181
|
+
plugins: { e18e: plugin_e18e },
|
|
182
|
+
rules: {
|
|
183
|
+
...modernization ? { ...configs.modernization.rules } : {},
|
|
184
|
+
...moduleReplacements ? { ...configs.moduleReplacements.rules } : {},
|
|
185
|
+
...performanceImprovements ? { ...configs.performanceImprovements.rules } : {},
|
|
186
|
+
...overrides
|
|
187
|
+
}
|
|
188
|
+
}];
|
|
189
|
+
}
|
|
143
190
|
//#endregion
|
|
144
191
|
//#region src/configs/ignores.ts
|
|
145
192
|
async function ignores(userIgnores = []) {
|
|
@@ -151,7 +198,6 @@ async function ignores(userIgnores = []) {
|
|
|
151
198
|
name: "ariel/ignores"
|
|
152
199
|
}];
|
|
153
200
|
}
|
|
154
|
-
|
|
155
201
|
//#endregion
|
|
156
202
|
//#region src/configs/imports.ts
|
|
157
203
|
async function imports(options = {}) {
|
|
@@ -177,42 +223,6 @@ async function imports(options = {}) {
|
|
|
177
223
|
}
|
|
178
224
|
}];
|
|
179
225
|
}
|
|
180
|
-
|
|
181
|
-
//#endregion
|
|
182
|
-
//#region src/env.ts
|
|
183
|
-
function has_typescript() {
|
|
184
|
-
return isPackageExists("typescript");
|
|
185
|
-
}
|
|
186
|
-
function has_svelte() {
|
|
187
|
-
return isPackageExists("svelte") || isPackageExists("@sveltejs/kit");
|
|
188
|
-
}
|
|
189
|
-
function has_tailwindcss() {
|
|
190
|
-
return isPackageExists("tailwindcss") || isPackageExists("@tailwindcss/vite");
|
|
191
|
-
}
|
|
192
|
-
function has_react() {
|
|
193
|
-
return isPackageExists("react") || isPackageExists("react-dom");
|
|
194
|
-
}
|
|
195
|
-
function has_nextjs() {
|
|
196
|
-
return isPackageExists("next");
|
|
197
|
-
}
|
|
198
|
-
function has_solid() {
|
|
199
|
-
return isPackageExists("solid-js");
|
|
200
|
-
}
|
|
201
|
-
async function has_pnpm_catalogs() {
|
|
202
|
-
const workspace_file = await findUp("pnpm-workspace.yaml");
|
|
203
|
-
if (!workspace_file) return false;
|
|
204
|
-
const yaml = await readFile(workspace_file, "utf8");
|
|
205
|
-
return yaml.includes("catalog:") || yaml.includes("catalogs:");
|
|
206
|
-
}
|
|
207
|
-
function is_in_git_hooks_or_lint_staged() {
|
|
208
|
-
return !!(process$1.env.GIT_PARAMS || process$1.env.VSCODE_GIT_COMMAND || process$1.env.npm_lifecycle_script?.startsWith("lint-staged"));
|
|
209
|
-
}
|
|
210
|
-
function is_in_editor_env() {
|
|
211
|
-
if (process$1.env.CI) return false;
|
|
212
|
-
if (is_in_git_hooks_or_lint_staged()) return false;
|
|
213
|
-
return !!(process$1.env.VSCODE_PID || process$1.env.VSCODE_CWD || process$1.env.JETBRAINS_IDE || process$1.env.VIM || process$1.env.NVIM);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
226
|
//#endregion
|
|
217
227
|
//#region src/configs/javascript.ts
|
|
218
228
|
async function javascript(options = {}) {
|
|
@@ -447,7 +457,6 @@ async function javascript(options = {}) {
|
|
|
447
457
|
}
|
|
448
458
|
}];
|
|
449
459
|
}
|
|
450
|
-
|
|
451
460
|
//#endregion
|
|
452
461
|
//#region src/utils.ts
|
|
453
462
|
const scope_url = fileURLToPath(new URL(".", import.meta.url));
|
|
@@ -507,7 +516,6 @@ async function ensure_packages(packages) {
|
|
|
507
516
|
if (non_existing_packages.length === 0) return;
|
|
508
517
|
if (await (await import("@clack/prompts")).confirm({ message: `${non_existing_packages.length === 1 ? "Package is" : "Packages are"} required for this config: ${non_existing_packages.join(", ")}. Do you want to install them?` })) await import("@antfu/install-pkg").then((i) => i.installPackage(non_existing_packages, { dev: true }));
|
|
509
518
|
}
|
|
510
|
-
|
|
511
519
|
//#endregion
|
|
512
520
|
//#region src/configs/jsdoc.ts
|
|
513
521
|
async function jsdoc(options = {}) {
|
|
@@ -541,7 +549,6 @@ async function jsdoc(options = {}) {
|
|
|
541
549
|
}
|
|
542
550
|
}];
|
|
543
551
|
}
|
|
544
|
-
|
|
545
552
|
//#endregion
|
|
546
553
|
//#region src/configs/jsonc.ts
|
|
547
554
|
async function jsonc(options = {}) {
|
|
@@ -607,7 +614,6 @@ async function jsonc(options = {}) {
|
|
|
607
614
|
}
|
|
608
615
|
}];
|
|
609
616
|
}
|
|
610
|
-
|
|
611
617
|
//#endregion
|
|
612
618
|
//#region src/configs/jsx.ts
|
|
613
619
|
async function jsx(options = {}) {
|
|
@@ -646,7 +652,6 @@ async function jsx(options = {}) {
|
|
|
646
652
|
}
|
|
647
653
|
}];
|
|
648
654
|
}
|
|
649
|
-
|
|
650
655
|
//#endregion
|
|
651
656
|
//#region src/configs/markdown.ts
|
|
652
657
|
async function markdown(options = {}) {
|
|
@@ -673,6 +678,7 @@ async function markdown(options = {}) {
|
|
|
673
678
|
name: "ariel/markdown/rules",
|
|
674
679
|
rules: {
|
|
675
680
|
...markdown.configs.recommended.at(0)?.rules,
|
|
681
|
+
"markdown/fenced-code-language": "off",
|
|
676
682
|
"markdown/no-missing-label-refs": "off",
|
|
677
683
|
...overridesMarkdown
|
|
678
684
|
}
|
|
@@ -727,7 +733,6 @@ async function markdown(options = {}) {
|
|
|
727
733
|
}
|
|
728
734
|
];
|
|
729
735
|
}
|
|
730
|
-
|
|
731
736
|
//#endregion
|
|
732
737
|
//#region src/configs/morgan.ts
|
|
733
738
|
async function morgan() {
|
|
@@ -740,7 +745,6 @@ async function morgan() {
|
|
|
740
745
|
}
|
|
741
746
|
}];
|
|
742
747
|
}
|
|
743
|
-
|
|
744
748
|
//#endregion
|
|
745
749
|
//#region src/configs/nextjs.ts
|
|
746
750
|
function normalize_rules(rules) {
|
|
@@ -773,7 +777,6 @@ async function nextjs(options = {}) {
|
|
|
773
777
|
settings: { react: { version: "detect" } }
|
|
774
778
|
}];
|
|
775
779
|
}
|
|
776
|
-
|
|
777
780
|
//#endregion
|
|
778
781
|
//#region src/configs/node.ts
|
|
779
782
|
async function node() {
|
|
@@ -796,7 +799,6 @@ async function node() {
|
|
|
796
799
|
}
|
|
797
800
|
}];
|
|
798
801
|
}
|
|
799
|
-
|
|
800
802
|
//#endregion
|
|
801
803
|
//#region src/configs/perfectionist.ts
|
|
802
804
|
async function perfectionist() {
|
|
@@ -985,7 +987,6 @@ async function perfectionist() {
|
|
|
985
987
|
}
|
|
986
988
|
}];
|
|
987
989
|
}
|
|
988
|
-
|
|
989
990
|
//#endregion
|
|
990
991
|
//#region src/configs/pnpm.ts
|
|
991
992
|
async function pnpm(options) {
|
|
@@ -1106,7 +1107,6 @@ async function pnpm(options) {
|
|
|
1106
1107
|
}
|
|
1107
1108
|
return configs;
|
|
1108
1109
|
}
|
|
1109
|
-
|
|
1110
1110
|
//#endregion
|
|
1111
1111
|
//#region src/configs/react.ts
|
|
1112
1112
|
const react_refresh_allow_constant_export_packages = ["vite"];
|
|
@@ -1299,7 +1299,6 @@ async function react(options = {}) {
|
|
|
1299
1299
|
}] : []
|
|
1300
1300
|
];
|
|
1301
1301
|
}
|
|
1302
|
-
|
|
1303
1302
|
//#endregion
|
|
1304
1303
|
//#region src/configs/regexp.ts
|
|
1305
1304
|
async function regexp(options = {}) {
|
|
@@ -1317,7 +1316,6 @@ async function regexp(options = {}) {
|
|
|
1317
1316
|
}
|
|
1318
1317
|
}];
|
|
1319
1318
|
}
|
|
1320
|
-
|
|
1321
1319
|
//#endregion
|
|
1322
1320
|
//#region src/configs/solid.ts
|
|
1323
1321
|
async function solid(options = {}) {
|
|
@@ -1368,7 +1366,6 @@ async function solid(options = {}) {
|
|
|
1368
1366
|
}
|
|
1369
1367
|
}];
|
|
1370
1368
|
}
|
|
1371
|
-
|
|
1372
1369
|
//#endregion
|
|
1373
1370
|
//#region src/configs/sort.ts
|
|
1374
1371
|
async function sort_package_json() {
|
|
@@ -1593,7 +1590,6 @@ async function sort_ts_config() {
|
|
|
1593
1590
|
] }
|
|
1594
1591
|
}];
|
|
1595
1592
|
}
|
|
1596
|
-
|
|
1597
1593
|
//#endregion
|
|
1598
1594
|
//#region src/configs/stylistic.ts
|
|
1599
1595
|
const defaults = {
|
|
@@ -1641,7 +1637,6 @@ async function stylistic(options = {}) {
|
|
|
1641
1637
|
}
|
|
1642
1638
|
}];
|
|
1643
1639
|
}
|
|
1644
|
-
|
|
1645
1640
|
//#endregion
|
|
1646
1641
|
//#region src/configs/svelte.ts
|
|
1647
1642
|
async function svelte(options = {}) {
|
|
@@ -1718,7 +1713,6 @@ async function svelte(options = {}) {
|
|
|
1718
1713
|
}
|
|
1719
1714
|
}];
|
|
1720
1715
|
}
|
|
1721
|
-
|
|
1722
1716
|
//#endregion
|
|
1723
1717
|
//#region src/configs/tailwindcss.ts
|
|
1724
1718
|
async function tailwindcss(options = {}) {
|
|
@@ -1752,7 +1746,6 @@ async function tailwindcss(options = {}) {
|
|
|
1752
1746
|
settings: { "better-tailwindcss": { entryPoint } }
|
|
1753
1747
|
}];
|
|
1754
1748
|
}
|
|
1755
|
-
|
|
1756
1749
|
//#endregion
|
|
1757
1750
|
//#region src/configs/test.ts
|
|
1758
1751
|
let _plugin_test;
|
|
@@ -1790,7 +1783,6 @@ async function test(options = {}) {
|
|
|
1790
1783
|
}
|
|
1791
1784
|
}];
|
|
1792
1785
|
}
|
|
1793
|
-
|
|
1794
1786
|
//#endregion
|
|
1795
1787
|
//#region src/configs/toml.ts
|
|
1796
1788
|
async function toml(options = {}) {
|
|
@@ -1830,18 +1822,17 @@ async function toml(options = {}) {
|
|
|
1830
1822
|
}
|
|
1831
1823
|
}];
|
|
1832
1824
|
}
|
|
1833
|
-
|
|
1834
1825
|
//#endregion
|
|
1835
1826
|
//#region src/configs/typescript.ts
|
|
1836
1827
|
async function typescript(options = {}) {
|
|
1837
1828
|
const { componentExts = [], overrides = {}, overridesTypeAware = {}, parserOptions = {}, type = "app" } = options;
|
|
1838
1829
|
const files = options.files ?? [
|
|
1839
|
-
|
|
1840
|
-
|
|
1830
|
+
"**/*.?([cm])ts",
|
|
1831
|
+
"**/*.?([cm])jsx",
|
|
1841
1832
|
...componentExts.map((ext) => `**/*.${ext}`)
|
|
1842
1833
|
];
|
|
1843
|
-
const files_type_aware = options.filesTypeAware ?? [
|
|
1844
|
-
const ignores_type_aware = options.ignoresTypeAware ?? [
|
|
1834
|
+
const files_type_aware = options.filesTypeAware ?? ["**/*.?([cm])ts", "**/*.?([cm])jsx"];
|
|
1835
|
+
const ignores_type_aware = options.ignoresTypeAware ?? [`**/*.md/**`];
|
|
1845
1836
|
const tsconfig_path = options?.tsconfigPath ? options.tsconfigPath : void 0;
|
|
1846
1837
|
const is_type_aware = !!tsconfig_path;
|
|
1847
1838
|
const type_aware_rules = {
|
|
@@ -1964,9 +1955,9 @@ async function typescript(options = {}) {
|
|
|
1964
1955
|
}] : []
|
|
1965
1956
|
];
|
|
1966
1957
|
}
|
|
1967
|
-
|
|
1968
1958
|
//#endregion
|
|
1969
1959
|
//#region src/configs/unicorn.ts
|
|
1960
|
+
const FILENAME_PATTERN = [/^[A-Z]+\..*$/, /import_map\.json/];
|
|
1970
1961
|
async function unicorn(options = {}) {
|
|
1971
1962
|
const { allRecommended = false, overrides = {} } = options;
|
|
1972
1963
|
return [{
|
|
@@ -1982,7 +1973,7 @@ async function unicorn(options = {}) {
|
|
|
1982
1973
|
kebabCase: true,
|
|
1983
1974
|
pascalCase: true
|
|
1984
1975
|
},
|
|
1985
|
-
ignore:
|
|
1976
|
+
ignore: FILENAME_PATTERN
|
|
1986
1977
|
}],
|
|
1987
1978
|
"unicorn/error-message": "error",
|
|
1988
1979
|
"unicorn/escape-case": "error",
|
|
@@ -2008,7 +1999,6 @@ async function unicorn(options = {}) {
|
|
|
2008
1999
|
}
|
|
2009
2000
|
}];
|
|
2010
2001
|
}
|
|
2011
|
-
|
|
2012
2002
|
//#endregion
|
|
2013
2003
|
//#region src/configs/yaml.ts
|
|
2014
2004
|
async function yaml(options = {}) {
|
|
@@ -2037,7 +2027,7 @@ async function yaml(options = {}) {
|
|
|
2037
2027
|
"yaml/flow-mapping-curly-spacing": "error",
|
|
2038
2028
|
"yaml/flow-sequence-bracket-newline": "error",
|
|
2039
2029
|
"yaml/flow-sequence-bracket-spacing": "error",
|
|
2040
|
-
"yaml/indent": ["error", typeof indent === "number" ? indent :
|
|
2030
|
+
"yaml/indent": ["error", typeof indent === "number" ? indent : 2],
|
|
2041
2031
|
"yaml/key-spacing": "error",
|
|
2042
2032
|
"yaml/no-tab-indent": "error",
|
|
2043
2033
|
"yaml/quotes": ["error", {
|
|
@@ -2050,7 +2040,6 @@ async function yaml(options = {}) {
|
|
|
2050
2040
|
}
|
|
2051
2041
|
}];
|
|
2052
2042
|
}
|
|
2053
|
-
|
|
2054
2043
|
//#endregion
|
|
2055
2044
|
//#region src/factory.ts
|
|
2056
2045
|
const flat_config_props = [
|
|
@@ -2087,7 +2076,7 @@ const default_plugin_renaming = {
|
|
|
2087
2076
|
* The merged ESLint configurations.
|
|
2088
2077
|
*/
|
|
2089
2078
|
function defineConfig(options = {}, ...userConfigs) {
|
|
2090
|
-
const { autoRenamePlugins = true, componentExts = [], gitignore: enable_git_ignore = true, ignores: user_ignores = [], imports: enable_imports = true, jsdoc: enable_jsdoc = true, jsx: enable_jsx = has_react() || has_nextjs() || has_solid(), nextjs: enable_nextjs = has_nextjs(), node: enable_node = true, pnpm: enable_catalogs = !!findUpSync("pnpm-workspace.yaml"), react: enable_react = has_react(), regexp: enable_regexp = true, solid: enable_solid = has_solid(), svelte: enable_svelte = has_svelte(), tailwindcss: enable_tailwindcss = has_tailwindcss(), typescript: enable_typescript = has_typescript(), unicorn: enable_unicorn = true } = options;
|
|
2079
|
+
const { autoRenamePlugins = true, componentExts = [], e18e: enable_e18e = true, gitignore: enable_git_ignore = true, ignores: user_ignores = [], imports: enable_imports = true, jsdoc: enable_jsdoc = true, jsx: enable_jsx = has_react() || has_nextjs() || has_solid(), nextjs: enable_nextjs = has_nextjs(), node: enable_node = true, pnpm: enable_catalogs = !!findUpSync("pnpm-workspace.yaml"), react: enable_react = has_react(), regexp: enable_regexp = true, solid: enable_solid = has_solid(), svelte: enable_svelte = has_svelte(), tailwindcss: enable_tailwindcss = has_tailwindcss(), typescript: enable_typescript = has_typescript(), unicorn: enable_unicorn = true } = options;
|
|
2091
2080
|
const is_in_editor = is_in_editor_env();
|
|
2092
2081
|
if (is_in_editor) console.log("[@ariel-salgado/eslint-config] Detected running in editor, some rules are disabled.");
|
|
2093
2082
|
const stylistic_options = options.stylistic === false ? false : typeof options.stylistic === "object" ? options.stylistic : {};
|
|
@@ -2110,6 +2099,7 @@ function defineConfig(options = {}, ...userConfigs) {
|
|
|
2110
2099
|
stylistic: stylistic_options,
|
|
2111
2100
|
...resolve_sub_options(options, "imports")
|
|
2112
2101
|
}));
|
|
2102
|
+
if (enable_e18e) configs.push(e18e({ ...enable_e18e === true ? {} : enable_e18e }));
|
|
2113
2103
|
if (enable_unicorn) configs.push(unicorn(enable_unicorn === true ? {} : enable_unicorn));
|
|
2114
2104
|
if (enable_jsx) configs.push(jsx(enable_jsx === true ? {} : enable_jsx));
|
|
2115
2105
|
if (enable_typescript) configs.push(typescript({
|
|
@@ -2193,10 +2183,54 @@ function get_overrides(options, key) {
|
|
|
2193
2183
|
..."overrides" in sub ? sub.overrides : {}
|
|
2194
2184
|
};
|
|
2195
2185
|
}
|
|
2196
|
-
|
|
2186
|
+
//#endregion
|
|
2187
|
+
//#region src/presets.ts
|
|
2188
|
+
const PRESET_FULL_ON = {
|
|
2189
|
+
gitignore: true,
|
|
2190
|
+
imports: true,
|
|
2191
|
+
jsdoc: true,
|
|
2192
|
+
jsonc: true,
|
|
2193
|
+
jsx: { a11y: true },
|
|
2194
|
+
markdown: true,
|
|
2195
|
+
nextjs: true,
|
|
2196
|
+
node: true,
|
|
2197
|
+
pnpm: true,
|
|
2198
|
+
react: { reactCompiler: true },
|
|
2199
|
+
regexp: true,
|
|
2200
|
+
solid: true,
|
|
2201
|
+
stylistic: { experimental: true },
|
|
2202
|
+
svelte: true,
|
|
2203
|
+
test: true,
|
|
2204
|
+
toml: true,
|
|
2205
|
+
typescript: { tsconfigPath: "tsconfig.json" },
|
|
2206
|
+
e18e: true,
|
|
2207
|
+
unicorn: true,
|
|
2208
|
+
yaml: true
|
|
2209
|
+
};
|
|
2210
|
+
const PRESET_FULL_OFF = {
|
|
2211
|
+
gitignore: false,
|
|
2212
|
+
imports: false,
|
|
2213
|
+
jsdoc: false,
|
|
2214
|
+
jsonc: false,
|
|
2215
|
+
jsx: false,
|
|
2216
|
+
markdown: false,
|
|
2217
|
+
nextjs: false,
|
|
2218
|
+
node: false,
|
|
2219
|
+
pnpm: false,
|
|
2220
|
+
react: false,
|
|
2221
|
+
regexp: false,
|
|
2222
|
+
solid: false,
|
|
2223
|
+
stylistic: false,
|
|
2224
|
+
svelte: false,
|
|
2225
|
+
test: false,
|
|
2226
|
+
toml: false,
|
|
2227
|
+
typescript: false,
|
|
2228
|
+
e18e: false,
|
|
2229
|
+
unicorn: false,
|
|
2230
|
+
yaml: false
|
|
2231
|
+
};
|
|
2197
2232
|
//#endregion
|
|
2198
2233
|
//#region src/index.ts
|
|
2199
2234
|
var src_default = defineConfig;
|
|
2200
|
-
|
|
2201
2235
|
//#endregion
|
|
2202
|
-
export { GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, 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_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_XML, GLOB_YAML, combine, comments, src_default as default, default_plugin_renaming, defaults, defineConfig, disables, ensure_packages, get_overrides, ignores, imports, interop_default, is_package_in_scope, javascript, jsdoc, jsonc, jsx, markdown, morgan, nextjs, node, parser_plain, perfectionist, pnpm, react, regexp, rename_plugin_in_configs, rename_rules, resolve_sub_options, solid, sort_package_json, sort_ts_config, stylistic, svelte, tailwindcss, test, to_array, toml, typescript, unicorn, yaml };
|
|
2236
|
+
export { GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, 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_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_XML, GLOB_YAML, PRESET_FULL_OFF, PRESET_FULL_ON, combine, comments, src_default as default, default_plugin_renaming, defaults, defineConfig, disables, e18e, ensure_packages, get_overrides, ignores, imports, interop_default, is_package_in_scope, javascript, jsdoc, jsonc, jsx, markdown, morgan, nextjs, node, parser_plain, perfectionist, pnpm, react, regexp, rename_plugin_in_configs, rename_rules, resolve_sub_options, solid, sort_package_json, sort_ts_config, stylistic, svelte, tailwindcss, test, to_array, toml, typescript, unicorn, yaml };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ariel-salgado/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.5.0",
|
|
5
5
|
"description": "Eslint config for @ariel-salgado.",
|
|
6
6
|
"author": "Ariel Salgado <ariel.salgado.acevedo@gmail.com> (https://github.com/ariel-salgado/)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -66,60 +66,61 @@
|
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@antfu/install-pkg": "
|
|
70
|
-
"@clack/prompts": "
|
|
71
|
-
"@
|
|
72
|
-
"@eslint/
|
|
73
|
-
"@
|
|
74
|
-
"@
|
|
75
|
-
"@typescript-eslint/
|
|
76
|
-
"@
|
|
77
|
-
"eslint-
|
|
78
|
-
"eslint-flat-
|
|
79
|
-
"eslint-
|
|
80
|
-
"eslint-
|
|
81
|
-
"eslint-plugin-
|
|
82
|
-
"eslint-plugin-
|
|
83
|
-
"eslint-plugin-
|
|
84
|
-
"eslint-plugin-
|
|
85
|
-
"eslint-plugin-
|
|
86
|
-
"eslint-plugin-
|
|
87
|
-
"eslint-plugin-
|
|
88
|
-
"eslint-plugin-
|
|
89
|
-
"eslint-plugin-
|
|
90
|
-
"eslint-plugin-
|
|
91
|
-
"eslint-plugin-
|
|
92
|
-
"eslint-plugin-
|
|
93
|
-
"eslint-plugin-
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
69
|
+
"@antfu/install-pkg": "1.1.0",
|
|
70
|
+
"@clack/prompts": "1.1.0",
|
|
71
|
+
"@e18e/eslint-plugin": "0.2.0",
|
|
72
|
+
"@eslint-community/eslint-plugin-eslint-comments": "4.7.1",
|
|
73
|
+
"@eslint/markdown": "7.5.1",
|
|
74
|
+
"@stylistic/eslint-plugin": "5.10.0",
|
|
75
|
+
"@typescript-eslint/eslint-plugin": "8.56.1",
|
|
76
|
+
"@typescript-eslint/parser": "8.56.1",
|
|
77
|
+
"@vitest/eslint-plugin": "1.6.9",
|
|
78
|
+
"eslint-config-flat-gitignore": "2.2.1",
|
|
79
|
+
"eslint-flat-config-utils": "3.0.1",
|
|
80
|
+
"eslint-merge-processors": "2.0.0",
|
|
81
|
+
"eslint-plugin-ariel": "0.0.3",
|
|
82
|
+
"eslint-plugin-de-morgan": "2.1.1",
|
|
83
|
+
"eslint-plugin-import-lite": "0.5.2",
|
|
84
|
+
"eslint-plugin-jsdoc": "62.7.1",
|
|
85
|
+
"eslint-plugin-jsonc": "3.1.1",
|
|
86
|
+
"eslint-plugin-n": "17.24.0",
|
|
87
|
+
"eslint-plugin-no-only-tests": "3.3.0",
|
|
88
|
+
"eslint-plugin-perfectionist": "5.6.0",
|
|
89
|
+
"eslint-plugin-pnpm": "1.6.0",
|
|
90
|
+
"eslint-plugin-regexp": "3.0.0",
|
|
91
|
+
"eslint-plugin-toml": "1.3.1",
|
|
92
|
+
"eslint-plugin-unicorn": "63.0.0",
|
|
93
|
+
"eslint-plugin-unused-imports": "4.4.1",
|
|
94
|
+
"eslint-plugin-yml": "3.3.1",
|
|
95
|
+
"find-up-simple": "1.0.1",
|
|
96
|
+
"globals": "17.4.0",
|
|
97
|
+
"local-pkg": "1.1.2",
|
|
98
|
+
"toml-eslint-parser": "1.0.3",
|
|
99
|
+
"yaml-eslint-parser": "2.0.0"
|
|
99
100
|
},
|
|
100
101
|
"devDependencies": {
|
|
101
|
-
"@eslint-react/eslint-plugin": "
|
|
102
|
-
"@next/eslint-plugin-next": "
|
|
103
|
-
"@types/eslint-plugin-jsx-a11y": "
|
|
104
|
-
"@types/node": "
|
|
105
|
-
"@typescript/native-preview": "
|
|
106
|
-
"bumpp": "
|
|
107
|
-
"eslint": "
|
|
108
|
-
"eslint-plugin-better-tailwindcss": "
|
|
109
|
-
"eslint-plugin-jsx-a11y": "
|
|
110
|
-
"eslint-plugin-react-hooks": "
|
|
111
|
-
"eslint-plugin-react-refresh": "
|
|
112
|
-
"eslint-plugin-solid": "
|
|
113
|
-
"eslint-plugin-svelte": "
|
|
114
|
-
"eslint-typegen": "
|
|
115
|
-
"lint-staged": "
|
|
116
|
-
"simple-git-hooks": "
|
|
117
|
-
"svelte": "
|
|
118
|
-
"svelte-eslint-parser": "
|
|
119
|
-
"tailwindcss": "
|
|
120
|
-
"tsdown": "
|
|
121
|
-
"tsx": "
|
|
122
|
-
"typescript": "
|
|
102
|
+
"@eslint-react/eslint-plugin": "2.13.0",
|
|
103
|
+
"@next/eslint-plugin-next": "16.1.6",
|
|
104
|
+
"@types/eslint-plugin-jsx-a11y": "6.10.1",
|
|
105
|
+
"@types/node": "25.3.5",
|
|
106
|
+
"@typescript/native-preview": "7.0.0-dev.20260308.1",
|
|
107
|
+
"bumpp": "10.4.1",
|
|
108
|
+
"eslint": "10.0.3",
|
|
109
|
+
"eslint-plugin-better-tailwindcss": "4.3.2",
|
|
110
|
+
"eslint-plugin-jsx-a11y": "6.10.2",
|
|
111
|
+
"eslint-plugin-react-hooks": "7.0.1",
|
|
112
|
+
"eslint-plugin-react-refresh": "0.5.2",
|
|
113
|
+
"eslint-plugin-solid": "0.14.5",
|
|
114
|
+
"eslint-plugin-svelte": "3.15.0",
|
|
115
|
+
"eslint-typegen": "2.3.1",
|
|
116
|
+
"lint-staged": "16.3.2",
|
|
117
|
+
"simple-git-hooks": "2.13.1",
|
|
118
|
+
"svelte": "5.53.7",
|
|
119
|
+
"svelte-eslint-parser": "1.6.0",
|
|
120
|
+
"tailwindcss": "4.2.1",
|
|
121
|
+
"tsdown": "0.21.0",
|
|
122
|
+
"tsx": "4.21.0",
|
|
123
|
+
"typescript": "5.9.3"
|
|
123
124
|
},
|
|
124
125
|
"simple-git-hooks": {
|
|
125
126
|
"pre-commit": "bunx lint-staged"
|
|
@@ -160,6 +161,7 @@
|
|
|
160
161
|
"yaml-eslint-parser": "^2.0.0"
|
|
161
162
|
},
|
|
162
163
|
"plugins": {
|
|
164
|
+
"@e18e/eslint-plugin": "0.2.0",
|
|
163
165
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.6.0",
|
|
164
166
|
"@eslint-react/eslint-plugin": "^2.12.2",
|
|
165
167
|
"@eslint/markdown": "^7.5.1",
|
|
@@ -193,7 +195,7 @@
|
|
|
193
195
|
},
|
|
194
196
|
"scripts": {
|
|
195
197
|
"build": "bun run build:typegen && tsdown",
|
|
196
|
-
"build:typegen": "
|
|
198
|
+
"build:typegen": "bun run scripts/typegen.ts",
|
|
197
199
|
"dev": "tsdown --watch",
|
|
198
200
|
"lint": "eslint",
|
|
199
201
|
"lint:fix": "eslint --fix",
|