@vinicunca/eslint-config 4.8.0 → 4.9.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 CHANGED
@@ -1,4 +1,5 @@
1
1
  import { ConfigWithExtends, FlatConfigComposer } from "eslint-flat-config-utils";
2
+ import pluginE18e from "@e18e/eslint-plugin";
2
3
  import pluginComments from "@eslint-community/eslint-plugin-eslint-comments";
3
4
  import pluginAntfu from "eslint-plugin-antfu";
4
5
  import pluginImportLite from "eslint-plugin-import-lite";
@@ -503,6 +504,87 @@ interface RuleOptions {
503
504
  * @see https://eslint.org/docs/latest/rules/dot-notation
504
505
  */
505
506
  'dot-notation'?: Linter.RuleEntry<DotNotation>;
507
+ /**
508
+ * Bans a list of dependencies from being used
509
+ * @see https://github.com/es-tooling/eslint-plugin-depend/blob/main/docs/rules/ban-dependencies.md
510
+ */
511
+ 'e18e/ban-dependencies'?: Linter.RuleEntry<E18EBanDependencies>;
512
+ /**
513
+ * Prefer optimized alternatives to `indexOf()` equality checks
514
+ */
515
+ 'e18e/no-indexof-equality'?: Linter.RuleEntry<[]>;
516
+ /**
517
+ * Prefer Array.prototype.at() over length-based indexing
518
+ */
519
+ 'e18e/prefer-array-at'?: Linter.RuleEntry<[]>;
520
+ /**
521
+ * Prefer Array.prototype.fill() over Array.from or map with constant values
522
+ */
523
+ 'e18e/prefer-array-fill'?: Linter.RuleEntry<[]>;
524
+ /**
525
+ * Prefer Array.from(iterable, mapper) over [...iterable].map(mapper) to avoid intermediate array allocation
526
+ */
527
+ 'e18e/prefer-array-from-map'?: Linter.RuleEntry<[]>;
528
+ /**
529
+ * Prefer Array.some() over Array.find() when checking for element existence
530
+ */
531
+ 'e18e/prefer-array-some'?: Linter.RuleEntry<[]>;
532
+ /**
533
+ * Prefer Array.prototype.toReversed() over copying and reversing arrays
534
+ */
535
+ 'e18e/prefer-array-to-reversed'?: Linter.RuleEntry<[]>;
536
+ /**
537
+ * Prefer Array.prototype.toSorted() over copying and sorting arrays
538
+ */
539
+ 'e18e/prefer-array-to-sorted'?: Linter.RuleEntry<[]>;
540
+ /**
541
+ * Prefer Array.prototype.toSpliced() over copying and splicing arrays
542
+ */
543
+ 'e18e/prefer-array-to-spliced'?: Linter.RuleEntry<[]>;
544
+ /**
545
+ * Prefer Date.now() over new Date().getTime() and +new Date()
546
+ */
547
+ 'e18e/prefer-date-now'?: Linter.RuleEntry<[]>;
548
+ /**
549
+ * Prefer the exponentiation operator ** over Math.pow()
550
+ */
551
+ 'e18e/prefer-exponentiation-operator'?: Linter.RuleEntry<[]>;
552
+ /**
553
+ * Prefer .includes() over indexOf() comparisons for arrays and strings
554
+ */
555
+ 'e18e/prefer-includes'?: Linter.RuleEntry<[]>;
556
+ /**
557
+ * Prefer inline equality checks over temporary object creation for simple comparisons
558
+ */
559
+ 'e18e/prefer-inline-equality'?: Linter.RuleEntry<[]>;
560
+ /**
561
+ * Prefer nullish coalescing operator (?? and ??=) over verbose null checks
562
+ */
563
+ 'e18e/prefer-nullish-coalescing'?: Linter.RuleEntry<[]>;
564
+ /**
565
+ * Prefer Object.hasOwn() over Object.prototype.hasOwnProperty.call() and obj.hasOwnProperty()
566
+ */
567
+ 'e18e/prefer-object-has-own'?: Linter.RuleEntry<[]>;
568
+ /**
569
+ * prefer `RegExp.test()` over `String.match()` and `RegExp.exec()` when only checking for match existence
570
+ */
571
+ 'e18e/prefer-regex-test'?: Linter.RuleEntry<[]>;
572
+ /**
573
+ * Prefer spread syntax over Array.concat(), Array.from(), Object.assign({}, ...), and Function.apply()
574
+ */
575
+ 'e18e/prefer-spread-syntax'?: Linter.RuleEntry<[]>;
576
+ /**
577
+ * Prefer defining regular expressions at module scope to avoid re-compilation on every function call
578
+ */
579
+ 'e18e/prefer-static-regex'?: Linter.RuleEntry<[]>;
580
+ /**
581
+ * Prefer passing function and arguments directly to setTimeout/setInterval instead of wrapping in an arrow function or using bind
582
+ */
583
+ 'e18e/prefer-timer-args'?: Linter.RuleEntry<[]>;
584
+ /**
585
+ * Prefer URL.canParse() over try-catch blocks for URL validation
586
+ */
587
+ 'e18e/prefer-url-canparse'?: Linter.RuleEntry<[]>;
506
588
  /**
507
589
  * Require or disallow newline at the end of files
508
590
  * @see https://eslint.org/docs/latest/rules/eol-last
@@ -562,6 +644,7 @@ interface RuleOptions {
562
644
  /**
563
645
  * disallow unused `eslint-disable` comments
564
646
  * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-unused-disable.html
647
+ * @deprecated
565
648
  */
566
649
  'eslint-comments/no-unused-disable'?: Linter.RuleEntry<[]>;
567
650
  /**
@@ -4444,7 +4527,7 @@ interface RuleOptions {
4444
4527
  */
4445
4528
  'sonar/aws-iam-public-access'?: Linter.RuleEntry<[]>;
4446
4529
  /**
4447
- * Using unencrypted Elasticsearch domains is security-sensitive
4530
+ * Using unencrypted Opensearch domains is security-sensitive
4448
4531
  * @see https://sonarsource.github.io/rspec/#/rspec/S6308/javascript
4449
4532
  */
4450
4533
  'sonar/aws-opensearchservice-domain'?: Linter.RuleEntry<[]>;
@@ -4663,6 +4746,11 @@ interface RuleOptions {
4663
4746
  * @see https://sonarsource.github.io/rspec/#/rspec/S5869/javascript
4664
4747
  */
4665
4748
  'sonar/duplicates-in-character-class'?: Linter.RuleEntry<[]>;
4749
+ /**
4750
+ * Templates should not be constructed dynamically
4751
+ * @see https://sonarsource.github.io/rspec/#/rspec/S7790/javascript
4752
+ */
4753
+ 'sonar/dynamically-constructed-templates'?: Linter.RuleEntry<[]>;
4666
4754
  /**
4667
4755
  * "if ... else if" constructs should end with "else" clauses
4668
4756
  * @see https://sonarsource.github.io/rspec/#/rspec/S126/javascript
@@ -4765,6 +4853,11 @@ interface RuleOptions {
4765
4853
  * @see https://sonarsource.github.io/rspec/#/rspec/S3531/javascript
4766
4854
  */
4767
4855
  'sonar/generator-without-yield'?: Linter.RuleEntry<[]>;
4856
+ /**
4857
+ * Credentials should not be hard-coded
4858
+ * @see https://sonarsource.github.io/rspec/#/rspec/S6437/javascript
4859
+ */
4860
+ 'sonar/hardcoded-secret-signatures'?: Linter.RuleEntry<[]>;
4768
4861
  /**
4769
4862
  * Using weak hashing algorithms is security-sensitive
4770
4863
  * @see https://sonarsource.github.io/rspec/#/rspec/S4790/javascript
@@ -5036,12 +5129,12 @@ interface RuleOptions {
5036
5129
  */
5037
5130
  'sonar/no-hardcoded-ip'?: Linter.RuleEntry<[]>;
5038
5131
  /**
5039
- * Hard-coded passwords are security-sensitive
5132
+ * Credentials should not be hard-coded
5040
5133
  * @see https://sonarsource.github.io/rspec/#/rspec/S2068/javascript
5041
5134
  */
5042
5135
  'sonar/no-hardcoded-passwords'?: Linter.RuleEntry<SonarNoHardcodedPasswords>;
5043
5136
  /**
5044
- * Hard-coded secrets are security-sensitive
5137
+ * Secrets should not be hard-coded
5045
5138
  * @see https://sonarsource.github.io/rspec/#/rspec/S6418/javascript
5046
5139
  */
5047
5140
  'sonar/no-hardcoded-secrets'?: Linter.RuleEntry<SonarNoHardcodedSecrets>;
@@ -5530,6 +5623,11 @@ interface RuleOptions {
5530
5623
  * @deprecated
5531
5624
  */
5532
5625
  'sonar/regular-expr'?: Linter.RuleEntry<[]>;
5626
+ /**
5627
+ * Wallet phrases should not be hard-coded
5628
+ * @see https://sonarsource.github.io/rspec/#/rspec/S7639/javascript
5629
+ */
5630
+ 'sonar/review-blockchain-mnemonic'?: Linter.RuleEntry<[]>;
5533
5631
  /**
5534
5632
  * A new session should be created during user authentication
5535
5633
  * @see https://sonarsource.github.io/rspec/#/rspec/S5876/javascript
@@ -10550,6 +10648,12 @@ type DotNotation = [] | [{
10550
10648
  allowKeywords?: boolean;
10551
10649
  allowPattern?: string;
10552
10650
  }];
10651
+ // ----- e18e/ban-dependencies -----
10652
+ type E18EBanDependencies = [] | [{
10653
+ presets?: string[];
10654
+ modules?: string[];
10655
+ allowed?: string[];
10656
+ }];
10553
10657
  // ----- eol-last -----
10554
10658
  type EolLast = [] | [("always" | "never" | "unix" | "windows")];
10555
10659
  // ----- eqeqeq -----
@@ -16355,33 +16459,33 @@ type StyleExpListStyle = [] | [{
16355
16459
  singleLine?: _StyleExpListStyle_SingleLineConfig;
16356
16460
  multiLine?: _StyleExpListStyle_MultiLineConfig;
16357
16461
  overrides?: {
16358
- "()"?: _StyleExpListStyle_BaseConfig;
16359
- "[]"?: _StyleExpListStyle_BaseConfig;
16360
- "{}"?: _StyleExpListStyle_BaseConfig;
16361
- "<>"?: _StyleExpListStyle_BaseConfig;
16362
- ArrayExpression?: _StyleExpListStyle_BaseConfig;
16363
- ArrayPattern?: _StyleExpListStyle_BaseConfig;
16364
- ArrowFunctionExpression?: _StyleExpListStyle_BaseConfig;
16365
- CallExpression?: _StyleExpListStyle_BaseConfig;
16366
- ExportNamedDeclaration?: _StyleExpListStyle_BaseConfig;
16367
- FunctionDeclaration?: _StyleExpListStyle_BaseConfig;
16368
- FunctionExpression?: _StyleExpListStyle_BaseConfig;
16369
- IfStatement?: _StyleExpListStyle_BaseConfig;
16370
- ImportAttributes?: _StyleExpListStyle_BaseConfig;
16371
- ImportDeclaration?: _StyleExpListStyle_BaseConfig;
16372
- JSONArrayExpression?: _StyleExpListStyle_BaseConfig;
16373
- JSONObjectExpression?: _StyleExpListStyle_BaseConfig;
16374
- NewExpression?: _StyleExpListStyle_BaseConfig;
16375
- ObjectExpression?: _StyleExpListStyle_BaseConfig;
16376
- ObjectPattern?: _StyleExpListStyle_BaseConfig;
16377
- TSDeclareFunction?: _StyleExpListStyle_BaseConfig;
16378
- TSEnumBody?: _StyleExpListStyle_BaseConfig;
16379
- TSFunctionType?: _StyleExpListStyle_BaseConfig;
16380
- TSInterfaceBody?: _StyleExpListStyle_BaseConfig;
16381
- TSTupleType?: _StyleExpListStyle_BaseConfig;
16382
- TSTypeLiteral?: _StyleExpListStyle_BaseConfig;
16383
- TSTypeParameterDeclaration?: _StyleExpListStyle_BaseConfig;
16384
- TSTypeParameterInstantiation?: _StyleExpListStyle_BaseConfig;
16462
+ "()"?: (_StyleExpListStyle_BaseConfig | "off");
16463
+ "[]"?: (_StyleExpListStyle_BaseConfig | "off");
16464
+ "{}"?: (_StyleExpListStyle_BaseConfig | "off");
16465
+ "<>"?: (_StyleExpListStyle_BaseConfig | "off");
16466
+ ArrayExpression?: (_StyleExpListStyle_BaseConfig | "off");
16467
+ ArrayPattern?: (_StyleExpListStyle_BaseConfig | "off");
16468
+ ArrowFunctionExpression?: (_StyleExpListStyle_BaseConfig | "off");
16469
+ CallExpression?: (_StyleExpListStyle_BaseConfig | "off");
16470
+ ExportNamedDeclaration?: (_StyleExpListStyle_BaseConfig | "off");
16471
+ FunctionDeclaration?: (_StyleExpListStyle_BaseConfig | "off");
16472
+ FunctionExpression?: (_StyleExpListStyle_BaseConfig | "off");
16473
+ IfStatement?: (_StyleExpListStyle_BaseConfig | "off");
16474
+ ImportAttributes?: (_StyleExpListStyle_BaseConfig | "off");
16475
+ ImportDeclaration?: (_StyleExpListStyle_BaseConfig | "off");
16476
+ JSONArrayExpression?: (_StyleExpListStyle_BaseConfig | "off");
16477
+ JSONObjectExpression?: (_StyleExpListStyle_BaseConfig | "off");
16478
+ NewExpression?: (_StyleExpListStyle_BaseConfig | "off");
16479
+ ObjectExpression?: (_StyleExpListStyle_BaseConfig | "off");
16480
+ ObjectPattern?: (_StyleExpListStyle_BaseConfig | "off");
16481
+ TSDeclareFunction?: (_StyleExpListStyle_BaseConfig | "off");
16482
+ TSEnumBody?: (_StyleExpListStyle_BaseConfig | "off");
16483
+ TSFunctionType?: (_StyleExpListStyle_BaseConfig | "off");
16484
+ TSInterfaceBody?: (_StyleExpListStyle_BaseConfig | "off");
16485
+ TSTupleType?: (_StyleExpListStyle_BaseConfig | "off");
16486
+ TSTypeLiteral?: (_StyleExpListStyle_BaseConfig | "off");
16487
+ TSTypeParameterDeclaration?: (_StyleExpListStyle_BaseConfig | "off");
16488
+ TSTypeParameterInstantiation?: (_StyleExpListStyle_BaseConfig | "off");
16385
16489
  };
16386
16490
  }];
16387
16491
  interface _StyleExpListStyle_SingleLineConfig {
@@ -17307,6 +17411,7 @@ type StylePaddingLineBetweenStatements = {
17307
17411
  }[];
17308
17412
  interface _StylePaddingLineBetweenStatements_SelectorOption {
17309
17413
  selector: string;
17414
+ lineMode?: ("any" | "singleline" | "multiline");
17310
17415
  }
17311
17416
  // ----- style/quote-props -----
17312
17417
  type StyleQuoteProps = ([] | [("always" | "as-needed" | "consistent" | "consistent-as-needed")] | [] | [("always" | "as-needed" | "consistent" | "consistent-as-needed")] | [("always" | "as-needed" | "consistent" | "consistent-as-needed"), {
@@ -18706,6 +18811,18 @@ type TsPreferOptionalChain = [] | [{
18706
18811
  }];
18707
18812
  // ----- ts/prefer-promise-reject-errors -----
18708
18813
  type TsPreferPromiseRejectErrors = [] | [{
18814
+ allow?: (string | {
18815
+ from: "file";
18816
+ name: (string | [string, ...(string)[]]);
18817
+ path?: string;
18818
+ } | {
18819
+ from: "lib";
18820
+ name: (string | [string, ...(string)[]]);
18821
+ } | {
18822
+ from: "package";
18823
+ name: (string | [string, ...(string)[]]);
18824
+ package: string;
18825
+ })[];
18709
18826
  allowEmptyReject?: boolean;
18710
18827
  allowThrowingAny?: boolean;
18711
18828
  allowThrowingUnknown?: boolean;
@@ -20615,7 +20732,7 @@ type Yoda = [] | [("always" | "never")] | [("always" | "never"), {
20615
20732
  onlyEquality?: boolean;
20616
20733
  }];
20617
20734
  // Names of all the configs
20618
- type ConfigNames = 'vinicunca/gitignore' | 'vinicunca/ignores' | 'vinicunca/javascript/setup' | 'vinicunca/javascript/rules' | 'vinicunca/eslint-comments/rules' | 'vinicunca/imports/rules' | 'vinicunca/command/rules' | 'vinicunca/perfectionist/rules' | 'vinicunca/sonar/rules' | 'vinicunca/node/rules' | 'vinicunca/jsdoc/setup' | 'vinicunca/jsdoc/rules' | 'vinicunca/imports/rules' | 'vinicunca/unicorn/rules' | 'antfu/jsx/setup' | 'vinicunca/typescript/setup' | 'vinicunca/typescript/parser' | 'vinicunca/typescript/type-aware-parser' | 'vinicunca/typescript/rules' | 'vinicunca/typescript/rules-type-aware' | 'antfu/typescript/erasable-syntax-only' | 'vinicunca/stylistic/rules' | 'vinicunca/regexp/rules' | 'vinicunca/test/setup' | 'vinicunca/test/rules' | 'vinicunca/vue/setup' | 'vinicunca/vue/rules' | 'vinicunca/react/setup' | 'vinicunca/react/rules' | 'vinicunca/react/typescript' | 'vinicunca/react/type-aware-rules' | 'vinicunca/nextjs/setup' | 'vinicunca/nextjs/rules' | 'vinicunca/solid/setup' | 'vinicunca/solid/rules' | 'vinicunca/svelte/setup' | 'vinicunca/svelte/rules' | 'vinicunca/unocss' | 'vinicunca/astro/setup' | 'vinicunca/astro/rules' | 'vinicunca/jsonc/setup' | 'vinicunca/jsonc/rules' | 'vinicunca/sort/package-json' | 'vinicunca/sort/tsconfig' | 'vinicunca/pnpm/package-json' | 'vinicunca/pnpm/pnpm-workspace-yaml' | 'vinicunca/pnpm/pnpm-workspace-yaml-sort' | 'vinicunca/yaml/setup' | 'vinicunca/yaml/rules' | 'vinicunca/toml/setup' | 'vinicunca/toml/rules' | 'vinicunca/markdown/setup' | 'vinicunca/markdown/processor' | 'vinicunca/markdown/parser' | 'vinicunca/markdown/rules' | 'vinicunca/markdown/disables/markdown' | 'vinicunca/markdown/disables' | 'vinicunca/formatter/setup' | 'vinicunca/formatter/css' | 'vinicunca/formatter/scss' | 'vinicunca/formatter/less' | 'vinicunca/formatter/html' | 'vinicunca/formatter/xml' | 'vinicunca/formatter/svg' | 'vinicunca/formatter/markdown' | 'vinicunca/formatter/astro' | 'vinicunca/formatter/astro/disables' | 'vinicunca/formatter/graphql' | 'vinicunca/disables/scripts' | 'vinicunca/disables/cli' | 'vinicunca/disables/bin' | 'vinicunca/disables/dts' | 'vinicunca/disables/cjs' | 'vinicunca/disables/config-files';
20735
+ type ConfigNames = 'vinicunca/gitignore' | 'vinicunca/ignores' | 'vinicunca/javascript/setup' | 'vinicunca/javascript/rules' | 'vinicunca/eslint-comments/rules' | 'vinicunca/imports/rules' | 'vinicunca/command/rules' | 'vinicunca/perfectionist/rules' | 'vinicunca/sonar/rules' | 'vinicunca/node/rules' | 'vinicunca/jsdoc/setup' | 'vinicunca/jsdoc/rules' | 'vinicunca/imports/rules' | 'vinicunca/e18e/rules' | 'vinicunca/unicorn/rules' | 'antfu/jsx/setup' | 'vinicunca/typescript/setup' | 'vinicunca/typescript/parser' | 'vinicunca/typescript/type-aware-parser' | 'vinicunca/typescript/rules' | 'vinicunca/typescript/rules-type-aware' | 'antfu/typescript/erasable-syntax-only' | 'vinicunca/stylistic/rules' | 'vinicunca/regexp/rules' | 'vinicunca/test/setup' | 'vinicunca/test/rules' | 'vinicunca/vue/setup' | 'vinicunca/vue/rules' | 'vinicunca/react/setup' | 'vinicunca/react/rules' | 'vinicunca/react/typescript' | 'vinicunca/react/type-aware-rules' | 'vinicunca/nextjs/setup' | 'vinicunca/nextjs/rules' | 'vinicunca/solid/setup' | 'vinicunca/solid/rules' | 'vinicunca/svelte/setup' | 'vinicunca/svelte/rules' | 'vinicunca/unocss' | 'vinicunca/astro/setup' | 'vinicunca/astro/rules' | 'vinicunca/jsonc/setup' | 'vinicunca/jsonc/rules' | 'vinicunca/sort/package-json' | 'vinicunca/sort/tsconfig' | 'vinicunca/pnpm/package-json' | 'vinicunca/pnpm/pnpm-workspace-yaml' | 'vinicunca/pnpm/pnpm-workspace-yaml-sort' | 'vinicunca/yaml/setup' | 'vinicunca/yaml/rules' | 'vinicunca/toml/setup' | 'vinicunca/toml/rules' | 'vinicunca/markdown/setup' | 'vinicunca/markdown/processor' | 'vinicunca/markdown/parser' | 'vinicunca/markdown/rules' | 'vinicunca/markdown/disables/markdown' | 'vinicunca/markdown/disables' | 'vinicunca/formatter/setup' | 'vinicunca/formatter/css' | 'vinicunca/formatter/scss' | 'vinicunca/formatter/less' | 'vinicunca/formatter/html' | 'vinicunca/formatter/xml' | 'vinicunca/formatter/svg' | 'vinicunca/formatter/markdown' | 'vinicunca/formatter/astro' | 'vinicunca/formatter/astro/disables' | 'vinicunca/formatter/graphql' | 'vinicunca/disables/scripts' | 'vinicunca/disables/cli' | 'vinicunca/disables/bin' | 'vinicunca/disables/dts' | 'vinicunca/disables/cjs' | 'vinicunca/disables/config-files';
20619
20736
  //#endregion
20620
20737
  //#region src/vendor/prettier-types.d.ts
20621
20738
  /**
@@ -20874,6 +20991,29 @@ interface OptionsComponentExts {
20874
20991
  */
20875
20992
  componentExts?: Array<string>;
20876
20993
  }
20994
+ interface OptionsE18e extends OptionsOverrides {
20995
+ /**
20996
+ * Include modernization rules
20997
+ *
20998
+ * @see https://github.com/e18e/eslint-plugin#modernization
20999
+ * @default true
21000
+ */
21001
+ modernization?: boolean;
21002
+ /**
21003
+ * Include module replacements rules
21004
+ *
21005
+ * @see https://github.com/e18e/eslint-plugin#module-replacements
21006
+ * @default options.isInEditor
21007
+ */
21008
+ moduleReplacements?: boolean;
21009
+ /**
21010
+ * Include performance improvements rules
21011
+ *
21012
+ * @see https://github.com/e18e/eslint-plugin#performance-improvements
21013
+ * @default true
21014
+ */
21015
+ performanceImprovements?: boolean;
21016
+ }
20877
21017
  interface OptionsUnicorn extends OptionsOverrides {
20878
21018
  /**
20879
21019
  * Include all rules recommended by `eslint-plugin-unicorn`.
@@ -21063,6 +21203,12 @@ interface OptionsConfig extends OptionsComponentExts, OptionsProjectType {
21063
21203
  * @default true
21064
21204
  */
21065
21205
  jsx?: boolean | OptionsJSX;
21206
+ /**
21207
+ * Options for [@e18e/eslint-plugin](https://github.com/e18e/eslint-plugin)
21208
+ *
21209
+ * @default true
21210
+ */
21211
+ e18e?: boolean | OptionsE18e;
21066
21212
  /**
21067
21213
  * Options for eslint-plugin-unicorn.
21068
21214
  *
@@ -21252,6 +21398,9 @@ declare function comments(): Promise<Array<TypedFlatConfigItem>>;
21252
21398
  //#region src/configs/disables.d.ts
21253
21399
  declare function disables(): Promise<TypedFlatConfigItem[]>;
21254
21400
  //#endregion
21401
+ //#region src/configs/e18e.d.ts
21402
+ declare function e18e(options?: OptionsIsInEditor & OptionsE18e): Promise<Array<TypedFlatConfigItem>>;
21403
+ //#endregion
21255
21404
  //#region src/configs/formatters.d.ts
21256
21405
  declare function formatters(options?: OptionsFormatters | true, stylistic?: StylisticConfig): Promise<Array<TypedFlatConfigItem>>;
21257
21406
  //#endregion
@@ -21457,4 +21606,4 @@ declare function ensurePackages(packages: Array<string | undefined>): Promise<vo
21457
21606
  declare function isInEditorEnv(): boolean;
21458
21607
  declare function isInGitHooksOrLintStaged(): boolean;
21459
21608
  //#endregion
21460
- 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_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, OptionsMarkdown, OptionsOverrides, OptionsPnpm, OptionsProjectType, OptionsReact, OptionsRegExp, OptionsStylistic, OptionsTypeScriptErasableOnly, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsUnicorn, OptionsUnoCSS, OptionsVue, ResolvedOptions, type RuleOptions, Rules, STYLISTIC_CONFIG_DEFAULTS, StylisticConfig, StylisticOptions, TypedFlatConfigItem, astro, combineConfigs, command, comments, defaultPluginRenaming, disables, ensurePackages, formatters, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, parserPlain, perfectionist, pluginAntfu, pluginComments, pluginImportLite, pluginNode, pluginPerfectionist, pluginSonar, pluginUnicorn, pluginUnusedImports, pnpm, react, regexp, renamePluginInConfigs, renameRules, solid, sonar, sortPackageJson, sortTsconfig, stylistic, svelte, test, toArray, toml, typescript, unicorn, unocss, vinicuncaESLint, vue, yaml };
21609
+ 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_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsE18e, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIsInEditor, OptionsJSX, OptionsJSXA11y, OptionsMarkdown, OptionsOverrides, OptionsPnpm, OptionsProjectType, OptionsReact, OptionsRegExp, OptionsStylistic, OptionsTypeScriptErasableOnly, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsUnicorn, OptionsUnoCSS, OptionsVue, ResolvedOptions, type RuleOptions, Rules, STYLISTIC_CONFIG_DEFAULTS, StylisticConfig, StylisticOptions, TypedFlatConfigItem, astro, combineConfigs, command, comments, defaultPluginRenaming, disables, e18e, ensurePackages, formatters, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, parserPlain, perfectionist, pluginAntfu, pluginComments, pluginE18e, pluginImportLite, pluginNode, pluginPerfectionist, pluginSonar, pluginUnicorn, pluginUnusedImports, pnpm, react, regexp, renamePluginInConfigs, renameRules, solid, sonar, sortPackageJson, sortTsconfig, stylistic, svelte, test, toArray, toml, typescript, unicorn, unocss, vinicuncaESLint, vue, yaml };
package/dist/index.mjs CHANGED
@@ -1,11 +1,12 @@
1
1
  import { FlatConfigComposer } from "eslint-flat-config-utils";
2
2
  import process from "node:process";
3
- import fs from "node:fs/promises";
3
+ import fsPromises from "node:fs/promises";
4
4
  import { fileURLToPath } from "node:url";
5
- import fs$1 from "node:fs";
5
+ import fs from "node:fs";
6
6
  import path from "node:path";
7
7
  import { isPackageExists } from "local-pkg";
8
8
  import createCommand from "eslint-plugin-command/config";
9
+ import pluginE18e from "@e18e/eslint-plugin";
9
10
  import pluginComments from "@eslint-community/eslint-plugin-eslint-comments";
10
11
  import pluginAntfu from "eslint-plugin-antfu";
11
12
  import pluginImportLite from "eslint-plugin-import-lite";
@@ -46,7 +47,7 @@ async function findUp(name, { cwd = process.cwd(), type = "file", stopAt } = {})
46
47
  while (directory) {
47
48
  const filePath = isAbsoluteName ? name : path.join(directory, name);
48
49
  try {
49
- const stats = await fs.stat(filePath);
50
+ const stats = await fsPromises.stat(filePath);
50
51
  if (type === "file" && stats.isFile() || type === "directory" && stats.isDirectory()) return filePath;
51
52
  } catch {}
52
53
  if (directory === stopAt || directory === root) break;
@@ -61,7 +62,7 @@ function findUpSync(name, { cwd = process.cwd(), type = "file", stopAt } = {}) {
61
62
  while (directory) {
62
63
  const filePath = isAbsoluteName ? name : path.join(directory, name);
63
64
  try {
64
- const stats = fs$1.statSync(filePath, { throwIfNoEntry: false });
65
+ const stats = fs.statSync(filePath, { throwIfNoEntry: false });
65
66
  if (type === "file" && stats?.isFile() || type === "directory" && stats?.isDirectory()) return filePath;
66
67
  } catch {}
67
68
  if (directory === stopAt || directory === root) break;
@@ -390,6 +391,23 @@ async function disables() {
390
391
  ];
391
392
  }
392
393
 
394
+ //#endregion
395
+ //#region src/configs/e18e.ts
396
+ async function e18e(options = {}) {
397
+ const { isInEditor = false, modernization = true, moduleReplacements = isInEditor, overrides = {}, performanceImprovements = true } = options;
398
+ const configs$1 = pluginE18e.configs;
399
+ return [{
400
+ name: "vinicunca/e18e/rules",
401
+ plugins: { e18e: pluginE18e },
402
+ rules: {
403
+ ...modernization ? { ...configs$1.modernization.rules } : {},
404
+ ...moduleReplacements ? { ...configs$1.moduleReplacements.rules } : {},
405
+ ...performanceImprovements ? { ...configs$1.performanceImprovements.rules } : {},
406
+ ...overrides
407
+ }
408
+ }];
409
+ }
410
+
393
411
  //#endregion
394
412
  //#region src/configs/stylistic.ts
395
413
  const STYLISTIC_CONFIG_DEFAULTS = {
@@ -511,11 +529,12 @@ async function formatters(options = {}, stylistic$1 = {}) {
511
529
  xmlSortAttributesByKey: false,
512
530
  xmlWhitespaceSensitivity: "ignore"
513
531
  };
514
- const dprintOptions = Object.assign({
532
+ const dprintOptions = {
515
533
  indentWidth: e(indent) ? indent : 2,
516
534
  quoteStyle: quotes === "single" ? "preferSingle" : "preferDouble",
517
- useTabs: indent === "tab"
518
- }, options.dprintOptions || {});
535
+ useTabs: indent === "tab",
536
+ ...options.dprintOptions || {}
537
+ };
519
538
  const configs$1 = [{
520
539
  name: "vinicunca/formatter/setup",
521
540
  plugins: { format: await interopDefault(import("eslint-plugin-format")) }
@@ -1234,7 +1253,7 @@ async function perfectionist() {
1234
1253
  async function detectCatalogUsage() {
1235
1254
  const workspaceFile = await findUp("pnpm-workspace.yaml");
1236
1255
  if (!workspaceFile) return false;
1237
- const yaml$1 = await fs.readFile(workspaceFile, "utf-8");
1256
+ const yaml$1 = await fsPromises.readFile(workspaceFile, "utf-8");
1238
1257
  return yaml$1.includes("catalog:") || yaml$1.includes("catalogs:");
1239
1258
  }
1240
1259
  async function pnpm(options) {
@@ -1381,10 +1400,7 @@ async function react(options = {}) {
1381
1400
  "eslint-plugin-react-refresh"
1382
1401
  ]);
1383
1402
  const isTypeAware = !!tsconfigPath;
1384
- const typeAwareRules = {
1385
- "react/no-implicit-key": ERROR,
1386
- "react/no-leaked-conditional-rendering": WARN
1387
- };
1403
+ const typeAwareRules = { "react/no-leaked-conditional-rendering": WARN };
1388
1404
  const [pluginReact, pluginReactHooks, pluginReactRefresh] = await Promise.all([
1389
1405
  interopDefault(import("@eslint-react/eslint-plugin")),
1390
1406
  interopDefault(import("eslint-plugin-react-hooks")),
@@ -2178,7 +2194,7 @@ async function typescript(options = {}) {
2178
2194
  }] : [],
2179
2195
  ...erasableOnly ? [{
2180
2196
  name: "antfu/typescript/erasable-syntax-only",
2181
- plugins: { "erasable-syntax-only": await interopDefault(import("./lib-ok3LDcYL.mjs")) },
2197
+ plugins: { "erasable-syntax-only": await interopDefault(import("./lib-BY1orQVd.mjs")) },
2182
2198
  rules: {
2183
2199
  "erasable-syntax-only/enums": ERROR,
2184
2200
  "erasable-syntax-only/import-aliases": ERROR,
@@ -2527,7 +2543,7 @@ const defaultPluginRenaming = {
2527
2543
  * The merged ESLint configurations.
2528
2544
  */
2529
2545
  function vinicuncaESLint(options = {}, ...userConfigs) {
2530
- const { astro: enableAstro = false, autoRenamePlugins = true, componentExts = [], gitignore: enableGitignore = true, ignores: userIgnores = [], imports: enableImports = true, jsdoc: enableJsdoc = true, jsx: enableJsx = true, nextjs: enableNextjs = false, node: enableNode = true, pnpm: enableCatalogs = !!findUpSync("pnpm-workspace.yaml"), react: enableReact = false, regexp: enableRegexp = true, solid: enableSolid = false, svelte: enableSvelte = false, typescript: enableTypeScript = isPackageExists("typescript"), unicorn: enableUnicorn = true, unocss: enableUnoCSS = false, vue: enableVue = VuePackages.some((i) => isPackageExists(i)) } = options;
2546
+ const { astro: enableAstro = false, autoRenamePlugins = true, componentExts = [], e18e: enableE18e = true, gitignore: enableGitignore = true, ignores: userIgnores = [], imports: enableImports = true, jsdoc: enableJsdoc = true, jsx: enableJsx = true, nextjs: enableNextjs = false, node: enableNode = true, pnpm: enableCatalogs = !!findUpSync("pnpm-workspace.yaml"), react: enableReact = false, regexp: enableRegexp = true, solid: enableSolid = false, svelte: enableSvelte = false, typescript: enableTypeScript = isPackageExists("typescript"), unicorn: enableUnicorn = true, unocss: enableUnoCSS = false, vue: enableVue = VuePackages.some((i) => isPackageExists(i)) } = options;
2531
2547
  let isInEditor = options.isInEditor;
2532
2548
  if (isInEditor == null) {
2533
2549
  isInEditor = isInEditorEnv();
@@ -2556,6 +2572,10 @@ function vinicuncaESLint(options = {}, ...userConfigs) {
2556
2572
  stylistic: stylisticOptions,
2557
2573
  ...resolveSubOptions(options, "imports")
2558
2574
  }));
2575
+ if (enableE18e) configs$1.push(e18e({
2576
+ isInEditor,
2577
+ ...enableE18e === true ? {} : enableE18e
2578
+ }));
2559
2579
  if (enableUnicorn) configs$1.push(unicorn(enableUnicorn === true ? {} : enableUnicorn));
2560
2580
  if (enableVue) componentExts.push("vue");
2561
2581
  if (enableJsx) configs$1.push(jsx(enableJsx === true ? {} : enableJsx));
@@ -2662,4 +2682,4 @@ function resolveSubOptions(options, key) {
2662
2682
  }
2663
2683
 
2664
2684
  //#endregion
2665
- 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_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, STYLISTIC_CONFIG_DEFAULTS, astro, combineConfigs, command, comments, defaultPluginRenaming, disables, ensurePackages, formatters, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, parserPlain, perfectionist, pluginAntfu, pluginComments, pluginImportLite, pluginNode, pluginPerfectionist, pluginSonar, pluginUnicorn, pluginUnusedImports, pnpm, react, regexp, renamePluginInConfigs, renameRules, solid, sonar, sortPackageJson, sortTsconfig, stylistic, svelte, test, toArray, toml, typescript, unicorn, unocss, vinicuncaESLint, vue, yaml };
2685
+ 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_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, STYLISTIC_CONFIG_DEFAULTS, astro, combineConfigs, command, comments, defaultPluginRenaming, disables, e18e, ensurePackages, formatters, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, parserPlain, perfectionist, pluginAntfu, pluginComments, pluginE18e, pluginImportLite, pluginNode, pluginPerfectionist, pluginSonar, pluginUnicorn, pluginUnusedImports, pnpm, react, regexp, renamePluginInConfigs, renameRules, solid, sonar, sortPackageJson, sortTsconfig, stylistic, svelte, test, toArray, toml, typescript, unicorn, unocss, vinicuncaESLint, vue, yaml };