@pengzhanbo/eslint-config 2.0.1 → 2.2.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";
@@ -134,6 +135,11 @@ interface RuleOptions {
134
135
  * @see https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin-template/docs/rules/no-nested-tags.md
135
136
  */
136
137
  'angular-template/no-nested-tags'?: Linter.RuleEntry<[]>;
138
+ /**
139
+ * Disallows the non-null assertion operator (!) in templates
140
+ * @see https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin-template/docs/rules/no-non-null-assertion.md
141
+ */
142
+ 'angular-template/no-non-null-assertion'?: Linter.RuleEntry<[]>;
137
143
  /**
138
144
  * Ensures that the `tabindex` attribute is not positive
139
145
  * @see https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin-template/docs/rules/no-positive-tabindex.md
@@ -224,6 +230,11 @@ interface RuleOptions {
224
230
  * @see https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/component-selector.md
225
231
  */
226
232
  'angular/component-selector'?: Linter.RuleEntry<AngularComponentSelector>;
233
+ /**
234
+ * Ensures that computed() returns a value. Omitting the value is likely a mistake.
235
+ * @see https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/computed-must-return.md
236
+ */
237
+ 'angular/computed-must-return'?: Linter.RuleEntry<[]>;
227
238
  /**
228
239
  * Ensures consistent usage of `styles`/`styleUrls`/`styleUrl` within Component metadata
229
240
  * @see https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/consistent-component-styles.md
@@ -992,6 +1003,7 @@ interface RuleOptions {
992
1003
  /**
993
1004
  * disallow unused `eslint-disable` comments
994
1005
  * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-unused-disable.html
1006
+ * @deprecated
995
1007
  */
996
1008
  'eslint-comments/no-unused-disable'?: Linter.RuleEntry<[]>;
997
1009
  /**
@@ -1018,6 +1030,10 @@ interface RuleOptions {
1018
1030
  * Use dprint to format code
1019
1031
  */
1020
1032
  'format/dprint'?: Linter.RuleEntry<FormatDprint>;
1033
+ /**
1034
+ * Use oxfmt to format code
1035
+ */
1036
+ 'format/oxfmt'?: Linter.RuleEntry<FormatOxfmt>;
1021
1037
  /**
1022
1038
  * Use Prettier to format code
1023
1039
  */
@@ -6146,11 +6162,21 @@ interface RuleOptions {
6146
6162
  * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/indent.html
6147
6163
  */
6148
6164
  'toml/indent'?: Linter.RuleEntry<TomlIndent>;
6165
+ /**
6166
+ * enforce linebreaks after opening and before closing braces
6167
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/inline-table-curly-newline.html
6168
+ */
6169
+ 'toml/inline-table-curly-newline'?: Linter.RuleEntry<TomlInlineTableCurlyNewline>;
6149
6170
  /**
6150
6171
  * enforce consistent spacing inside braces
6151
6172
  * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/inline-table-curly-spacing.html
6152
6173
  */
6153
6174
  'toml/inline-table-curly-spacing'?: Linter.RuleEntry<TomlInlineTableCurlySpacing>;
6175
+ /**
6176
+ * enforce placing inline table key-value pairs on separate lines
6177
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/inline-table-key-value-newline.html
6178
+ */
6179
+ 'toml/inline-table-key-value-newline'?: Linter.RuleEntry<TomlInlineTableKeyValueNewline>;
6154
6180
  /**
6155
6181
  * enforce consistent spacing between keys and values in key/value pairs
6156
6182
  * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/key-spacing.html
@@ -9686,6 +9712,9 @@ type FormatDprint = [] | [{
9686
9712
  };
9687
9713
  plugins?: unknown[];
9688
9714
  [k: string]: unknown | undefined;
9715
+ }]; // ----- format/oxfmt -----
9716
+ type FormatOxfmt = [] | [{
9717
+ [k: string]: unknown | undefined;
9689
9718
  }]; // ----- format/prettier -----
9690
9719
  type FormatPrettier = [] | [{
9691
9720
  parser: string;
@@ -10465,6 +10494,7 @@ type JsoncObjectCurlyNewline = [] | [((("always" | "never") | {
10465
10494
  type JsoncObjectCurlySpacing = [] | [("always" | "never")] | [("always" | "never"), {
10466
10495
  arraysInObjects?: boolean;
10467
10496
  objectsInObjects?: boolean;
10497
+ emptyObjects?: ("ignore" | "always" | "never");
10468
10498
  }]; // ----- jsonc/object-property-newline -----
10469
10499
  type JsoncObjectPropertyNewline = [] | [{
10470
10500
  allowAllPropertiesOnSameLine?: boolean;
@@ -14908,33 +14938,33 @@ type StyleExpListStyle = [] | [{
14908
14938
  singleLine?: _StyleExpListStyle_SingleLineConfig;
14909
14939
  multiLine?: _StyleExpListStyle_MultiLineConfig;
14910
14940
  overrides?: {
14911
- "()"?: _StyleExpListStyle_BaseConfig;
14912
- "[]"?: _StyleExpListStyle_BaseConfig;
14913
- "{}"?: _StyleExpListStyle_BaseConfig;
14914
- "<>"?: _StyleExpListStyle_BaseConfig;
14915
- ArrayExpression?: _StyleExpListStyle_BaseConfig;
14916
- ArrayPattern?: _StyleExpListStyle_BaseConfig;
14917
- ArrowFunctionExpression?: _StyleExpListStyle_BaseConfig;
14918
- CallExpression?: _StyleExpListStyle_BaseConfig;
14919
- ExportNamedDeclaration?: _StyleExpListStyle_BaseConfig;
14920
- FunctionDeclaration?: _StyleExpListStyle_BaseConfig;
14921
- FunctionExpression?: _StyleExpListStyle_BaseConfig;
14922
- IfStatement?: _StyleExpListStyle_BaseConfig;
14923
- ImportAttributes?: _StyleExpListStyle_BaseConfig;
14924
- ImportDeclaration?: _StyleExpListStyle_BaseConfig;
14925
- JSONArrayExpression?: _StyleExpListStyle_BaseConfig;
14926
- JSONObjectExpression?: _StyleExpListStyle_BaseConfig;
14927
- NewExpression?: _StyleExpListStyle_BaseConfig;
14928
- ObjectExpression?: _StyleExpListStyle_BaseConfig;
14929
- ObjectPattern?: _StyleExpListStyle_BaseConfig;
14930
- TSDeclareFunction?: _StyleExpListStyle_BaseConfig;
14931
- TSEnumBody?: _StyleExpListStyle_BaseConfig;
14932
- TSFunctionType?: _StyleExpListStyle_BaseConfig;
14933
- TSInterfaceBody?: _StyleExpListStyle_BaseConfig;
14934
- TSTupleType?: _StyleExpListStyle_BaseConfig;
14935
- TSTypeLiteral?: _StyleExpListStyle_BaseConfig;
14936
- TSTypeParameterDeclaration?: _StyleExpListStyle_BaseConfig;
14937
- TSTypeParameterInstantiation?: _StyleExpListStyle_BaseConfig;
14941
+ "()"?: (_StyleExpListStyle_BaseConfig | "off");
14942
+ "[]"?: (_StyleExpListStyle_BaseConfig | "off");
14943
+ "{}"?: (_StyleExpListStyle_BaseConfig | "off");
14944
+ "<>"?: (_StyleExpListStyle_BaseConfig | "off");
14945
+ ArrayExpression?: (_StyleExpListStyle_BaseConfig | "off");
14946
+ ArrayPattern?: (_StyleExpListStyle_BaseConfig | "off");
14947
+ ArrowFunctionExpression?: (_StyleExpListStyle_BaseConfig | "off");
14948
+ CallExpression?: (_StyleExpListStyle_BaseConfig | "off");
14949
+ ExportNamedDeclaration?: (_StyleExpListStyle_BaseConfig | "off");
14950
+ FunctionDeclaration?: (_StyleExpListStyle_BaseConfig | "off");
14951
+ FunctionExpression?: (_StyleExpListStyle_BaseConfig | "off");
14952
+ IfStatement?: (_StyleExpListStyle_BaseConfig | "off");
14953
+ ImportAttributes?: (_StyleExpListStyle_BaseConfig | "off");
14954
+ ImportDeclaration?: (_StyleExpListStyle_BaseConfig | "off");
14955
+ JSONArrayExpression?: (_StyleExpListStyle_BaseConfig | "off");
14956
+ JSONObjectExpression?: (_StyleExpListStyle_BaseConfig | "off");
14957
+ NewExpression?: (_StyleExpListStyle_BaseConfig | "off");
14958
+ ObjectExpression?: (_StyleExpListStyle_BaseConfig | "off");
14959
+ ObjectPattern?: (_StyleExpListStyle_BaseConfig | "off");
14960
+ TSDeclareFunction?: (_StyleExpListStyle_BaseConfig | "off");
14961
+ TSEnumBody?: (_StyleExpListStyle_BaseConfig | "off");
14962
+ TSFunctionType?: (_StyleExpListStyle_BaseConfig | "off");
14963
+ TSInterfaceBody?: (_StyleExpListStyle_BaseConfig | "off");
14964
+ TSTupleType?: (_StyleExpListStyle_BaseConfig | "off");
14965
+ TSTypeLiteral?: (_StyleExpListStyle_BaseConfig | "off");
14966
+ TSTypeParameterDeclaration?: (_StyleExpListStyle_BaseConfig | "off");
14967
+ TSTypeParameterInstantiation?: (_StyleExpListStyle_BaseConfig | "off");
14938
14968
  };
14939
14969
  }];
14940
14970
  interface _StyleExpListStyle_SingleLineConfig {
@@ -15805,6 +15835,7 @@ type StylePaddingLineBetweenStatements = {
15805
15835
  }[];
15806
15836
  interface _StylePaddingLineBetweenStatements_SelectorOption {
15807
15837
  selector: string;
15838
+ lineMode?: ("any" | "singleline" | "multiline");
15808
15839
  } // ----- style/quote-props -----
15809
15840
  type StyleQuoteProps = ([] | [("always" | "as-needed" | "consistent" | "consistent-as-needed")] | [] | [("always" | "as-needed" | "consistent" | "consistent-as-needed")] | [("always" | "as-needed" | "consistent" | "consistent-as-needed"), {
15810
15841
  keywords?: boolean;
@@ -16188,10 +16219,19 @@ type TomlCommaStyle = [] | [("first" | "last")] | [("first" | "last"), {
16188
16219
  type TomlIndent = [] | [("tab" | number)] | [("tab" | number), {
16189
16220
  subTables?: number;
16190
16221
  keyValuePairs?: number;
16191
- }]; // ----- toml/inline-table-curly-spacing -----
16222
+ }]; // ----- toml/inline-table-curly-newline -----
16223
+ type TomlInlineTableCurlyNewline = [] | [(("always" | "never") | {
16224
+ multiline?: boolean;
16225
+ minProperties?: number;
16226
+ consistent?: boolean;
16227
+ })]; // ----- toml/inline-table-curly-spacing -----
16192
16228
  type TomlInlineTableCurlySpacing = [] | [("always" | "never")] | [("always" | "never"), {
16193
16229
  arraysInObjects?: boolean;
16194
16230
  objectsInObjects?: boolean;
16231
+ emptyObjects?: ("ignore" | "always" | "never");
16232
+ }]; // ----- toml/inline-table-key-value-newline -----
16233
+ type TomlInlineTableKeyValueNewline = [] | [{
16234
+ allowAllPropertiesOnSameLine?: boolean;
16195
16235
  }]; // ----- toml/key-spacing -----
16196
16236
  type TomlKeySpacing = [] | [({
16197
16237
  align?: (("equal" | "value") | {
@@ -17039,6 +17079,18 @@ type TsPreferOptionalChain = [] | [{
17039
17079
  requireNullish?: boolean;
17040
17080
  }]; // ----- ts/prefer-promise-reject-errors -----
17041
17081
  type TsPreferPromiseRejectErrors = [] | [{
17082
+ allow?: (string | {
17083
+ from: "file";
17084
+ name: (string | [string, ...(string)[]]);
17085
+ path?: string;
17086
+ } | {
17087
+ from: "lib";
17088
+ name: (string | [string, ...(string)[]]);
17089
+ } | {
17090
+ from: "package";
17091
+ name: (string | [string, ...(string)[]]);
17092
+ package: string;
17093
+ })[];
17042
17094
  allowEmptyReject?: boolean;
17043
17095
  allowThrowingAny?: boolean;
17044
17096
  allowThrowingUnknown?: boolean;
@@ -18538,6 +18590,7 @@ type YamlFlowMappingCurlyNewline = [] | [(("always" | "never") | {
18538
18590
  type YamlFlowMappingCurlySpacing = [] | [("always" | "never")] | [("always" | "never"), {
18539
18591
  arraysInObjects?: boolean;
18540
18592
  objectsInObjects?: boolean;
18593
+ emptyObjects?: ("ignore" | "always" | "never");
18541
18594
  }]; // ----- yaml/flow-sequence-bracket-newline -----
18542
18595
  type YamlFlowSequenceBracketNewline = [] | [(("always" | "never" | "consistent") | {
18543
18596
  multiline?: boolean;
@@ -18708,7 +18761,7 @@ type Yoda = [] | [("always" | "never")] | [("always" | "never"), {
18708
18761
  exceptRange?: boolean;
18709
18762
  onlyEquality?: boolean;
18710
18763
  }]; // Names of all the configs
18711
- type ConfigNames = 'config/gitignore' | 'config/ignores' | 'config/javascript/setup' | 'config/javascript/rules' | 'config/eslint-comments/rules' | 'config/node/rules' | 'config/jsdoc/rules' | 'config/imports/rules' | 'config/command/rules' | 'config/perfectionist/setup' | 'config/node/rules' | 'config/jsdoc/rules' | 'config/imports/rules' | 'config/unicorn' | 'config/jsx/setup' | 'config/typescript/setup' | 'config/typescript/parser' | 'config/typescript/type-aware-parser' | 'config/typescript/rules' | 'config/typescript/rules-type-aware' | 'config/typescript/erasable-syntax-only' | 'config/stylistic/rules' | 'config/regexp/rules' | 'config/test/setup' | 'config/test/rules' | 'config/vue/setup' | 'config/vue/rules' | 'config/react/setup' | 'config/react/rules' | 'antfu/react/typescript' | 'config/react/type-aware-rules' | 'config/nextjs/setup' | 'config/nextjs/rules' | 'config/solid/setup' | 'config/solid/rules' | 'config/svelte/setup' | 'config/svelte/rules' | 'config/unocss/rules' | 'config/astro/setup' | 'config/astro/rules' | 'antfu/angular/setup' | 'antfu/angular/rules/ts' | 'antfu/angular/rules/template' | 'config/jsonc/setup' | 'config/jsonc/rules' | 'config/sort/package-json' | 'config/sort/tsconfig-json' | 'config/pnpm/package-json' | 'config/pnpm/pnpm-workspace-yaml' | 'config/pnpm/pnpm-workspace-yaml-sort' | 'config/yaml/setup' | 'config/yaml/rules' | 'config/toml/setup' | 'config/toml/rules' | 'config/markdown/setup' | 'config/markdown/processor' | 'config/markdown/parser' | 'config/markdown/disables' | 'config/formatters/setup' | 'config/formatter/css' | 'config/formatter/scss' | 'config/formatter/less' | 'config/formatter/html' | 'config/formatter/xml' | 'config/formatter/svg' | 'config/formatter/markdown' | 'config/formatter/astro' | 'config/formatter/astro/disables' | 'config/formatter/graphql' | 'config/disables/scripts' | 'config/disables/cli' | 'config/disables/bin' | 'config/disables/dts' | 'config/disables/cjs' | 'config/disables/config-files';
18764
+ type ConfigNames = 'config/gitignore' | 'config/ignores' | 'config/javascript/setup' | 'config/javascript/rules' | 'config/eslint-comments/rules' | 'config/node/setup' | 'config/node/rules' | 'config/jsdoc/setup' | 'config/jsdoc/rules' | 'config/imports/rules' | 'config/command/rules' | 'config/perfectionist/setup' | 'config/node/setup' | 'config/node/rules' | 'config/jsdoc/setup' | 'config/jsdoc/rules' | 'config/imports/rules' | 'config/unicorn' | 'config/jsx/setup' | 'config/typescript/setup' | 'config/typescript/parser' | 'config/typescript/type-aware-parser' | 'config/typescript/rules' | 'config/typescript/rules-type-aware' | 'config/typescript/erasable-syntax-only' | 'config/stylistic/rules' | 'config/regexp/rules' | 'config/test/setup' | 'config/test/rules' | 'config/vue/setup' | 'config/vue/rules' | 'config/react/setup' | 'config/react/rules' | 'antfu/react/typescript' | 'config/react/type-aware-rules' | 'config/nextjs/setup' | 'config/nextjs/rules' | 'config/solid/setup' | 'config/solid/rules' | 'config/svelte/setup' | 'config/svelte/rules' | 'config/unocss/rules' | 'config/astro/setup' | 'config/astro/rules' | 'antfu/angular/setup' | 'antfu/angular/rules/ts' | 'antfu/angular/rules/template' | 'config/jsonc/setup' | 'config/jsonc/rules' | 'config/sort/package-json' | 'config/sort/tsconfig-json' | 'config/pnpm/package-json' | 'config/pnpm/pnpm-workspace-yaml' | 'config/pnpm/pnpm-workspace-yaml-sort' | 'config/yaml/setup' | 'config/yaml/rules' | 'config/toml/setup' | 'config/toml/rules' | 'config/markdown/setup' | 'config/markdown/processor' | 'config/markdown/parser' | 'config/markdown/rules' | 'config/markdown/disables/markdown' | 'config/markdown/disables/code' | 'config/formatters/setup' | 'config/formatter/css' | 'config/formatter/scss' | 'config/formatter/less' | 'config/formatter/html' | 'config/formatter/xml' | 'config/formatter/svg' | 'config/formatter/markdown' | 'config/formatter/astro' | 'config/formatter/astro/disables' | 'config/formatter/graphql' | 'config/disables/scripts' | 'config/disables/cli' | 'config/disables/bin' | 'config/disables/dts' | 'config/disables/cjs' | 'config/disables/config-files';
18712
18765
  //#endregion
18713
18766
  //#region src/vender/prettier-types.d.ts
18714
18767
  /**
@@ -18959,6 +19012,29 @@ interface OptionsComponentExts {
18959
19012
  */
18960
19013
  componentExts?: string[];
18961
19014
  }
19015
+ interface OptionsE18e extends OptionsOverrides {
19016
+ /**
19017
+ * Include modernization rules
19018
+ *
19019
+ * @see https://github.com/e18e/eslint-plugin#modernization
19020
+ * @default true
19021
+ */
19022
+ modernization?: boolean;
19023
+ /**
19024
+ * Include module replacements rules
19025
+ *
19026
+ * @see https://github.com/e18e/eslint-plugin#module-replacements
19027
+ * @default type === 'lib' && isInEditor
19028
+ */
19029
+ moduleReplacements?: boolean;
19030
+ /**
19031
+ * Include performance improvements rules
19032
+ *
19033
+ * @see https://github.com/e18e/eslint-plugin#performance-improvements
19034
+ * @default true
19035
+ */
19036
+ performanceImprovements?: boolean;
19037
+ }
18962
19038
  interface OptionsUnicorn extends OptionsOverrides {
18963
19039
  /**
18964
19040
  * Include all rules recommended by `eslint-plugin-unicorn`, instead of only ones picked by Anthony.
@@ -18967,6 +19043,18 @@ interface OptionsUnicorn extends OptionsOverrides {
18967
19043
  */
18968
19044
  allRecommended?: boolean;
18969
19045
  }
19046
+ interface OptionsMarkdown extends OptionsOverrides {
19047
+ /**
19048
+ * Enable GFM (GitHub Flavored Markdown) support.
19049
+ *
19050
+ * @default true
19051
+ */
19052
+ gfm?: boolean;
19053
+ /**
19054
+ * Override rules for markdown itself.
19055
+ */
19056
+ overridesMarkdown?: TypedFlatConfigItem["rules"];
19057
+ }
18970
19058
  interface OptionsTypeScriptParserOptions {
18971
19059
  /**
18972
19060
  * Additional parser options for TypeScript.
@@ -19156,6 +19244,12 @@ interface OptionsConfig extends OptionsComponentExts, OptionsProjectType {
19156
19244
  */
19157
19245
  jsx?: boolean | OptionsJSX;
19158
19246
  /**
19247
+ * Options for [@e18e/eslint-plugin](https://github.com/e18e/eslint-plugin)
19248
+ *
19249
+ * @default true
19250
+ */
19251
+ e18e?: boolean | OptionsE18e;
19252
+ /**
19159
19253
  * Options for eslint-plugin-unicorn.
19160
19254
  *
19161
19255
  * @default true
@@ -19219,12 +19313,13 @@ interface OptionsConfig extends OptionsComponentExts, OptionsProjectType {
19219
19313
  */
19220
19314
  astro?: boolean | OptionsOverrides;
19221
19315
  /**
19222
- * Enable Markdown support.
19316
+ * Enable linting for **code snippets** in Markdown and the markdown content itself.
19223
19317
  *
19318
+ * For formatting Markdown content, enable also `formatters.markdown`.
19224
19319
  *
19225
19320
  * @default true
19226
19321
  */
19227
- markdown?: boolean;
19322
+ markdown?: boolean | OptionsMarkdown;
19228
19323
  /**
19229
19324
  * Enable stylistic rules.
19230
19325
  *
@@ -19378,6 +19473,9 @@ declare function comments(): Promise<TypedFlatConfigItem[]>;
19378
19473
  //#region src/configs/disables.d.ts
19379
19474
  declare function disables(): Promise<TypedFlatConfigItem[]>;
19380
19475
  //#endregion
19476
+ //#region src/configs/e18e.d.ts
19477
+ declare function e18e(options?: OptionsE18e & OptionsProjectType & OptionsIsInEditor): Promise<TypedFlatConfigItem[]>;
19478
+ //#endregion
19381
19479
  //#region src/configs/formatters.d.ts
19382
19480
  declare function formatters(options?: OptionsFormatters | true, stylistic?: StylisticConfig): Promise<TypedFlatConfigItem[]>;
19383
19481
  //#endregion
@@ -19400,7 +19498,7 @@ declare function jsonc(options?: OptionsFiles & OptionsStylistic & OptionsOverri
19400
19498
  declare function jsx(options?: OptionsJSX): Promise<TypedFlatConfigItem[]>;
19401
19499
  //#endregion
19402
19500
  //#region src/configs/markdown.d.ts
19403
- declare function markdown(options?: OptionsFiles & OptionsComponentExts & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
19501
+ declare function markdown(options?: OptionsFiles & OptionsComponentExts & OptionsMarkdown): Promise<TypedFlatConfigItem[]>;
19404
19502
  //#endregion
19405
19503
  //#region src/configs/nextjs.d.ts
19406
19504
  declare function nextjs(options?: OptionsOverrides & OptionsFiles): Promise<TypedFlatConfigItem[]>;
@@ -19557,4 +19655,4 @@ declare function ensurePackages(packages: string | undefined | (string | undefin
19557
19655
  declare function isInEditorEnv(): boolean;
19558
19656
  declare function isInGitHooksOrLintStaged(): boolean;
19559
19657
  //#endregion
19560
- export { Awaitable, CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON, type ConfigNames, EslintConfigOptions, EslintConfigReturn, 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, OptionsOverrides, OptionsPnpm, OptionsProjectType, OptionsReact, OptionsRegExp, OptionsStylistic, OptionsTailwindCSS, OptionsTypeScriptErasableOnly, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsUnicorn, OptionsUnoCSS, OptionsVue, ResolvedOptions, type RuleOptions, Rules, StylisticConfig, StylisticConfigDefaults, StylisticOptions, TypedFlatConfigItem, UserConfig, angular, astro, combine, command, comments, eslintFlatConfig as default, eslintFlatConfig, defaultPluginRenaming, disables, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, parserPlain, perfectionist, pluginAntfu, pluginComments, pluginImportLite, pluginNode, pluginPerfectionist, pluginUnicorn, pluginUnusedImports, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, stylistic, svelte, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
19658
+ export { Awaitable, CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON, type ConfigNames, EslintConfigOptions, EslintConfigReturn, 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, OptionsTailwindCSS, OptionsTypeScriptErasableOnly, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsUnicorn, OptionsUnoCSS, OptionsVue, ResolvedOptions, type RuleOptions, Rules, StylisticConfig, StylisticConfigDefaults, StylisticOptions, TypedFlatConfigItem, UserConfig, angular, astro, combine, command, comments, eslintFlatConfig as default, eslintFlatConfig, defaultPluginRenaming, disables, e18e, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, parserPlain, perfectionist, pluginAntfu, pluginComments, pluginE18e, pluginImportLite, pluginNode, pluginPerfectionist, pluginUnicorn, pluginUnusedImports, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, stylistic, svelte, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
package/dist/index.mjs CHANGED
@@ -6,6 +6,7 @@ import fs$1 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";
@@ -16,7 +17,6 @@ import pluginUnusedImports from "eslint-plugin-unused-imports";
16
17
  import globals from "globals";
17
18
  import { mergeProcessors, processorPassThrough } from "eslint-merge-processors";
18
19
  import { configs } from "eslint-plugin-regexp";
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)";
@@ -131,7 +130,6 @@ const GLOB_EXCLUDE = [
131
130
  "**/auto-import?(s).d.ts",
132
131
  "**/components.d.ts"
133
132
  ];
134
-
135
133
  //#endregion
136
134
  //#region src/utils.ts
137
135
  const scopeUrl = fileURLToPath(new URL(".", import.meta.url));
@@ -230,12 +228,11 @@ async function ensurePackages(packages) {
230
228
  function isInEditorEnv() {
231
229
  if (process.env.CI) return false;
232
230
  if (isInGitHooksOrLintStaged()) return false;
233
- return !!(process.env.VSCODE_PID || process.env.VSCODE_CWD || process.env.JETBRAINS_IDE || process.env.VIM || process.env.NVIM);
231
+ 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);
234
232
  }
235
233
  function isInGitHooksOrLintStaged() {
236
234
  return !!(process.env.GIT_PARAMS || process.env.VSCODE_GIT_COMMAND || process.env.npm_lifecycle_script?.startsWith("lint-staged"));
237
235
  }
238
-
239
236
  //#endregion
240
237
  //#region src/configs/angular.ts
241
238
  async function angular(options = {}) {
@@ -301,7 +298,6 @@ async function angular(options = {}) {
301
298
  }
302
299
  ];
303
300
  }
304
-
305
301
  //#endregion
306
302
  //#region src/configs/astro.ts
307
303
  async function astro(options = {}) {
@@ -349,7 +345,6 @@ async function astro(options = {}) {
349
345
  }
350
346
  }];
351
347
  }
352
-
353
348
  //#endregion
354
349
  //#region src/configs/command.ts
355
350
  async function command() {
@@ -358,7 +353,6 @@ async function command() {
358
353
  name: "config/command/rules"
359
354
  }];
360
355
  }
361
-
362
356
  //#endregion
363
357
  //#region src/configs/comments.ts
364
358
  async function comments() {
@@ -373,7 +367,6 @@ async function comments() {
373
367
  }
374
368
  }];
375
369
  }
376
-
377
370
  //#endregion
378
371
  //#region src/configs/disables.ts
379
372
  async function disables() {
@@ -428,7 +421,22 @@ async function disables() {
428
421
  }
429
422
  ];
430
423
  }
431
-
424
+ //#endregion
425
+ //#region src/configs/e18e.ts
426
+ async function e18e(options = {}) {
427
+ const { isInEditor = false, modernization = true, type = "app", moduleReplacements = type === "lib" && isInEditor, overrides = {}, performanceImprovements = true } = options;
428
+ const configs = pluginE18e.configs;
429
+ return [{
430
+ name: "config/e18e/rules",
431
+ plugins: { e18e: pluginE18e },
432
+ rules: {
433
+ ...modernization ? { ...configs.modernization.rules } : {},
434
+ ...moduleReplacements ? { ...configs.moduleReplacements.rules } : {},
435
+ ...performanceImprovements ? { ...configs.performanceImprovements.rules } : {},
436
+ ...overrides
437
+ }
438
+ }];
439
+ }
432
440
  //#endregion
433
441
  //#region src/configs/stylistic.ts
434
442
  const StylisticConfigDefaults = {
@@ -479,7 +487,6 @@ async function stylistic(options = {}) {
479
487
  }
480
488
  }];
481
489
  }
482
-
483
490
  //#endregion
484
491
  //#region src/configs/formatters.ts
485
492
  const formatPackages = ["eslint-plugin-format"];
@@ -525,11 +532,12 @@ async function formatters(options = {}, stylistic = {}) {
525
532
  xmlSortAttributesByKey: false,
526
533
  xmlWhitespaceSensitivity: "ignore"
527
534
  };
528
- const dprintOptions = Object.assign({
535
+ const dprintOptions = {
529
536
  indentWidth: typeof indent === "number" ? indent : 2,
530
537
  quoteStyle: quotes === "single" ? "preferSingle" : "preferDouble",
531
- useTabs: indent === "tab"
532
- }, options.dprintOptions || {});
538
+ useTabs: indent === "tab",
539
+ ...options.dprintOptions || {}
540
+ };
533
541
  const configs = [{
534
542
  name: "config/formatters/setup",
535
543
  plugins: { format: await interopDefault(import("eslint-plugin-format")) }
@@ -627,7 +635,6 @@ async function formatters(options = {}, stylistic = {}) {
627
635
  });
628
636
  return configs;
629
637
  }
630
-
631
638
  //#endregion
632
639
  //#region src/configs/ignores.ts
633
640
  async function ignores(userIgnores = [], ignoreTypeScript = false) {
@@ -640,7 +647,6 @@ async function ignores(userIgnores = [], ignoreTypeScript = false) {
640
647
  name: "config/ignores"
641
648
  }];
642
649
  }
643
-
644
650
  //#endregion
645
651
  //#region src/configs/imports.ts
646
652
  async function imports(_options = {}) {
@@ -654,7 +660,6 @@ async function imports(_options = {}) {
654
660
  }
655
661
  }];
656
662
  }
657
-
658
663
  //#endregion
659
664
  //#region src/configs/javascript.ts
660
665
  async function javascript(options = {}) {
@@ -879,15 +884,16 @@ async function javascript(options = {}) {
879
884
  }
880
885
  }];
881
886
  }
882
-
883
887
  //#endregion
884
888
  //#region src/configs/jsdoc.ts
885
889
  async function jsdoc(options = {}) {
886
890
  const { stylistic = true } = options;
887
891
  return [{
892
+ name: "config/jsdoc/setup",
893
+ plugins: { jsdoc: await interopDefault(import("eslint-plugin-jsdoc")) }
894
+ }, {
888
895
  files: [GLOB_SRC],
889
896
  name: "config/jsdoc/rules",
890
- plugins: { jsdoc: await interopDefault(import("eslint-plugin-jsdoc")) },
891
897
  rules: {
892
898
  "jsdoc/check-access": "warn",
893
899
  "jsdoc/check-param-names": "warn",
@@ -911,7 +917,6 @@ async function jsdoc(options = {}) {
911
917
  }
912
918
  }];
913
919
  }
914
-
915
920
  //#endregion
916
921
  //#region src/configs/jsonc.ts
917
922
  async function jsonc(options = {}) {
@@ -921,13 +926,12 @@ async function jsonc(options = {}) {
921
926
  GLOB_JSONC
922
927
  ], overrides = {}, stylistic = true } = options;
923
928
  const { indent = 2 } = typeof stylistic === "boolean" ? {} : stylistic;
924
- const [pluginJsonc, parserJsonc] = await Promise.all([interopDefault(import("eslint-plugin-jsonc")), interopDefault(import("jsonc-eslint-parser"))]);
925
929
  return [{
926
930
  name: "config/jsonc/setup",
927
- plugins: { jsonc: pluginJsonc }
931
+ plugins: { jsonc: await interopDefault(import("eslint-plugin-jsonc")) }
928
932
  }, {
929
933
  files,
930
- languageOptions: { parser: parserJsonc },
934
+ language: "jsonc/x",
931
935
  name: "config/jsonc/rules",
932
936
  rules: {
933
937
  "jsonc/no-bigint-literals": "error",
@@ -978,7 +982,6 @@ async function jsonc(options = {}) {
978
982
  }
979
983
  }];
980
984
  }
981
-
982
985
  //#endregion
983
986
  //#region src/configs/jsx.ts
984
987
  async function jsx(options = {}) {
@@ -1017,11 +1020,10 @@ async function jsx(options = {}) {
1017
1020
  }
1018
1021
  }];
1019
1022
  }
1020
-
1021
1023
  //#endregion
1022
1024
  //#region src/configs/markdown.ts
1023
1025
  async function markdown(options = {}) {
1024
- const { componentExts = [], files = [GLOB_MARKDOWN], overrides = {} } = options;
1026
+ const { componentExts = [], files = [GLOB_MARKDOWN], gfm = true, overrides = {}, overridesMarkdown = {} } = options;
1025
1027
  const markdown = await interopDefault(import("@eslint/markdown"));
1026
1028
  return [
1027
1029
  {
@@ -1035,13 +1037,37 @@ async function markdown(options = {}) {
1035
1037
  },
1036
1038
  {
1037
1039
  files,
1038
- languageOptions: { parser: parserPlain },
1040
+ language: gfm ? "markdown/gfm" : "markdown/commonmark",
1039
1041
  name: "config/markdown/parser"
1040
1042
  },
1043
+ {
1044
+ files,
1045
+ name: "config/markdown/rules",
1046
+ rules: {
1047
+ ...markdown.configs.recommended.at(0)?.rules,
1048
+ "markdown/no-missing-label-refs": "off",
1049
+ ...overridesMarkdown
1050
+ }
1051
+ },
1052
+ {
1053
+ files,
1054
+ name: "config/markdown/disables/markdown",
1055
+ rules: {
1056
+ "command/command": "off",
1057
+ "no-irregular-whitespace": "off",
1058
+ "perfectionist/sort-exports": "off",
1059
+ "perfectionist/sort-imports": "off",
1060
+ "regexp/no-legacy-features": "off",
1061
+ "regexp/no-missing-g-flag": "off",
1062
+ "regexp/no-useless-dollar-replacements": "off",
1063
+ "regexp/no-useless-flag": "off",
1064
+ "style/indent": "off"
1065
+ }
1066
+ },
1041
1067
  {
1042
1068
  files: [GLOB_MARKDOWN_CODE, ...componentExts.map((ext) => `${GLOB_MARKDOWN}/**/*.${ext}`)],
1043
1069
  languageOptions: { parserOptions: { ecmaFeatures: { impliedStrict: true } } },
1044
- name: "config/markdown/disables",
1070
+ name: "config/markdown/disables/code",
1045
1071
  rules: {
1046
1072
  "antfu/no-top-level-await": "off",
1047
1073
  "no-alert": "off",
@@ -1073,7 +1099,6 @@ async function markdown(options = {}) {
1073
1099
  }
1074
1100
  ];
1075
1101
  }
1076
-
1077
1102
  //#endregion
1078
1103
  //#region src/configs/nextjs.ts
1079
1104
  function normalizeRules(rules) {
@@ -1106,14 +1131,15 @@ async function nextjs(options = {}) {
1106
1131
  settings: { react: { version: "detect" } }
1107
1132
  }];
1108
1133
  }
1109
-
1110
1134
  //#endregion
1111
1135
  //#region src/configs/node.ts
1112
1136
  async function node() {
1113
1137
  return [{
1138
+ name: "config/node/setup",
1139
+ plugins: { node: pluginNode }
1140
+ }, {
1114
1141
  files: [GLOB_SRC],
1115
1142
  name: "config/node/rules",
1116
- plugins: { node: pluginNode },
1117
1143
  rules: {
1118
1144
  "node/handle-callback-err": ["error", "^(err|error)$"],
1119
1145
  "node/no-deprecated-api": "error",
@@ -1126,7 +1152,6 @@ async function node() {
1126
1152
  }
1127
1153
  }];
1128
1154
  }
1129
-
1130
1155
  //#endregion
1131
1156
  //#region src/configs/perfectionist.ts
1132
1157
  /**
@@ -1186,7 +1211,6 @@ async function perfectionist() {
1186
1211
  }
1187
1212
  }];
1188
1213
  }
1189
-
1190
1214
  //#endregion
1191
1215
  //#region src/configs/pnpm.ts
1192
1216
  async function detectCatalogUsage() {
@@ -1196,17 +1220,16 @@ async function detectCatalogUsage() {
1196
1220
  return yaml.includes("catalog:") || yaml.includes("catalogs:");
1197
1221
  }
1198
1222
  async function pnpm(options) {
1199
- const [pluginPnpm, pluginYaml, yamlParser, jsoncParser] = await Promise.all([
1223
+ const [pluginPnpm, pluginYaml, yamlParser] = await Promise.all([
1200
1224
  interopDefault(import("eslint-plugin-pnpm")),
1201
1225
  interopDefault(import("eslint-plugin-yml")),
1202
- interopDefault(import("yaml-eslint-parser")),
1203
- interopDefault(import("jsonc-eslint-parser"))
1226
+ interopDefault(import("yaml-eslint-parser"))
1204
1227
  ]);
1205
1228
  const { catalogs = await detectCatalogUsage(), isInEditor = false, json = true, sort = true, yaml = true } = options;
1206
1229
  const configs = [];
1207
1230
  if (json) configs.push({
1208
1231
  files: ["package.json", "**/package.json"],
1209
- languageOptions: { parser: jsoncParser },
1232
+ language: "jsonc/x",
1210
1233
  name: "config/pnpm/package-json",
1211
1234
  plugins: { pnpm: pluginPnpm },
1212
1235
  rules: {
@@ -1314,7 +1337,6 @@ async function pnpm(options) {
1314
1337
  }
1315
1338
  return configs;
1316
1339
  }
1317
-
1318
1340
  //#endregion
1319
1341
  //#region src/configs/react.ts
1320
1342
  const ReactRefreshAllowConstantExportPackages = ["vite"];
@@ -1501,7 +1523,6 @@ async function react(options = {}) {
1501
1523
  }] : []
1502
1524
  ];
1503
1525
  }
1504
-
1505
1526
  //#endregion
1506
1527
  //#region src/configs/regexp.ts
1507
1528
  async function regexp(options = {}) {
@@ -1519,7 +1540,6 @@ async function regexp(options = {}) {
1519
1540
  }
1520
1541
  }];
1521
1542
  }
1522
-
1523
1543
  //#endregion
1524
1544
  //#region src/configs/solid.ts
1525
1545
  async function solid(options = {}) {
@@ -1574,7 +1594,6 @@ async function solid(options = {}) {
1574
1594
  }
1575
1595
  }];
1576
1596
  }
1577
-
1578
1597
  //#endregion
1579
1598
  //#region src/configs/sort.ts
1580
1599
  /**
@@ -1808,7 +1827,6 @@ function sortTsconfig() {
1808
1827
  ] }
1809
1828
  }];
1810
1829
  }
1811
-
1812
1830
  //#endregion
1813
1831
  //#region src/configs/svelte.ts
1814
1832
  async function svelte(options = {}) {
@@ -1884,7 +1902,6 @@ async function svelte(options = {}) {
1884
1902
  }
1885
1903
  }];
1886
1904
  }
1887
-
1888
1905
  //#endregion
1889
1906
  //#region src/configs/tailwindcss.ts
1890
1907
  const tailwindPackages = ["eslint-plugin-tailwindcss"];
@@ -1919,7 +1936,6 @@ async function tailwindcss(options = {}) {
1919
1936
  }
1920
1937
  }];
1921
1938
  }
1922
-
1923
1939
  //#endregion
1924
1940
  //#region src/configs/test.ts
1925
1941
  let _pluginTest;
@@ -1950,6 +1966,7 @@ async function test(options = {}) {
1950
1966
  "test/prefer-hooks-in-order": "error",
1951
1967
  "test/prefer-lowercase-title": "error",
1952
1968
  "antfu/no-top-level-await": "off",
1969
+ "e18e/prefer-static-regex": "off",
1953
1970
  "no-unused-expressions": "off",
1954
1971
  "node/prefer-global/process": "off",
1955
1972
  "ts/explicit-function-return-type": "off",
@@ -1957,7 +1974,6 @@ async function test(options = {}) {
1957
1974
  }
1958
1975
  }];
1959
1976
  }
1960
-
1961
1977
  //#endregion
1962
1978
  //#region src/configs/toml.ts
1963
1979
  async function toml(options = {}) {
@@ -1998,18 +2014,17 @@ async function toml(options = {}) {
1998
2014
  }
1999
2015
  }];
2000
2016
  }
2001
-
2002
2017
  //#endregion
2003
2018
  //#region src/configs/typescript.ts
2004
2019
  async function typescript(options = {}) {
2005
2020
  const { componentExts = [], erasableOnly = false, overrides = {}, overridesTypeAware = {}, parserOptions = {}, type = "app" } = options;
2006
2021
  const files = options.files ?? [
2007
- GLOB_TS,
2008
- GLOB_TSX,
2022
+ "**/*.?([cm])ts",
2023
+ "**/*.?([cm])tsx",
2009
2024
  ...componentExts.map((ext) => `**/*.${ext}`)
2010
2025
  ];
2011
- const filesTypeAware = options.filesTypeAware ?? [GLOB_TS, GLOB_TSX];
2012
- const ignoresTypeAware = options.ignoresTypeAware ?? [`${GLOB_MARKDOWN}/**`, GLOB_ASTRO_TS];
2026
+ const filesTypeAware = options.filesTypeAware ?? ["**/*.?([cm])ts", "**/*.?([cm])tsx"];
2027
+ const ignoresTypeAware = options.ignoresTypeAware ?? [`**/*.md/**`, "**/*.astro/*.ts"];
2013
2028
  const tsconfigPath = options?.tsconfigPath ? options.tsconfigPath : void 0;
2014
2029
  const isTypeAware = !!tsconfigPath;
2015
2030
  const typeAwareRules = {
@@ -2142,7 +2157,6 @@ async function typescript(options = {}) {
2142
2157
  }] : []
2143
2158
  ];
2144
2159
  }
2145
-
2146
2160
  //#endregion
2147
2161
  //#region src/configs/unicorn.ts
2148
2162
  async function unicorn(options = {}) {
@@ -2172,7 +2186,6 @@ async function unicorn(options = {}) {
2172
2186
  }
2173
2187
  }];
2174
2188
  }
2175
-
2176
2189
  //#endregion
2177
2190
  //#region src/configs/unocss.ts
2178
2191
  async function unocss(options = {}) {
@@ -2189,7 +2202,6 @@ async function unocss(options = {}) {
2189
2202
  }
2190
2203
  }];
2191
2204
  }
2192
-
2193
2205
  //#endregion
2194
2206
  //#region src/configs/vue.ts
2195
2207
  async function vue(options = {}) {
@@ -2398,7 +2410,6 @@ async function vue(options = {}) {
2398
2410
  }
2399
2411
  }];
2400
2412
  }
2401
-
2402
2413
  //#endregion
2403
2414
  //#region src/configs/yaml.ts
2404
2415
  async function yaml(options = {}) {
@@ -2441,7 +2452,6 @@ async function yaml(options = {}) {
2441
2452
  }
2442
2453
  }];
2443
2454
  }
2444
-
2445
2455
  //#endregion
2446
2456
  //#region src/factory.ts
2447
2457
  const flatConfigProps = [
@@ -2482,7 +2492,7 @@ const defaultPluginRenaming = {
2482
2492
  * The merged ESLint configurations.
2483
2493
  */
2484
2494
  function eslintFlatConfig(options = {}, ...userConfigs) {
2485
- const { angular: enableAngular = false, 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, svelte: enableSvelte = false, solid: enableSolid = false, typescript: enableTypeScript = isPackageExists("typescript"), unicorn: enableUnicorn = true, unocss: enableUnoCSS = false, tailwindcss: enableTailwindcss = false, vue: enableVue = VuePackages.some((i) => isPackageExists(i)) } = options;
2495
+ const { angular: enableAngular = false, astro: enableAstro = false, autoRenamePlugins = true, componentExts = [], e18e: enableE18e = false, 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, svelte: enableSvelte = false, solid: enableSolid = false, type: appType = "app", typescript: enableTypeScript = isPackageExists("typescript") || isPackageExists("@typescript/native-preview"), unicorn: enableUnicorn = true, unocss: enableUnoCSS = false, tailwindcss: enableTailwindcss = false, vue: enableVue = VuePackages.some((i) => isPackageExists(i)) } = options;
2486
2496
  let isInEditor = options.isInEditor;
2487
2497
  if (isInEditor == null) {
2488
2498
  isInEditor = isInEditorEnv();
@@ -2511,6 +2521,10 @@ function eslintFlatConfig(options = {}, ...userConfigs) {
2511
2521
  stylistic: stylisticOptions,
2512
2522
  ...resolveSubOptions(options, "imports")
2513
2523
  }));
2524
+ if (enableE18e) configs.push(e18e({
2525
+ isInEditor,
2526
+ ...enableE18e === true ? {} : enableE18e
2527
+ }));
2514
2528
  if (enableUnicorn) configs.push(unicorn(enableUnicorn === true ? {} : enableUnicorn));
2515
2529
  if (enableVue) componentExts.push("vue");
2516
2530
  if (enableJsx) configs.push(jsx(enableJsx === true ? {} : enableJsx));
@@ -2518,7 +2532,7 @@ function eslintFlatConfig(options = {}, ...userConfigs) {
2518
2532
  ...typescriptOptions,
2519
2533
  componentExts,
2520
2534
  overrides: getOverrides(options, "typescript"),
2521
- type: options.type
2535
+ type: appType
2522
2536
  }));
2523
2537
  if (stylisticOptions) configs.push(stylistic({
2524
2538
  ...stylisticOptions,
@@ -2616,7 +2630,6 @@ function getOverrides(options, key) {
2616
2630
  const sub = resolveSubOptions(options, key);
2617
2631
  return { ..."overrides" in sub ? sub.overrides : {} };
2618
2632
  }
2619
-
2620
2633
  //#endregion
2621
2634
  //#region src/config-presets.ts
2622
2635
  const CONFIG_PRESET_FULL_ON = {
@@ -2674,10 +2687,8 @@ const CONFIG_PRESET_FULL_OFF = {
2674
2687
  vue: false,
2675
2688
  yaml: false
2676
2689
  };
2677
-
2678
2690
  //#endregion
2679
2691
  //#region src/index.ts
2680
2692
  var src_default = eslintFlatConfig;
2681
-
2682
2693
  //#endregion
2683
- export { CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_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, StylisticConfigDefaults, angular, astro, combine, command, comments, src_default as default, defaultPluginRenaming, disables, ensurePackages, eslintFlatConfig, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, parserPlain, perfectionist, pluginAntfu, pluginComments, pluginImportLite, pluginNode, pluginPerfectionist, pluginUnicorn, pluginUnusedImports, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, stylistic, svelte, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
2694
+ export { CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_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, StylisticConfigDefaults, angular, astro, combine, command, comments, src_default as default, defaultPluginRenaming, disables, e18e, ensurePackages, eslintFlatConfig, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, parserPlain, perfectionist, pluginAntfu, pluginComments, pluginE18e, pluginImportLite, pluginNode, pluginPerfectionist, pluginUnicorn, pluginUnusedImports, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, stylistic, svelte, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pengzhanbo/eslint-config",
3
3
  "type": "module",
4
- "version": "2.0.1",
4
+ "version": "2.2.0",
5
5
  "author": "pengzhanbo <q942450674@outlook.com> (https://github/pengzhanbo/)",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/pengzhanbo/configs#readme",
@@ -22,28 +22,28 @@
22
22
  "dist"
23
23
  ],
24
24
  "peerDependencies": {
25
- "@angular-eslint/eslint-plugin": "^21.2.0",
26
- "@angular-eslint/eslint-plugin-template": "^21.2.0",
27
- "@angular-eslint/template-parser": "^21.2.0",
25
+ "@angular-eslint/eslint-plugin": "^21.3.0",
26
+ "@angular-eslint/eslint-plugin-template": "^21.3.0",
27
+ "@angular-eslint/template-parser": "^21.3.0",
28
28
  "@eslint-react/eslint-plugin": "^2.13.0",
29
29
  "@next/eslint-plugin-next": "^16.1.6",
30
30
  "@prettier/plugin-xml": "^3.4.2",
31
- "@unocss/eslint-plugin": "^66.6.0",
31
+ "@unocss/eslint-plugin": "^66.6.6",
32
32
  "astro-eslint-parser": "^1.3.0",
33
- "eslint": "^10.0.1",
33
+ "eslint": "^10.0.3",
34
34
  "eslint-plugin-astro": "^1.6.0",
35
- "eslint-plugin-format": "^1.4.0",
35
+ "eslint-plugin-format": "^2.0.1",
36
36
  "eslint-plugin-react-hooks": "^7.0.1",
37
- "eslint-plugin-react-refresh": "^0.5.0",
37
+ "eslint-plugin-react-refresh": "^0.5.2",
38
38
  "eslint-plugin-solid": "^0.14.5",
39
- "eslint-plugin-svelte": "^3.15.0",
39
+ "eslint-plugin-svelte": "^3.15.2",
40
40
  "eslint-plugin-tailwindcss": "^3.18.2",
41
41
  "eslint-plugin-vue": "^10.8.0",
42
42
  "eslint-plugin-vuejs-accessibility": "^2.4.1",
43
43
  "eslint-processor-vue-blocks": "^2.0.0",
44
44
  "prettier-plugin-astro": "^0.14.1",
45
45
  "prettier-plugin-slidev": "^1.0.5",
46
- "svelte-eslint-parser": "^1.4.1",
46
+ "svelte-eslint-parser": "^1.6.0",
47
47
  "vue-eslint-parser": "^10.4.0"
48
48
  },
49
49
  "peerDependenciesMeta": {
@@ -113,56 +113,56 @@
113
113
  },
114
114
  "dependencies": {
115
115
  "@antfu/install-pkg": "^1.1.0",
116
- "@eslint-community/eslint-plugin-eslint-comments": "^4.6.0",
116
+ "@e18e/eslint-plugin": "^0.2.0",
117
+ "@eslint-community/eslint-plugin-eslint-comments": "^4.7.1",
117
118
  "@eslint/markdown": "^7.5.1",
118
- "@stylistic/eslint-plugin": "^5.9.0",
119
- "@typescript-eslint/eslint-plugin": "^8.56.0",
120
- "@typescript-eslint/parser": "^8.56.0",
121
- "@vitest/eslint-plugin": "^1.6.9",
119
+ "@stylistic/eslint-plugin": "^5.10.0",
120
+ "@typescript-eslint/eslint-plugin": "^8.57.0",
121
+ "@typescript-eslint/parser": "^8.57.0",
122
+ "@vitest/eslint-plugin": "^1.6.11",
122
123
  "eslint-config-flat-gitignore": "^2.2.1",
123
- "eslint-flat-config-utils": "^3.0.1",
124
+ "eslint-flat-config-utils": "^3.0.2",
124
125
  "eslint-merge-processors": "^2.0.0",
125
126
  "eslint-plugin-antfu": "^3.2.2",
126
- "eslint-plugin-command": "^3.4.0",
127
+ "eslint-plugin-command": "^3.5.2",
127
128
  "eslint-plugin-erasable-syntax-only": "^0.4.0",
128
- "eslint-plugin-import-lite": "^0.5.1",
129
- "eslint-plugin-jsdoc": "^62.7.0",
130
- "eslint-plugin-jsonc": "^3.0.0",
129
+ "eslint-plugin-import-lite": "^0.5.2",
130
+ "eslint-plugin-jsdoc": "^62.8.0",
131
+ "eslint-plugin-jsonc": "^3.1.2",
131
132
  "eslint-plugin-jsx-a11y": "^6.10.2",
132
133
  "eslint-plugin-n": "^17.24.0",
133
134
  "eslint-plugin-no-only-tests": "^3.3.0",
134
135
  "eslint-plugin-perfectionist": "^5.6.0",
135
- "eslint-plugin-pnpm": "^1.5.0",
136
- "eslint-plugin-regexp": "^3.0.0",
137
- "eslint-plugin-toml": "^1.1.1",
136
+ "eslint-plugin-pnpm": "^1.6.0",
137
+ "eslint-plugin-regexp": "^3.1.0",
138
+ "eslint-plugin-toml": "^1.3.1",
138
139
  "eslint-plugin-unicorn": "^63.0.0",
139
140
  "eslint-plugin-unused-imports": "^4.4.1",
140
- "eslint-plugin-yml": "^3.2.1",
141
- "globals": "^17.3.0",
142
- "jsonc-eslint-parser": "^3.1.0",
141
+ "eslint-plugin-yml": "^3.3.1",
142
+ "globals": "^17.4.0",
143
143
  "local-pkg": "^1.1.2",
144
144
  "parse-gitignore": "^2.0.0",
145
145
  "toml-eslint-parser": "^1.0.3",
146
146
  "yaml-eslint-parser": "^2.0.0"
147
147
  },
148
148
  "devDependencies": {
149
- "@angular-eslint/eslint-plugin": "^21.2.0",
150
- "@angular-eslint/eslint-plugin-template": "^21.2.0",
151
- "@angular-eslint/template-parser": "^21.2.0",
152
- "@angular/core": "^21.1.5",
149
+ "@angular-eslint/eslint-plugin": "^21.3.0",
150
+ "@angular-eslint/eslint-plugin-template": "^21.3.0",
151
+ "@angular-eslint/template-parser": "^21.3.0",
152
+ "@angular/core": "^21.2.4",
153
153
  "@eslint-react/eslint-plugin": "^2.13.0",
154
- "@eslint/config-inspector": "^1.4.2",
154
+ "@eslint/config-inspector": "^1.5.0",
155
155
  "@next/eslint-plugin-next": "^16.1.6",
156
156
  "@prettier/plugin-xml": "^3.4.2",
157
- "@unocss/eslint-plugin": "^66.6.0",
157
+ "@unocss/eslint-plugin": "^66.6.6",
158
158
  "astro-eslint-parser": "^1.3.0",
159
- "eslint": "^10.0.1",
159
+ "eslint": "^10.0.3",
160
160
  "eslint-plugin-astro": "^1.6.0",
161
- "eslint-plugin-format": "^1.4.0",
161
+ "eslint-plugin-format": "^2.0.1",
162
162
  "eslint-plugin-react-hooks": "^7.0.1",
163
- "eslint-plugin-react-refresh": "^0.5.0",
163
+ "eslint-plugin-react-refresh": "^0.5.2",
164
164
  "eslint-plugin-solid": "^0.14.5",
165
- "eslint-plugin-svelte": "^3.15.0",
165
+ "eslint-plugin-svelte": "^3.15.2",
166
166
  "eslint-plugin-tailwindcss": "^3.18.2",
167
167
  "eslint-plugin-vue": "^10.8.0",
168
168
  "eslint-plugin-vuejs-accessibility": "^2.5.0",
@@ -171,10 +171,13 @@
171
171
  "find-up-simple": "^1.0.1",
172
172
  "prettier-plugin-astro": "^0.14.1",
173
173
  "prettier-plugin-slidev": "^1.0.5",
174
- "svelte": "^5.53.2",
175
- "svelte-eslint-parser": "^1.4.1",
174
+ "svelte": "^5.53.11",
175
+ "svelte-eslint-parser": "^1.6.0",
176
176
  "vue-eslint-parser": "^10.4.0"
177
177
  },
178
+ "inlinedDependencies": {
179
+ "find-up-simple": "1.0.1"
180
+ },
178
181
  "publishConfig": {
179
182
  "access": "public",
180
183
  "provenance": true