@luxass/eslint-config 7.2.1 → 7.3.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
@@ -52,6 +52,47 @@ declare function comments(): Promise<TypedFlatConfigItem[]>;
52
52
  //#region src/configs/disables.d.ts
53
53
  declare function disables(): Promise<TypedFlatConfigItem[]>;
54
54
  //#endregion
55
+ //#region src/configs/e18e.d.ts
56
+ interface E18eOptions {
57
+ /**
58
+ * Include modernization rules
59
+ *
60
+ * @see https://github.com/e18e/eslint-plugin#modernization
61
+ * @default true
62
+ */
63
+ modernization?: boolean;
64
+ /**
65
+ * Include module replacements rules
66
+ *
67
+ * @see https://github.com/e18e/eslint-plugin#module-replacements
68
+ * @default options.isInEditor
69
+ */
70
+ moduleReplacements?: boolean;
71
+ /**
72
+ * Include performance improvements rules
73
+ *
74
+ * @see https://github.com/e18e/eslint-plugin#performance-improvements
75
+ * @default true
76
+ */
77
+ performanceImprovements?: boolean;
78
+ /**
79
+ * Overrides for the config.
80
+ */
81
+ overrides?: TypedFlatConfigItem["rules"];
82
+ /**
83
+ * Whether the config is for an editor.
84
+ * @default false
85
+ */
86
+ isInEditor?: boolean;
87
+ /**
88
+ * Type of the project. `lib` will enable more strict rules for libraries.
89
+ *
90
+ * @default "app"
91
+ */
92
+ type?: ProjectType;
93
+ }
94
+ declare function e18e(options?: E18eOptions): Promise<TypedFlatConfigItem[]>;
95
+ //#endregion
55
96
  //#region src/vendor/prettier-types.d.ts
56
97
  /**
57
98
  * Vendor types from Prettier so we don't rely on the dependency.
@@ -1142,6 +1183,87 @@ interface RuleOptions {
1142
1183
  * @see https://eslint.org/docs/latest/rules/dot-notation
1143
1184
  */
1144
1185
  'dot-notation'?: Linter.RuleEntry<DotNotation>;
1186
+ /**
1187
+ * Bans a list of dependencies from being used
1188
+ * @see https://github.com/es-tooling/eslint-plugin-depend/blob/main/docs/rules/ban-dependencies.md
1189
+ */
1190
+ 'e18e/ban-dependencies'?: Linter.RuleEntry<E18EBanDependencies>;
1191
+ /**
1192
+ * Prefer optimized alternatives to `indexOf()` equality checks
1193
+ */
1194
+ 'e18e/no-indexof-equality'?: Linter.RuleEntry<[]>;
1195
+ /**
1196
+ * Prefer Array.prototype.at() over length-based indexing
1197
+ */
1198
+ 'e18e/prefer-array-at'?: Linter.RuleEntry<[]>;
1199
+ /**
1200
+ * Prefer Array.prototype.fill() over Array.from or map with constant values
1201
+ */
1202
+ 'e18e/prefer-array-fill'?: Linter.RuleEntry<[]>;
1203
+ /**
1204
+ * Prefer Array.from(iterable, mapper) over [...iterable].map(mapper) to avoid intermediate array allocation
1205
+ */
1206
+ 'e18e/prefer-array-from-map'?: Linter.RuleEntry<[]>;
1207
+ /**
1208
+ * Prefer Array.some() over Array.find() when checking for element existence
1209
+ */
1210
+ 'e18e/prefer-array-some'?: Linter.RuleEntry<[]>;
1211
+ /**
1212
+ * Prefer Array.prototype.toReversed() over copying and reversing arrays
1213
+ */
1214
+ 'e18e/prefer-array-to-reversed'?: Linter.RuleEntry<[]>;
1215
+ /**
1216
+ * Prefer Array.prototype.toSorted() over copying and sorting arrays
1217
+ */
1218
+ 'e18e/prefer-array-to-sorted'?: Linter.RuleEntry<[]>;
1219
+ /**
1220
+ * Prefer Array.prototype.toSpliced() over copying and splicing arrays
1221
+ */
1222
+ 'e18e/prefer-array-to-spliced'?: Linter.RuleEntry<[]>;
1223
+ /**
1224
+ * Prefer Date.now() over new Date().getTime() and +new Date()
1225
+ */
1226
+ 'e18e/prefer-date-now'?: Linter.RuleEntry<[]>;
1227
+ /**
1228
+ * Prefer the exponentiation operator ** over Math.pow()
1229
+ */
1230
+ 'e18e/prefer-exponentiation-operator'?: Linter.RuleEntry<[]>;
1231
+ /**
1232
+ * Prefer .includes() over indexOf() comparisons for arrays and strings
1233
+ */
1234
+ 'e18e/prefer-includes'?: Linter.RuleEntry<[]>;
1235
+ /**
1236
+ * Prefer inline equality checks over temporary object creation for simple comparisons
1237
+ */
1238
+ 'e18e/prefer-inline-equality'?: Linter.RuleEntry<[]>;
1239
+ /**
1240
+ * Prefer nullish coalescing operator (?? and ??=) over verbose null checks
1241
+ */
1242
+ 'e18e/prefer-nullish-coalescing'?: Linter.RuleEntry<[]>;
1243
+ /**
1244
+ * Prefer Object.hasOwn() over Object.prototype.hasOwnProperty.call() and obj.hasOwnProperty()
1245
+ */
1246
+ 'e18e/prefer-object-has-own'?: Linter.RuleEntry<[]>;
1247
+ /**
1248
+ * prefer `RegExp.test()` over `String.match()` and `RegExp.exec()` when only checking for match existence
1249
+ */
1250
+ 'e18e/prefer-regex-test'?: Linter.RuleEntry<[]>;
1251
+ /**
1252
+ * Prefer spread syntax over Array.concat(), Array.from(), Object.assign({}, ...), and Function.apply()
1253
+ */
1254
+ 'e18e/prefer-spread-syntax'?: Linter.RuleEntry<[]>;
1255
+ /**
1256
+ * Prefer defining regular expressions at module scope to avoid re-compilation on every function call
1257
+ */
1258
+ 'e18e/prefer-static-regex'?: Linter.RuleEntry<[]>;
1259
+ /**
1260
+ * Prefer passing function and arguments directly to setTimeout/setInterval instead of wrapping in an arrow function or using bind
1261
+ */
1262
+ 'e18e/prefer-timer-args'?: Linter.RuleEntry<[]>;
1263
+ /**
1264
+ * Prefer URL.canParse() over try-catch blocks for URL validation
1265
+ */
1266
+ 'e18e/prefer-url-canparse'?: Linter.RuleEntry<[]>;
1145
1267
  /**
1146
1268
  * Require or disallow newline at the end of files
1147
1269
  * @see https://eslint.org/docs/latest/rules/eol-last
@@ -1201,6 +1323,7 @@ interface RuleOptions {
1201
1323
  /**
1202
1324
  * disallow unused `eslint-disable` comments
1203
1325
  * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-unused-disable.html
1326
+ * @deprecated
1204
1327
  */
1205
1328
  'eslint-comments/no-unused-disable'?: Linter.RuleEntry<[]>;
1206
1329
  /**
@@ -8728,6 +8851,11 @@ type DotLocation = [] | [("object" | "property")]; // ----- dot-notation -----
8728
8851
  type DotNotation = [] | [{
8729
8852
  allowKeywords?: boolean;
8730
8853
  allowPattern?: string;
8854
+ }]; // ----- e18e/ban-dependencies -----
8855
+ type E18EBanDependencies = [] | [{
8856
+ presets?: string[];
8857
+ modules?: string[];
8858
+ allowed?: string[];
8731
8859
  }]; // ----- eol-last -----
8732
8860
  type EolLast = [] | [("always" | "never" | "unix" | "windows")]; // ----- eqeqeq -----
8733
8861
  type Eqeqeq = ([] | ["always"] | ["always", {
@@ -13791,33 +13919,33 @@ type StyleExpListStyle = [] | [{
13791
13919
  singleLine?: _StyleExpListStyle_SingleLineConfig;
13792
13920
  multiLine?: _StyleExpListStyle_MultiLineConfig;
13793
13921
  overrides?: {
13794
- "()"?: _StyleExpListStyle_BaseConfig;
13795
- "[]"?: _StyleExpListStyle_BaseConfig;
13796
- "{}"?: _StyleExpListStyle_BaseConfig;
13797
- "<>"?: _StyleExpListStyle_BaseConfig;
13798
- ArrayExpression?: _StyleExpListStyle_BaseConfig;
13799
- ArrayPattern?: _StyleExpListStyle_BaseConfig;
13800
- ArrowFunctionExpression?: _StyleExpListStyle_BaseConfig;
13801
- CallExpression?: _StyleExpListStyle_BaseConfig;
13802
- ExportNamedDeclaration?: _StyleExpListStyle_BaseConfig;
13803
- FunctionDeclaration?: _StyleExpListStyle_BaseConfig;
13804
- FunctionExpression?: _StyleExpListStyle_BaseConfig;
13805
- IfStatement?: _StyleExpListStyle_BaseConfig;
13806
- ImportAttributes?: _StyleExpListStyle_BaseConfig;
13807
- ImportDeclaration?: _StyleExpListStyle_BaseConfig;
13808
- JSONArrayExpression?: _StyleExpListStyle_BaseConfig;
13809
- JSONObjectExpression?: _StyleExpListStyle_BaseConfig;
13810
- NewExpression?: _StyleExpListStyle_BaseConfig;
13811
- ObjectExpression?: _StyleExpListStyle_BaseConfig;
13812
- ObjectPattern?: _StyleExpListStyle_BaseConfig;
13813
- TSDeclareFunction?: _StyleExpListStyle_BaseConfig;
13814
- TSEnumBody?: _StyleExpListStyle_BaseConfig;
13815
- TSFunctionType?: _StyleExpListStyle_BaseConfig;
13816
- TSInterfaceBody?: _StyleExpListStyle_BaseConfig;
13817
- TSTupleType?: _StyleExpListStyle_BaseConfig;
13818
- TSTypeLiteral?: _StyleExpListStyle_BaseConfig;
13819
- TSTypeParameterDeclaration?: _StyleExpListStyle_BaseConfig;
13820
- TSTypeParameterInstantiation?: _StyleExpListStyle_BaseConfig;
13922
+ "()"?: (_StyleExpListStyle_BaseConfig | "off");
13923
+ "[]"?: (_StyleExpListStyle_BaseConfig | "off");
13924
+ "{}"?: (_StyleExpListStyle_BaseConfig | "off");
13925
+ "<>"?: (_StyleExpListStyle_BaseConfig | "off");
13926
+ ArrayExpression?: (_StyleExpListStyle_BaseConfig | "off");
13927
+ ArrayPattern?: (_StyleExpListStyle_BaseConfig | "off");
13928
+ ArrowFunctionExpression?: (_StyleExpListStyle_BaseConfig | "off");
13929
+ CallExpression?: (_StyleExpListStyle_BaseConfig | "off");
13930
+ ExportNamedDeclaration?: (_StyleExpListStyle_BaseConfig | "off");
13931
+ FunctionDeclaration?: (_StyleExpListStyle_BaseConfig | "off");
13932
+ FunctionExpression?: (_StyleExpListStyle_BaseConfig | "off");
13933
+ IfStatement?: (_StyleExpListStyle_BaseConfig | "off");
13934
+ ImportAttributes?: (_StyleExpListStyle_BaseConfig | "off");
13935
+ ImportDeclaration?: (_StyleExpListStyle_BaseConfig | "off");
13936
+ JSONArrayExpression?: (_StyleExpListStyle_BaseConfig | "off");
13937
+ JSONObjectExpression?: (_StyleExpListStyle_BaseConfig | "off");
13938
+ NewExpression?: (_StyleExpListStyle_BaseConfig | "off");
13939
+ ObjectExpression?: (_StyleExpListStyle_BaseConfig | "off");
13940
+ ObjectPattern?: (_StyleExpListStyle_BaseConfig | "off");
13941
+ TSDeclareFunction?: (_StyleExpListStyle_BaseConfig | "off");
13942
+ TSEnumBody?: (_StyleExpListStyle_BaseConfig | "off");
13943
+ TSFunctionType?: (_StyleExpListStyle_BaseConfig | "off");
13944
+ TSInterfaceBody?: (_StyleExpListStyle_BaseConfig | "off");
13945
+ TSTupleType?: (_StyleExpListStyle_BaseConfig | "off");
13946
+ TSTypeLiteral?: (_StyleExpListStyle_BaseConfig | "off");
13947
+ TSTypeParameterDeclaration?: (_StyleExpListStyle_BaseConfig | "off");
13948
+ TSTypeParameterInstantiation?: (_StyleExpListStyle_BaseConfig | "off");
13821
13949
  };
13822
13950
  }];
13823
13951
  interface _StyleExpListStyle_SingleLineConfig {
@@ -14688,6 +14816,7 @@ type StylePaddingLineBetweenStatements = {
14688
14816
  }[];
14689
14817
  interface _StylePaddingLineBetweenStatements_SelectorOption {
14690
14818
  selector: string;
14819
+ lineMode?: ("any" | "singleline" | "multiline");
14691
14820
  } // ----- style/quote-props -----
14692
14821
  type StyleQuoteProps = ([] | [("always" | "as-needed" | "consistent" | "consistent-as-needed")] | [] | [("always" | "as-needed" | "consistent" | "consistent-as-needed")] | [("always" | "as-needed" | "consistent" | "consistent-as-needed"), {
14693
14822
  keywords?: boolean;
@@ -15761,6 +15890,18 @@ type TsPreferOptionalChain = [] | [{
15761
15890
  requireNullish?: boolean;
15762
15891
  }]; // ----- ts/prefer-promise-reject-errors -----
15763
15892
  type TsPreferPromiseRejectErrors = [] | [{
15893
+ allow?: (string | {
15894
+ from: "file";
15895
+ name: (string | [string, ...(string)[]]);
15896
+ path?: string;
15897
+ } | {
15898
+ from: "lib";
15899
+ name: (string | [string, ...(string)[]]);
15900
+ } | {
15901
+ from: "package";
15902
+ name: (string | [string, ...(string)[]]);
15903
+ package: string;
15904
+ })[];
15764
15905
  allowEmptyReject?: boolean;
15765
15906
  allowThrowingAny?: boolean;
15766
15907
  allowThrowingUnknown?: boolean;
@@ -17371,7 +17512,7 @@ type Yoda = [] | [("always" | "never")] | [("always" | "never"), {
17371
17512
  exceptRange?: boolean;
17372
17513
  onlyEquality?: boolean;
17373
17514
  }]; // Names of all the configs
17374
- type ConfigNames = 'luxass/gitignore' | 'luxass/ignores' | 'luxass/javascript/setup' | 'luxass/javascript/rules' | 'luxass/disables/cli' | 'luxass/eslint-comments' | 'command' | 'luxass/perfectionist/setup' | 'luxass/node/setup' | 'luxass/node/rules' | 'luxass/jsdoc/setup' | 'luxass/jsdoc/rules' | 'luxass/imports' | 'luxass/unicorn/rules' | 'luxass/jsx/setup' | 'luxass/typescript/setup' | 'luxass/typescript/type-aware-parser' | 'luxass/typescript/parser' | 'luxass/typescript/rules' | 'luxass/typescript/rules-type-aware' | 'luxas/typescript/erasable-syntax-only' | 'luxass/stylistic' | 'luxass/regexp/rules' | 'luxass/test/setup' | 'luxass/test/rules' | 'luxass/react/setup' | 'luxass/react/rules' | 'luxass/react/type-aware-rules' | 'luxass/vue/setup' | 'luxass/vue/rules' | 'luxass/astro/setup' | 'luxass/astro/rules' | 'luxass/unocss' | 'luxass/jsonc/setup' | 'luxass/jsonc/rules' | 'luxass/sort/package-json' | 'luxass/sort/tsconfig' | 'luxass/pnpm/package-json' | 'luxass/pnpm/pnpm-workspace-yaml' | 'luxass/pnpm/pnpm-workspace-yaml-sort' | 'luxass/yaml/setup' | 'luxass/yaml/rules' | 'luxass/yaml/pnpm-workspace' | 'luxass/toml/setup' | 'luxass/toml/rules' | 'luxass/markdown/setup' | 'luxass/markdown/processor' | 'luxass/markdown/parser' | 'luxass/markdown/rules' | 'luxass/markdown/disables/markdown' | 'luxass/markdown/disables/code' | 'luxass/formatter/setup' | 'luxass/formatter/css' | 'luxass/formatter/scss' | 'luxass/formatter/less' | 'luxass/formatter/html' | 'luxass/formatter/xml' | 'luxass/formatter/svg' | 'luxass/formatter/markdown' | 'luxass/formatter/astro' | 'luxass/formatter/graphql' | 'luxass/disables/scripts' | 'luxass/disables/cli' | 'luxass/disables/bin' | 'luxass/disables/dts' | 'luxass/disables/cjs' | 'luxass/disables/github-actions' | 'luxass/disables/config-files';
17515
+ type ConfigNames = 'luxass/gitignore' | 'luxass/ignores' | 'luxass/javascript/setup' | 'luxass/javascript/rules' | 'luxass/disables/cli' | 'luxass/eslint-comments' | 'command' | 'luxass/perfectionist/setup' | 'luxass/node/setup' | 'luxass/node/rules' | 'luxass/jsdoc/setup' | 'luxass/jsdoc/rules' | 'luxass/imports' | 'luxass/e18e/rules' | 'luxass/unicorn/rules' | 'luxass/jsx/setup' | 'luxass/typescript/setup' | 'luxass/typescript/type-aware-parser' | 'luxass/typescript/parser' | 'luxass/typescript/rules' | 'luxass/typescript/rules-type-aware' | 'luxas/typescript/erasable-syntax-only' | 'luxass/stylistic' | 'luxass/regexp/rules' | 'luxass/test/setup' | 'luxass/test/rules' | 'luxass/react/setup' | 'luxass/react/rules' | 'luxass/react/type-aware-rules' | 'luxass/vue/setup' | 'luxass/vue/rules' | 'luxass/astro/setup' | 'luxass/astro/rules' | 'luxass/unocss' | 'luxass/jsonc/setup' | 'luxass/jsonc/rules' | 'luxass/sort/package-json' | 'luxass/sort/tsconfig' | 'luxass/pnpm/package-json' | 'luxass/pnpm/pnpm-workspace-yaml' | 'luxass/pnpm/pnpm-workspace-yaml-sort' | 'luxass/yaml/setup' | 'luxass/yaml/rules' | 'luxass/yaml/pnpm-workspace' | 'luxass/toml/setup' | 'luxass/toml/rules' | 'luxass/markdown/setup' | 'luxass/markdown/processor' | 'luxass/markdown/parser' | 'luxass/markdown/rules' | 'luxass/markdown/disables/markdown' | 'luxass/markdown/disables/code' | 'luxass/formatter/setup' | 'luxass/formatter/css' | 'luxass/formatter/scss' | 'luxass/formatter/less' | 'luxass/formatter/html' | 'luxass/formatter/xml' | 'luxass/formatter/svg' | 'luxass/formatter/markdown' | 'luxass/formatter/astro' | 'luxass/formatter/graphql' | 'luxass/disables/scripts' | 'luxass/disables/cli' | 'luxass/disables/bin' | 'luxass/disables/dts' | 'luxass/disables/cjs' | 'luxass/disables/github-actions' | 'luxass/disables/config-files';
17375
17516
  //#endregion
17376
17517
  //#region src/types.d.ts
17377
17518
  type Awaitable<T> = T | Promise<T>;
@@ -17417,6 +17558,12 @@ interface ConfigOptions {
17417
17558
  * @default []
17418
17559
  */
17419
17560
  ignores?: string[] | ((originals: string[]) => string[]);
17561
+ /**
17562
+ * Options for [@e18e/eslint-plugin](https://github.com/e18e/eslint-plugin)
17563
+ *
17564
+ * @default true
17565
+ */
17566
+ e18e?: boolean | E18eOptions;
17420
17567
  /**
17421
17568
  * Options for eslint-plugin-unicorn.
17422
17569
  *
@@ -17807,4 +17954,4 @@ declare function isPackageInScope(name: string): boolean;
17807
17954
  declare function isInEditorEnv(): boolean;
17808
17955
  declare function isInGitHooksOrLintStaged(): boolean;
17809
17956
  //#endregion
17810
- export { type AstroOptions, Awaitable, type ConfigNames, ConfigOptions, type FormattersOptions, 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_NEXTJS_OG, GLOB_NEXTJS_ROUTES, 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, type ImportsOptions, type JSDOCOptions, type JSONOptions, type JavaScriptOptions, type MarkdownOptions, type PnpmOptions, ProjectType, type ReactOptions, type RegExpOptions, ResolvedOptions, type RuleOptions, Rules, type StylisticConfig, type StylisticOptions, type TOMLOptions, type TailwindCSSOptions, type TestOptions, type TypeScriptOptions, TypedFlatConfigItem, type UnicornOptions, type UnoCSSOptions, UserConfigItem, type VueOptions, type YAMLOptions, astro, combine, command, comments, luxass as default, luxass, disables, ensure, formatters, getOverrides, ignores, imports, interop, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, node, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, sortPackageJson, sortTsconfig, stylistic, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
17957
+ export { type AstroOptions, Awaitable, type ConfigNames, ConfigOptions, type E18eOptions, type FormattersOptions, 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_NEXTJS_OG, GLOB_NEXTJS_ROUTES, 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, type ImportsOptions, type JSDOCOptions, type JSONOptions, type JavaScriptOptions, type MarkdownOptions, type PnpmOptions, ProjectType, type ReactOptions, type RegExpOptions, ResolvedOptions, type RuleOptions, Rules, type StylisticConfig, type StylisticOptions, type TOMLOptions, type TailwindCSSOptions, type TestOptions, type TypeScriptOptions, TypedFlatConfigItem, type UnicornOptions, type UnoCSSOptions, UserConfigItem, type VueOptions, type YAMLOptions, astro, combine, command, comments, luxass as default, luxass, disables, e18e, ensure, formatters, getOverrides, ignores, imports, interop, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, node, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, sortPackageJson, sortTsconfig, stylistic, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
package/dist/index.mjs CHANGED
@@ -7,6 +7,7 @@ import path from "node:path";
7
7
  import { isPackageExists } from "local-pkg";
8
8
  import createCommand from "eslint-plugin-command/config";
9
9
  import eslintCommentsPlugin from "@eslint-community/eslint-plugin-eslint-comments";
10
+ import pluginE18e from "@e18e/eslint-plugin";
10
11
  import pluginAntfu from "eslint-plugin-antfu";
11
12
  import pluginImportLite from "eslint-plugin-import-lite";
12
13
  import pluginUnusedImports from "eslint-plugin-unused-imports";
@@ -16,7 +17,6 @@ import pluginNode from "eslint-plugin-n";
16
17
  import pluginPerfectionist from "eslint-plugin-perfectionist";
17
18
  import { configs } from "eslint-plugin-regexp";
18
19
  import pluginUnicorn from "eslint-plugin-unicorn";
19
-
20
20
  //#region node_modules/.pnpm/find-up-simple@1.0.1/node_modules/find-up-simple/index.js
21
21
  const toPath = (urlOrPath) => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;
22
22
  async function findUp(name, { cwd = process.cwd(), type = "file", stopAt } = {}) {
@@ -49,7 +49,6 @@ function findUpSync(name, { cwd = process.cwd(), type = "file", stopAt } = {}) {
49
49
  directory = path.dirname(directory);
50
50
  }
51
51
  }
52
-
53
52
  //#endregion
54
53
  //#region src/globs.ts
55
54
  const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
@@ -138,7 +137,6 @@ const GLOB_EXCLUDE = [
138
137
  "**/auto-import?(s).d.ts",
139
138
  "**/components.d.ts"
140
139
  ];
141
-
142
140
  //#endregion
143
141
  //#region src/utils.ts
144
142
  const scopeUrl = fileURLToPath(new URL(".", import.meta.url));
@@ -331,12 +329,11 @@ function isPackageInScope(name) {
331
329
  function isInEditorEnv() {
332
330
  if (process.env.CI) return false;
333
331
  if (isInGitHooksOrLintStaged()) return false;
334
- return !!(process.env.VSCODE_PID || process.env.VSCODE_CWD || process.env.JETBRAINS_IDE || process.env.VIM || process.env.NVIM);
332
+ return !!(process.env.VSCODE_PID || process.env.VSCODE_CWD || process.env.JETBRAINS_IDE || process.env.VIM || process.env.NVIM || process.env.ZED_ENVIRONMENT && !process.env.ZED_TERM);
335
333
  }
336
334
  function isInGitHooksOrLintStaged() {
337
335
  return !!(process.env.GIT_PARAMS || process.env.VSCODE_GIT_COMMAND || process.env.npm_lifecycle_script?.startsWith("lint-staged"));
338
336
  }
339
-
340
337
  //#endregion
341
338
  //#region src/configs/astro.ts
342
339
  async function astro(options = {}) {
@@ -385,7 +382,6 @@ async function astro(options = {}) {
385
382
  }
386
383
  }];
387
384
  }
388
-
389
385
  //#endregion
390
386
  //#region src/configs/command.ts
391
387
  async function command() {
@@ -394,7 +390,6 @@ async function command() {
394
390
  ...createCommand()
395
391
  }];
396
392
  }
397
-
398
393
  //#endregion
399
394
  //#region src/configs/comments.ts
400
395
  async function comments() {
@@ -409,7 +404,6 @@ async function comments() {
409
404
  }
410
405
  }];
411
406
  }
412
-
413
407
  //#endregion
414
408
  //#region src/configs/disables.ts
415
409
  async function disables() {
@@ -469,7 +463,22 @@ async function disables() {
469
463
  }
470
464
  ];
471
465
  }
472
-
466
+ //#endregion
467
+ //#region src/configs/e18e.ts
468
+ async function e18e(options = {}) {
469
+ const { isInEditor = false, modernization = true, type = "app", moduleReplacements = type === "lib" && isInEditor, overrides = {}, performanceImprovements = true } = options;
470
+ const configs = pluginE18e.configs;
471
+ return [{
472
+ name: "luxass/e18e/rules",
473
+ plugins: { e18e: pluginE18e },
474
+ rules: {
475
+ ...modernization ? { ...configs.modernization.rules } : {},
476
+ ...moduleReplacements ? { ...configs.moduleReplacements.rules } : {},
477
+ ...performanceImprovements ? { ...configs.performanceImprovements.rules } : {},
478
+ ...overrides
479
+ }
480
+ }];
481
+ }
473
482
  //#endregion
474
483
  //#region src/configs/stylistic.ts
475
484
  const StylisticConfigDefaults = {
@@ -529,7 +538,6 @@ async function stylistic(options = {}) {
529
538
  }
530
539
  }];
531
540
  }
532
-
533
541
  //#endregion
534
542
  //#region src/configs/formatters.ts
535
543
  function mergePrettierOptions(options, overrides) {
@@ -576,11 +584,12 @@ async function formatters(options = {}, stylistic = {}) {
576
584
  xmlSortAttributesByKey: false,
577
585
  xmlWhitespaceSensitivity: "ignore"
578
586
  };
579
- const dprintOptions = Object.assign({
587
+ const dprintOptions = {
580
588
  indentWidth: typeof indent === "number" ? indent : 2,
581
589
  quoteStyle: quotes === "single" ? "preferSingle" : "preferDouble",
582
- useTabs: indent === "tab"
583
- }, options.dprintOptions || {});
590
+ useTabs: indent === "tab",
591
+ ...options.dprintOptions || {}
592
+ };
584
593
  const configs = [{
585
594
  name: "luxass/formatter/setup",
586
595
  plugins: { format: await interop(import("eslint-plugin-format")) }
@@ -663,7 +672,6 @@ async function formatters(options = {}, stylistic = {}) {
663
672
  });
664
673
  return configs;
665
674
  }
666
-
667
675
  //#endregion
668
676
  //#region src/configs/ignores.ts
669
677
  async function ignores(userIgnores = [], ignoreTypeScript = false) {
@@ -676,7 +684,6 @@ async function ignores(userIgnores = [], ignoreTypeScript = false) {
676
684
  name: "luxass/ignores"
677
685
  }];
678
686
  }
679
-
680
687
  //#endregion
681
688
  //#region src/configs/imports.ts
682
689
  async function imports(options = {}) {
@@ -701,7 +708,6 @@ async function imports(options = {}) {
701
708
  }
702
709
  }];
703
710
  }
704
-
705
711
  //#endregion
706
712
  //#region src/configs/javascript.ts
707
713
  async function javascript(options = {}) {
@@ -941,7 +947,6 @@ async function javascript(options = {}) {
941
947
  }
942
948
  ];
943
949
  }
944
-
945
950
  //#endregion
946
951
  //#region src/configs/jsdoc.ts
947
952
  async function jsdoc(options = {}) {
@@ -976,7 +981,6 @@ async function jsdoc(options = {}) {
976
981
  }
977
982
  }];
978
983
  }
979
-
980
984
  //#endregion
981
985
  //#region src/configs/json.ts
982
986
  async function jsonc(options = {}) {
@@ -1042,7 +1046,6 @@ async function jsonc(options = {}) {
1042
1046
  }
1043
1047
  }];
1044
1048
  }
1045
-
1046
1049
  //#endregion
1047
1050
  //#region src/configs/jsx.ts
1048
1051
  async function jsx() {
@@ -1052,7 +1055,6 @@ async function jsx() {
1052
1055
  name: "luxass/jsx/setup"
1053
1056
  }];
1054
1057
  }
1055
-
1056
1058
  //#endregion
1057
1059
  //#region src/configs/markdown.ts
1058
1060
  async function markdown(options = {}) {
@@ -1079,6 +1081,7 @@ async function markdown(options = {}) {
1079
1081
  name: "luxass/markdown/rules",
1080
1082
  rules: {
1081
1083
  ...markdown.configs.recommended.at(0)?.rules,
1084
+ "markdown/fenced-code-language": "off",
1082
1085
  "markdown/no-missing-label-refs": "off",
1083
1086
  ...overridesMarkdown
1084
1087
  }
@@ -1104,6 +1107,7 @@ async function markdown(options = {}) {
1104
1107
  name: "luxass/markdown/disables/code",
1105
1108
  rules: {
1106
1109
  "antfu/no-top-level-await": "off",
1110
+ "e18e/prefer-static-regex": "off",
1107
1111
  "no-alert": "off",
1108
1112
  "no-console": "off",
1109
1113
  "no-labels": "off",
@@ -1133,7 +1137,6 @@ async function markdown(options = {}) {
1133
1137
  }
1134
1138
  ];
1135
1139
  }
1136
-
1137
1140
  //#endregion
1138
1141
  //#region src/configs/node.ts
1139
1142
  function node() {
@@ -1155,7 +1158,6 @@ function node() {
1155
1158
  }
1156
1159
  }];
1157
1160
  }
1158
-
1159
1161
  //#endregion
1160
1162
  //#region src/configs/perfectionist.ts
1161
1163
  /**
@@ -1209,7 +1211,6 @@ async function perfectionist() {
1209
1211
  }
1210
1212
  }];
1211
1213
  }
1212
-
1213
1214
  //#endregion
1214
1215
  //#region src/configs/pnpm.ts
1215
1216
  async function detectCatalogUsage() {
@@ -1336,7 +1337,6 @@ async function pnpm(options) {
1336
1337
  }
1337
1338
  return configs;
1338
1339
  }
1339
-
1340
1340
  //#endregion
1341
1341
  //#region src/configs/react.ts
1342
1342
  const ReactRefreshAllowConstantExportPackages = ["vite"];
@@ -1530,7 +1530,6 @@ async function react(options = {}) {
1530
1530
  }] : []
1531
1531
  ];
1532
1532
  }
1533
-
1534
1533
  //#endregion
1535
1534
  //#region src/configs/regexp.ts
1536
1535
  async function regexp(options = {}) {
@@ -1548,7 +1547,6 @@ async function regexp(options = {}) {
1548
1547
  }
1549
1548
  }];
1550
1549
  }
1551
-
1552
1550
  //#endregion
1553
1551
  //#region src/configs/sort.ts
1554
1552
  /**
@@ -1786,7 +1784,6 @@ function sortTsconfig() {
1786
1784
  ] }
1787
1785
  }];
1788
1786
  }
1789
-
1790
1787
  //#endregion
1791
1788
  //#region src/configs/tailwindcss.ts
1792
1789
  async function tailwindcss(options = {}) {
@@ -1810,7 +1807,6 @@ async function tailwindcss(options = {}) {
1810
1807
  settings: { ...configPath != null ? { tailwindcss: { config: configPath } } : {} }
1811
1808
  }];
1812
1809
  }
1813
-
1814
1810
  //#endregion
1815
1811
  //#region src/configs/test.ts
1816
1812
  let _pluginTest;
@@ -1835,6 +1831,7 @@ async function test(options = {}) {
1835
1831
  "test/prefer-hooks-in-order": "error",
1836
1832
  "test/prefer-lowercase-title": "error",
1837
1833
  "antfu/no-top-level-await": "off",
1834
+ "e18e/prefer-static-regex": "off",
1838
1835
  "no-unused-expressions": "off",
1839
1836
  "node/prefer-global/process": "off",
1840
1837
  "ts/explicit-function-return-type": "off",
@@ -1842,7 +1839,6 @@ async function test(options = {}) {
1842
1839
  }
1843
1840
  }];
1844
1841
  }
1845
-
1846
1842
  //#endregion
1847
1843
  //#region src/configs/toml.ts
1848
1844
  async function toml(options = {}) {
@@ -1883,18 +1879,17 @@ async function toml(options = {}) {
1883
1879
  }
1884
1880
  }];
1885
1881
  }
1886
-
1887
1882
  //#endregion
1888
1883
  //#region src/configs/typescript.ts
1889
1884
  async function typescript(options = {}) {
1890
1885
  const { erasableOnly = false, exts = [], overrides = {}, overridesTypeAware = {}, parserOptions = {}, type = "app" } = options ?? {};
1891
1886
  const files = options.files ?? [
1892
- GLOB_TS,
1893
- GLOB_TSX,
1887
+ "**/*.?([cm])ts",
1888
+ "**/*.?([cm])tsx",
1894
1889
  ...exts.map((ext) => `**/*.${ext}`)
1895
1890
  ];
1896
- const filesTypeAware = options.filesTypeAware ?? [GLOB_TS, GLOB_TSX];
1897
- const ignoresTypeAware = options.ignoresTypeAware ?? [`${GLOB_MARKDOWN}/**`, GLOB_ASTRO_TS];
1891
+ const filesTypeAware = options.filesTypeAware ?? ["**/*.?([cm])ts", "**/*.?([cm])tsx"];
1892
+ const ignoresTypeAware = options.ignoresTypeAware ?? [`**/*.md/**`, "**/*.astro/*.ts"];
1898
1893
  const tsconfigPath = options?.tsconfigPath ? options.tsconfigPath : void 0;
1899
1894
  const isTypeAware = !!tsconfigPath;
1900
1895
  const typeAwareRules = {
@@ -2023,7 +2018,7 @@ async function typescript(options = {}) {
2023
2018
  }] : [],
2024
2019
  ...erasableOnly ? [{
2025
2020
  name: "luxas/typescript/erasable-syntax-only",
2026
- plugins: { "erasable-syntax-only": await interop(import("./lib-DRpFEws2.mjs")) },
2021
+ plugins: { "erasable-syntax-only": await interop(import("./lib-D3Kr7UIJ.mjs")) },
2027
2022
  rules: {
2028
2023
  "erasable-syntax-only/enums": "error",
2029
2024
  "erasable-syntax-only/import-aliases": "error",
@@ -2033,7 +2028,6 @@ async function typescript(options = {}) {
2033
2028
  }] : []
2034
2029
  ];
2035
2030
  }
2036
-
2037
2031
  //#endregion
2038
2032
  //#region src/configs/unicorn.ts
2039
2033
  async function unicorn(options = {}) {
@@ -2057,7 +2051,6 @@ async function unicorn(options = {}) {
2057
2051
  } }
2058
2052
  }];
2059
2053
  }
2060
-
2061
2054
  //#endregion
2062
2055
  //#region src/configs/unocss.ts
2063
2056
  async function unocss(options = {}) {
@@ -2076,7 +2069,6 @@ async function unocss(options = {}) {
2076
2069
  settings: { ...configPath != null ? { unocss: { configPath } } : {} }
2077
2070
  }];
2078
2071
  }
2079
-
2080
2072
  //#endregion
2081
2073
  //#region src/configs/vue.ts
2082
2074
  async function vue(options = {}) {
@@ -2247,7 +2239,6 @@ async function vue(options = {}) {
2247
2239
  }
2248
2240
  }];
2249
2241
  }
2250
-
2251
2242
  //#endregion
2252
2243
  //#region src/configs/yaml.ts
2253
2244
  async function yaml(options = {}) {
@@ -2327,7 +2318,6 @@ async function yaml(options = {}) {
2327
2318
  }
2328
2319
  ];
2329
2320
  }
2330
-
2331
2321
  //#endregion
2332
2322
  //#region src/factory.ts
2333
2323
  const FLAT_CONFIG_PROPS = [
@@ -2368,7 +2358,7 @@ const defaultPluginRenaming = {
2368
2358
  * The merged ESLint configurations.
2369
2359
  */
2370
2360
  function luxass(options = {}, ...userConfigs) {
2371
- const { astro: enableAstro = false, autoRenamePlugins = true, exts = [], gitignore: enableGitignore = true, ignores: userIgnores = [], imports: enableImports = true, jsdoc: enableJsdoc = true, jsx: enableJsx = true, node: enableNode = true, pnpm: enableCatalogs = !!findUpSync("pnpm-workspace.yaml"), react: enableReact = false, regexp: enableRegexp = true, tailwindcss: enableTailwindCSS = false, type: projectType = "app", typescript: enableTypeScript = isPackageExists("typescript"), unicorn: enableUnicorn = true, unocss: enableUnoCSS = false, vue: enableVue = VuePackages.some((i) => isPackageExists(i)) } = options;
2361
+ const { astro: enableAstro = false, autoRenamePlugins = true, e18e: enableE18e = true, exts = [], gitignore: enableGitignore = true, ignores: userIgnores = [], imports: enableImports = true, jsdoc: enableJsdoc = true, jsx: enableJsx = true, node: enableNode = true, pnpm: enableCatalogs = !!findUpSync("pnpm-workspace.yaml"), react: enableReact = false, regexp: enableRegexp = true, tailwindcss: enableTailwindCSS = false, type: projectType = "app", typescript: enableTypeScript = isPackageExists("typescript") || isPackageExists("@typescript/native-preview"), unicorn: enableUnicorn = true, unocss: enableUnoCSS = false, vue: enableVue = VuePackages.some((i) => isPackageExists(i)) } = options;
2372
2362
  let isInEditor = options.isInEditor;
2373
2363
  if (isInEditor == null) {
2374
2364
  isInEditor = isInEditorEnv();
@@ -2397,6 +2387,10 @@ function luxass(options = {}, ...userConfigs) {
2397
2387
  stylistic: stylisticOptions,
2398
2388
  ...resolveSubOptions(options, "imports")
2399
2389
  }));
2390
+ if (enableE18e) configs.push(e18e({
2391
+ isInEditor,
2392
+ ...enableE18e === true ? {} : enableE18e
2393
+ }));
2400
2394
  if (enableUnicorn) configs.push(unicorn(enableUnicorn === true ? {} : enableUnicorn));
2401
2395
  if (enableVue) exts.push("vue");
2402
2396
  if (enableJsx) configs.push(jsx());
@@ -2477,10 +2471,8 @@ function luxass(options = {}, ...userConfigs) {
2477
2471
  if (autoRenamePlugins) composer = composer.renamePlugins(defaultPluginRenaming);
2478
2472
  return composer;
2479
2473
  }
2480
-
2481
2474
  //#endregion
2482
2475
  //#region src/index.ts
2483
2476
  var src_default = luxass;
2484
-
2485
2477
  //#endregion
2486
- export { 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_NEXTJS_OG, GLOB_NEXTJS_ROUTES, 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, astro, combine, command, comments, src_default as default, disables, ensure, formatters, getOverrides, ignores, imports, interop, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, luxass, markdown, node, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, sortPackageJson, sortTsconfig, stylistic, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
2478
+ export { 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_NEXTJS_OG, GLOB_NEXTJS_ROUTES, 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, astro, combine, command, comments, src_default as default, disables, e18e, ensure, formatters, getOverrides, ignores, imports, interop, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, luxass, markdown, node, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, sortPackageJson, sortTsconfig, stylistic, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };