@eienjs/eslint-config 1.5.1 → 1.6.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/bin/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import '../dist/cli/index.js';
3
+ import '../dist/cli/index.mjs';
@@ -62,12 +62,12 @@ const extraOptions = [{
62
62
  }];
63
63
  const extra = extraOptions.map(({ value }) => value);
64
64
  const dependenciesMap = {
65
+ adonisjs: ["@adonisjs/eslint-plugin"],
65
66
  astro: ["eslint-plugin-astro", "astro-eslint-parser"],
66
67
  formatter: ["eslint-plugin-format"],
67
68
  formatterAstro: ["prettier-plugin-astro"],
68
- vue: [],
69
- adonisjs: ["@adonisjs/eslint-plugin"],
70
- nuxt: ["@nuxt/eslint-plugin"]
69
+ nuxt: ["@nuxt/eslint-plugin"],
70
+ vue: []
71
71
  };
72
72
 
73
73
  //#endregion
@@ -1,7 +1,7 @@
1
1
  //#region src/cli/constants_generated.ts
2
2
  const versionsMap = {
3
3
  "@adonisjs/eslint-plugin": "^2.0.1",
4
- "@nuxt/eslint-plugin": "^1.10.0",
4
+ "@nuxt/eslint-plugin": "^1.11.0",
5
5
  "astro-eslint-parser": "^1.2.2",
6
6
  "eslint": "^9.39.1",
7
7
  "eslint-plugin-astro": "^1.5.0",
package/dist/cli/run.mjs CHANGED
@@ -26,11 +26,14 @@ async function run(options = {}) {
26
26
  };
27
27
  if (!argSkipPrompt) {
28
28
  result = await p.group({
29
- uncommittedConfirmed: async () => {
30
- if (isGitClean()) return true;
31
- return p.confirm({
32
- initialValue: false,
33
- message: "There are uncommitted changes in the current repository, are you sure to continue?"
29
+ extra: async ({ results }) => {
30
+ const isArgExtraValid = argExtra?.length && argExtra.filter((element) => !extra.includes(element)).length === 0;
31
+ if (!results.uncommittedConfirmed || isArgExtraValid) return;
32
+ const message = argExtra ? `"${argExtra.toString()}" isn't a valid extra util. Please choose from below: ` : "Select a extra utils:";
33
+ return p.multiselect({
34
+ message: c.reset(message),
35
+ options: extraOptions,
36
+ required: false
34
37
  });
35
38
  },
36
39
  frameworks: async ({ results }) => {
@@ -43,14 +46,11 @@ async function run(options = {}) {
43
46
  required: false
44
47
  });
45
48
  },
46
- extra: async ({ results }) => {
47
- const isArgExtraValid = argExtra?.length && argExtra.filter((element) => !extra.includes(element)).length === 0;
48
- if (!results.uncommittedConfirmed || isArgExtraValid) return;
49
- const message = argExtra ? `"${argExtra.toString()}" isn't a valid extra util. Please choose from below: ` : "Select a extra utils:";
50
- return p.multiselect({
51
- message: c.reset(message),
52
- options: extraOptions,
53
- required: false
49
+ uncommittedConfirmed: async () => {
50
+ if (isGitClean()) return true;
51
+ return p.confirm({
52
+ initialValue: false,
53
+ message: "There are uncommitted changes in the current repository, are you sure to continue?"
54
54
  });
55
55
  },
56
56
  updateVscodeSettings: async ({ results }) => {
@@ -4,7 +4,7 @@ import { join } from "pathe";
4
4
 
5
5
  //#region src/configs/adonisjs.ts
6
6
  async function adonisjs(options = {}) {
7
- const { overrides = {}, dirs = {} } = options;
7
+ const { dirs = {}, overrides = {} } = options;
8
8
  await ensurePackages(["@adonisjs/eslint-plugin"]);
9
9
  const pluginAdonisJS = await interopDefault(import("@adonisjs/eslint-plugin"));
10
10
  dirs.root = dirs.root || ".";
@@ -30,11 +30,11 @@ async function adonisjs(options = {}) {
30
30
  const nestedGlobPattern = `**/*.${GLOB_SRC_EXT}`;
31
31
  const fileRoutes = [...Object.values(dirs).map((dir) => join(dir, nestedGlobPattern)), `${dirs.root}/ace.js`];
32
32
  const commonRulesSet = {
33
- "@typescript-eslint/require-await": "off",
34
33
  "@typescript-eslint/explicit-function-return-type": "off",
35
34
  "@typescript-eslint/explicit-module-boundary-types": "off",
36
35
  "@typescript-eslint/no-floating-promises": "off",
37
36
  "@typescript-eslint/no-unsafe-return": "off",
37
+ "@typescript-eslint/require-await": "off",
38
38
  "unicorn/no-anonymous-default-export": "off"
39
39
  };
40
40
  return [
@@ -103,12 +103,12 @@ async function adonisjs(options = {}) {
103
103
  files: [join(dirs.tests, nestedGlobPattern)],
104
104
  name: "eienjs/adonisjs/tests-disables",
105
105
  rules: {
106
- "@typescript-eslint/unbound-method": "off",
107
106
  "@typescript-eslint/explicit-function-return-type": "off",
108
107
  "@typescript-eslint/explicit-module-boundary-types": "off",
109
- "@typescript-eslint/no-unsafe-assignment": "off",
110
108
  "@typescript-eslint/no-explicit-any": "off",
111
- "@typescript-eslint/no-unsafe-return": "off"
109
+ "@typescript-eslint/no-unsafe-assignment": "off",
110
+ "@typescript-eslint/no-unsafe-return": "off",
111
+ "@typescript-eslint/unbound-method": "off"
112
112
  }
113
113
  }
114
114
  ];
@@ -7,20 +7,20 @@ function disables() {
7
7
  files: [`**/scripts/${GLOB_SRC}`],
8
8
  name: "eienjs/disables/scripts",
9
9
  rules: {
10
- "antfu/no-top-level-await": "off",
11
- "no-console": "off",
12
10
  "@typescript-eslint/explicit-function-return-type": "off",
13
- "@typescript-eslint/no-deprecated": "off"
11
+ "@typescript-eslint/no-deprecated": "off",
12
+ "antfu/no-top-level-await": "off",
13
+ "no-console": "off"
14
14
  }
15
15
  },
16
16
  {
17
17
  files: [`**/cli/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
18
18
  name: "eienjs/disables/cli",
19
19
  rules: {
20
+ "@typescript-eslint/no-unnecessary-condition": "off",
20
21
  "antfu/no-top-level-await": "off",
21
22
  "no-console": "off",
22
- "unicorn/no-process-exit": "off",
23
- "@typescript-eslint/no-unnecessary-condition": "off"
23
+ "unicorn/no-process-exit": "off"
24
24
  }
25
25
  },
26
26
  {
@@ -49,9 +49,9 @@ function disables() {
49
49
  files: [`**/*.config.${GLOB_SRC_EXT}`, `**/*.config.*.${GLOB_SRC_EXT}`],
50
50
  name: "eienjs/disables/config-files",
51
51
  rules: {
52
+ "@typescript-eslint/explicit-function-return-type": "off",
52
53
  "antfu/no-top-level-await": "off",
53
- "no-console": "off",
54
- "@typescript-eslint/explicit-function-return-type": "off"
54
+ "no-console": "off"
55
55
  }
56
56
  },
57
57
  {
@@ -65,8 +65,8 @@ function javascript(options = {}) {
65
65
  "info",
66
66
  "table"
67
67
  ] }],
68
- "no-constant-binary-expression": "error",
69
68
  "no-const-assign": "error",
69
+ "no-constant-binary-expression": "error",
70
70
  "no-control-regex": "error",
71
71
  "no-debugger": "error",
72
72
  "no-delete-var": "error",
@@ -31,22 +31,10 @@ async function markdown(options = {}) {
31
31
  languageOptions: { parserOptions: { ecmaFeatures: { impliedStrict: true } } },
32
32
  name: "eienjs/markdown/disables",
33
33
  rules: {
34
- "antfu/no-top-level-await": "off",
35
- "no-alert": "off",
36
- "no-console": "off",
37
- "no-labels": "off",
38
- "no-lone-blocks": "off",
39
- "no-restricted-syntax": "off",
40
- "no-undef": "off",
41
- "no-unused-expressions": "off",
42
- "no-unused-labels": "off",
43
- "no-unused-vars": "off",
44
- "unicode-bom": "off",
45
- "n/prefer-global/process": "off",
46
34
  "@stylistic/comma-dangle": "off",
47
35
  "@stylistic/eol-last": "off",
48
- "@stylistic/padding-line-between-statements": "off",
49
36
  "@stylistic/max-len": "off",
37
+ "@stylistic/padding-line-between-statements": "off",
50
38
  "@typescript-eslint/consistent-type-imports": "off",
51
39
  "@typescript-eslint/explicit-function-return-type": "off",
52
40
  "@typescript-eslint/no-namespace": "off",
@@ -55,6 +43,18 @@ async function markdown(options = {}) {
55
43
  "@typescript-eslint/no-unused-expressions": "off",
56
44
  "@typescript-eslint/no-unused-vars": "off",
57
45
  "@typescript-eslint/no-use-before-define": "off",
46
+ "antfu/no-top-level-await": "off",
47
+ "n/prefer-global/process": "off",
48
+ "no-alert": "off",
49
+ "no-console": "off",
50
+ "no-labels": "off",
51
+ "no-lone-blocks": "off",
52
+ "no-restricted-syntax": "off",
53
+ "no-undef": "off",
54
+ "no-unused-expressions": "off",
55
+ "no-unused-labels": "off",
56
+ "no-unused-vars": "off",
57
+ "unicode-bom": "off",
58
58
  "unused-imports/no-unused-imports": "off",
59
59
  "unused-imports/no-unused-vars": "off",
60
60
  ...overrides
@@ -4,7 +4,7 @@ import { join } from "pathe";
4
4
 
5
5
  //#region src/configs/nuxt.ts
6
6
  async function nuxt(options = {}) {
7
- const { overrides = {}, dirs = {}, version = 4, stylistic = true } = options;
7
+ const { dirs = {}, overrides = {}, stylistic = true, version = 4 } = options;
8
8
  const { sortConfigKeys = Boolean(stylistic) } = options;
9
9
  await ensurePackages(["@nuxt/eslint-plugin"]);
10
10
  const pluginNuxt = await interopDefault(import("@nuxt/eslint-plugin"));
@@ -67,9 +67,9 @@ async function nuxt(options = {}) {
67
67
  ];
68
68
  return [
69
69
  {
70
+ languageOptions: { globals: { $fetch: "readonly" } },
70
71
  name: "eienjs/nuxt/setup",
71
- plugins: { nuxt: pluginNuxt },
72
- languageOptions: { globals: { $fetch: "readonly" } }
72
+ plugins: { nuxt: pluginNuxt }
73
73
  },
74
74
  ...fileSingleRoot.length > 0 ? [{
75
75
  files: fileSingleRoot,
@@ -98,7 +98,7 @@ async function nuxt(options = {}) {
98
98
  name: "eienjs/nuxt/vue/rules",
99
99
  rules: {
100
100
  "vue/multiline-html-element-content-newline": ["error", {
101
- ignoreWhenEmpty: true,
101
+ allowEmptyLines: false,
102
102
  ignores: [
103
103
  "pre",
104
104
  "textarea",
@@ -110,11 +110,10 @@ async function nuxt(options = {}) {
110
110
  "ULink",
111
111
  ...INLINE_ELEMENTS
112
112
  ],
113
- allowEmptyLines: false
113
+ ignoreWhenEmpty: true
114
114
  }],
115
115
  "vue/singleline-html-element-content-newline": ["error", {
116
- ignoreWhenNoAttributes: true,
117
- ignoreWhenEmpty: true,
116
+ externalIgnores: [],
118
117
  ignores: [
119
118
  "pre",
120
119
  "textarea",
@@ -126,7 +125,8 @@ async function nuxt(options = {}) {
126
125
  "ULink",
127
126
  ...INLINE_ELEMENTS
128
127
  ],
129
- externalIgnores: []
128
+ ignoreWhenEmpty: true,
129
+ ignoreWhenNoAttributes: true
130
130
  }]
131
131
  }
132
132
  }] : []
@@ -1,6 +1,6 @@
1
- import { TypedFlatConfigItem } from "../types.mjs";
1
+ import { OptionsIsInEditor, TypedFlatConfigItem } from "../types.mjs";
2
2
 
3
3
  //#region src/configs/pnpm.d.ts
4
- declare function pnpm(): Promise<TypedFlatConfigItem[]>;
4
+ declare function pnpm(options: OptionsIsInEditor): Promise<TypedFlatConfigItem[]>;
5
5
  //#endregion
6
6
  export { pnpm };
@@ -1,7 +1,7 @@
1
1
  import { interopDefault } from "../utils.mjs";
2
2
 
3
3
  //#region src/configs/pnpm.ts
4
- async function pnpm() {
4
+ async function pnpm(options) {
5
5
  const [pluginPnpm, yamlParser, jsoncParser] = await Promise.all([
6
6
  interopDefault(import("eslint-plugin-pnpm")),
7
7
  interopDefault(import("yaml-eslint-parser")),
@@ -13,9 +13,9 @@ async function pnpm() {
13
13
  name: "eienjs/pnpm/package-json",
14
14
  plugins: { pnpm: pluginPnpm },
15
15
  rules: {
16
- "pnpm/json-enforce-catalog": "error",
17
- "pnpm/json-prefer-workspace-settings": "error",
18
- "pnpm/json-valid-catalog": "error"
16
+ "pnpm/json-enforce-catalog": ["error", { autofix: !options.isInEditor }],
17
+ "pnpm/json-prefer-workspace-settings": ["error", { autofix: !options.isInEditor }],
18
+ "pnpm/json-valid-catalog": ["error", { autofix: !options.isInEditor }]
19
19
  }
20
20
  }, {
21
21
  files: ["pnpm-workspace.yaml"],
@@ -7,7 +7,7 @@ const StylisticConfigDefaults = {
7
7
  quotes: "single"
8
8
  };
9
9
  async function stylistic(options = {}) {
10
- const { indent, overrides = {}, quotes, maxLineLength = 120 } = {
10
+ const { indent, maxLineLength = 120, overrides = {}, quotes } = {
11
11
  ...StylisticConfigDefaults,
12
12
  ...options
13
13
  };
@@ -20,19 +20,23 @@ async function stylistic(options = {}) {
20
20
  return [{
21
21
  name: "eienjs/stylistic/rules",
22
22
  plugins: {
23
- "antfu": pluginAntfu,
24
- "@stylistic": pluginStylistic
23
+ "@stylistic": pluginStylistic,
24
+ "antfu": pluginAntfu
25
25
  },
26
26
  rules: {
27
27
  ...config.rules,
28
- "antfu/consistent-chaining": "error",
29
- "antfu/consistent-list-newline": "error",
30
28
  "@stylistic/arrow-parens": ["error", "always"],
31
29
  "@stylistic/brace-style": [
32
30
  "error",
33
31
  "1tbs",
34
32
  { allowSingleLine: true }
35
33
  ],
34
+ "@stylistic/comma-spacing": "error",
35
+ "@stylistic/generator-star-spacing": ["error", {
36
+ after: true,
37
+ before: false
38
+ }],
39
+ "@stylistic/lines-between-class-members": ["error", "always"],
36
40
  "@stylistic/max-len": ["warn", {
37
41
  code: maxLineLength,
38
42
  ignoreComments: true
@@ -41,8 +45,8 @@ async function stylistic(options = {}) {
41
45
  "error",
42
46
  {
43
47
  blankLine: "always",
44
- prev: "*",
45
- next: ["interface", "type"]
48
+ next: ["interface", "type"],
49
+ prev: "*"
46
50
  },
47
51
  {
48
52
  blankLine: "always",
@@ -50,11 +54,6 @@ async function stylistic(options = {}) {
50
54
  prev: "*"
51
55
  }
52
56
  ],
53
- "@stylistic/lines-between-class-members": ["error", "always"],
54
- "@stylistic/generator-star-spacing": ["error", {
55
- after: true,
56
- before: false
57
- }],
58
57
  "@stylistic/quote-props": ["error", "consistent"],
59
58
  "@stylistic/quotes": [
60
59
  "error",
@@ -62,11 +61,12 @@ async function stylistic(options = {}) {
62
61
  { avoidEscape: true }
63
62
  ],
64
63
  "@stylistic/semi": "error",
65
- "@stylistic/comma-spacing": "error",
66
64
  "@stylistic/yield-star-spacing": ["error", {
67
65
  after: true,
68
66
  before: false
69
67
  }],
68
+ "antfu/consistent-chaining": "error",
69
+ "antfu/consistent-list-newline": "error",
70
70
  ...overrides
71
71
  }
72
72
  }];
@@ -20,6 +20,10 @@ async function test(options = {}) {
20
20
  files,
21
21
  name: "eienjs/test/rules",
22
22
  rules: {
23
+ "@typescript-eslint/explicit-function-return-type": "off",
24
+ "antfu/no-top-level-await": "off",
25
+ "n/prefer-global/process": "off",
26
+ "no-unused-expressions": "off",
23
27
  "test/consistent-test-it": ["error", {
24
28
  fn: "test",
25
29
  withinDescribe: "test"
@@ -29,10 +33,6 @@ async function test(options = {}) {
29
33
  "test/no-only-tests": isInEditor ? "warn" : "error",
30
34
  "test/prefer-hooks-in-order": "error",
31
35
  "test/prefer-lowercase-title": "error",
32
- "antfu/no-top-level-await": "off",
33
- "no-unused-expressions": "off",
34
- "n/prefer-global/process": "off",
35
- "@typescript-eslint/explicit-function-return-type": "off",
36
36
  ...overrides
37
37
  }
38
38
  }];
@@ -5,7 +5,7 @@ import process from "node:process";
5
5
 
6
6
  //#region src/configs/typescript.ts
7
7
  async function typescript(options = {}) {
8
- const { componentExts = [], overrides = {}, overridesTypeAware = {}, parserOptions = {}, stylistic = true, erasableSyntaxOnly = false } = options;
8
+ const { componentExts = [], erasableSyntaxOnly = false, overrides = {}, overridesTypeAware = {}, parserOptions = {}, stylistic = true } = options;
9
9
  const files = options.files ?? [
10
10
  GLOB_TS,
11
11
  GLOB_TSX,
@@ -18,8 +18,6 @@ async function typescript(options = {}) {
18
18
  const isTypeAware = Boolean(tsconfigPath);
19
19
  const isErasableSyntaxOnly = Boolean(erasableSyntaxOnly);
20
20
  const typeAwareRules = {
21
- "dot-notation": "off",
22
- "no-implied-eval": "off",
23
21
  "@typescript-eslint/await-thenable": "error",
24
22
  "@typescript-eslint/consistent-type-exports": ["error", { fixMixedExportsWithInlineTypeSpecifier: true }],
25
23
  "@typescript-eslint/dot-notation": ["error", { allowKeywords: true }],
@@ -69,13 +67,13 @@ async function typescript(options = {}) {
69
67
  selector: "interface"
70
68
  },
71
69
  {
72
- selector: "variable",
73
70
  format: [
74
71
  "camelCase",
75
72
  "UPPER_CASE",
76
73
  "PascalCase"
77
74
  ],
78
- leadingUnderscore: "allow"
75
+ leadingUnderscore: "allow",
76
+ selector: "variable"
79
77
  }
80
78
  ],
81
79
  "@typescript-eslint/no-floating-promises": "error",
@@ -88,6 +86,15 @@ async function typescript(options = {}) {
88
86
  "@typescript-eslint/no-unsafe-call": "error",
89
87
  "@typescript-eslint/no-unsafe-member-access": "error",
90
88
  "@typescript-eslint/no-unsafe-return": "error",
89
+ "@typescript-eslint/no-unused-vars": ["error", {
90
+ "args": "all",
91
+ "argsIgnorePattern": "^_",
92
+ "caughtErrors": "all",
93
+ "caughtErrorsIgnorePattern": "^_",
94
+ "destructuredArrayIgnorePattern": "^_",
95
+ "ignoreRestSiblings": true,
96
+ "varsIgnorePattern": "^_"
97
+ }],
91
98
  "@typescript-eslint/prefer-nullish-coalescing": ["error", { ignorePrimitives: { string: true } }],
92
99
  "@typescript-eslint/prefer-optional-chain": "error",
93
100
  "@typescript-eslint/prefer-string-starts-ends-with": "error",
@@ -96,15 +103,8 @@ async function typescript(options = {}) {
96
103
  "@typescript-eslint/restrict-template-expressions": "error",
97
104
  "@typescript-eslint/return-await": ["error", "in-try-catch"],
98
105
  "@typescript-eslint/switch-exhaustiveness-check": ["error", { considerDefaultExhaustiveForUnions: true }],
99
- "@typescript-eslint/no-unused-vars": ["error", {
100
- "args": "all",
101
- "argsIgnorePattern": "^_",
102
- "caughtErrors": "all",
103
- "caughtErrorsIgnorePattern": "^_",
104
- "destructuredArrayIgnorePattern": "^_",
105
- "varsIgnorePattern": "^_",
106
- "ignoreRestSiblings": true
107
- }]
106
+ "dot-notation": "off",
107
+ "no-implied-eval": "off"
108
108
  };
109
109
  const [pluginTs, parserTs] = await Promise.all([interopDefault(import("@typescript-eslint/eslint-plugin")), interopDefault(import("@typescript-eslint/parser"))]);
110
110
  function makeParser(typeAware, files$1, ignores) {
@@ -132,8 +132,8 @@ async function typescript(options = {}) {
132
132
  const rules = [{
133
133
  name: "eienjs/typescript/setup",
134
134
  plugins: {
135
- "antfu": pluginAntfu,
136
- "@typescript-eslint": pluginTs
135
+ "@typescript-eslint": pluginTs,
136
+ "antfu": pluginAntfu
137
137
  }
138
138
  }];
139
139
  if (isTypeAware) rules.push(makeParser(false, files), makeParser(true, filesTypeAware, ignoresTypeAware));
@@ -145,10 +145,6 @@ async function typescript(options = {}) {
145
145
  ...pluginTs.configs["eslint-recommended"].overrides?.[0].rules,
146
146
  ...pluginTs.configs.strict.rules,
147
147
  ...stylistic ? pluginTs.configs.stylistic.rules : {},
148
- "no-dupe-class-members": "off",
149
- "no-redeclare": "off",
150
- "no-use-before-define": "off",
151
- "no-useless-constructor": "off",
152
148
  "@typescript-eslint/ban-ts-comment": ["error", { "ts-expect-error": "allow-with-description" }],
153
149
  "@typescript-eslint/consistent-type-assertions": "error",
154
150
  "@typescript-eslint/consistent-type-definitions": ["error", "interface"],
@@ -177,8 +173,8 @@ async function typescript(options = {}) {
177
173
  "caughtErrors": "all",
178
174
  "caughtErrorsIgnorePattern": "^_",
179
175
  "destructuredArrayIgnorePattern": "^_",
180
- "varsIgnorePattern": "^_",
181
- "ignoreRestSiblings": true
176
+ "ignoreRestSiblings": true,
177
+ "varsIgnorePattern": "^_"
182
178
  }],
183
179
  "@typescript-eslint/no-use-before-define": ["error", {
184
180
  classes: false,
@@ -189,6 +185,10 @@ async function typescript(options = {}) {
189
185
  "@typescript-eslint/no-wrapper-object-types": "error",
190
186
  "@typescript-eslint/triple-slash-reference": "off",
191
187
  "@typescript-eslint/unified-signatures": "off",
188
+ "no-dupe-class-members": "off",
189
+ "no-redeclare": "off",
190
+ "no-use-before-define": "off",
191
+ "no-useless-constructor": "off",
192
192
  ...overrides
193
193
  }
194
194
  });
@@ -9,26 +9,26 @@ function unicorn(options = {}) {
9
9
  plugins: { unicorn: pluginUnicorn },
10
10
  rules: {
11
11
  ...pluginUnicorn.configs.recommended.rules,
12
- "unicorn/no-this-assignment": "off",
13
12
  "unicorn/consistent-destructuring": "error",
14
13
  "unicorn/consistent-function-scoping": ["error", { checkArrowFunctions: false }],
14
+ "unicorn/expiring-todo-comments": "off",
15
+ "unicorn/filename-case": "off",
16
+ "unicorn/no-array-reduce": "off",
15
17
  "unicorn/no-null": "off",
16
18
  "unicorn/no-static-only-class": "off",
19
+ "unicorn/no-thenable": "off",
20
+ "unicorn/no-this-assignment": "off",
17
21
  "unicorn/numeric-separators-style": "off",
18
22
  "unicorn/prefer-dom-node-append": "off",
19
23
  "unicorn/prefer-dom-node-dataset": "off",
20
24
  "unicorn/prefer-dom-node-remove": "off",
21
25
  "unicorn/prefer-dom-node-text-content": "off",
26
+ "unicorn/prefer-export-from": "off",
22
27
  "unicorn/prefer-modern-dom-apis": "off",
23
28
  "unicorn/prefer-query-selector": "off",
24
29
  "unicorn/prefer-switch": ["error", { emptyDefaultCase: "do-nothing-comment" }],
25
- "unicorn/prevent-abbreviations": "off",
26
- "unicorn/no-thenable": "off",
27
- "unicorn/expiring-todo-comments": "off",
28
- "unicorn/no-array-reduce": "off",
29
- "unicorn/prefer-export-from": "off",
30
30
  "unicorn/prefer-top-level-await": "off",
31
- "unicorn/filename-case": "off",
31
+ "unicorn/prevent-abbreviations": "off",
32
32
  ...overrides
33
33
  }
34
34
  }, {
@@ -4,7 +4,7 @@ import { mergeProcessors } from "eslint-merge-processors";
4
4
 
5
5
  //#region src/configs/vue.ts
6
6
  async function vue(options = {}) {
7
- const { files = [GLOB_VUE], overrides = {}, stylistic = true, typescript, componentNameInTemplateCasingOnlyRegistered = false, componentNameInTemplateCasingIgnores = [], componentNameInTemplateCasingGlobals = [] } = options;
7
+ const { componentNameInTemplateCasingGlobals = [], componentNameInTemplateCasingIgnores = [], componentNameInTemplateCasingOnlyRegistered = false, files = [GLOB_VUE], overrides = {}, stylistic = true, typescript } = options;
8
8
  const sfcBlocks = options.sfcBlocks === true ? {} : options.sfcBlocks ?? {};
9
9
  const { indent = 2 } = typeof stylistic === "boolean" ? {} : stylistic;
10
10
  const [pluginVue, parserVue, processorVueBlocks] = await Promise.all([
@@ -77,9 +77,9 @@ async function vue(options = {}) {
77
77
  "error",
78
78
  "PascalCase",
79
79
  {
80
- registeredComponentsOnly: componentNameInTemplateCasingOnlyRegistered,
80
+ globals: componentNameInTemplateCasingGlobals,
81
81
  ignores: componentNameInTemplateCasingIgnores,
82
- globals: componentNameInTemplateCasingGlobals
82
+ registeredComponentsOnly: componentNameInTemplateCasingOnlyRegistered
83
83
  }
84
84
  ],
85
85
  "vue/component-options-name-casing": ["error", "PascalCase"],
@@ -186,11 +186,11 @@ async function vue(options = {}) {
186
186
  "vue/space-in-parens": ["error", "never"],
187
187
  "vue/template-curly-spacing": "error"
188
188
  } : {},
189
- "antfu/no-top-level-await": "off",
190
- "n/prefer-global/process": "off",
189
+ "@stylistic/max-len": "off",
191
190
  "@typescript-eslint/explicit-function-return-type": "off",
192
191
  "@typescript-eslint/naming-convention": "off",
193
- "@stylistic/max-len": "off",
192
+ "antfu/no-top-level-await": "off",
193
+ "n/prefer-global/process": "off",
194
194
  ...overrides
195
195
  }
196
196
  },
@@ -50,23 +50,66 @@ async function yaml(options = {}) {
50
50
  "error",
51
51
  {
52
52
  order: [
53
+ ...[
54
+ "cacheDir",
55
+ "catalogMode",
56
+ "cleanupUnusedCatalogs",
57
+ "dedupeDirectDeps",
58
+ "deployAllFiles",
59
+ "enablePrePostScripts",
60
+ "engineStrict",
61
+ "extendNodePath",
62
+ "hoist",
63
+ "hoistPattern",
64
+ "hoistWorkspacePackages",
65
+ "ignoreCompatibilityDb",
66
+ "ignoreDepScripts",
67
+ "ignoreScripts",
68
+ "ignoreWorkspaceRootCheck",
69
+ "managePackageManagerVersions",
70
+ "minimumReleaseAge",
71
+ "minimumReleaseAgeExclude",
72
+ "modulesDir",
73
+ "nodeLinker",
74
+ "nodeVersion",
75
+ "optimisticRepeatInstall",
76
+ "packageManagerStrict",
77
+ "packageManagerStrictVersion",
78
+ "preferSymlinkedExecutables",
79
+ "preferWorkspacePackages",
80
+ "publicHoistPattern",
81
+ "registrySupportsTimeField",
82
+ "requiredScrpts",
83
+ "resolutionMode",
84
+ "savePrefix",
85
+ "scriptShell",
86
+ "shamefullyHoist",
87
+ "shellEmulator",
88
+ "stateDir",
89
+ "supportedArchitectures",
90
+ "symlink",
91
+ "tag",
92
+ "trustPolicy",
93
+ "trustPolicyExclude",
94
+ "updateNotifier"
95
+ ],
53
96
  "packages",
54
97
  "overrides",
55
98
  "patchedDependencies",
56
- "hoistPattern",
57
99
  "catalog",
58
100
  "catalogs",
59
- "allowedDeprecatedVersions",
60
- "allowNonAppliedPatches",
61
- "configDependencies",
62
- "ignoredBuiltDependencies",
63
- "ignoredOptionalDependencies",
64
- "neverBuiltDependencies",
65
- "onlyBuiltDependencies",
66
- "onlyBuiltDependenciesFile",
67
- "packageExtensions",
68
- "peerDependencyRules",
69
- "supportedArchitectures"
101
+ ...[
102
+ "allowedDeprecatedVersions",
103
+ "allowNonAppliedPatches",
104
+ "configDependencies",
105
+ "ignoredBuiltDependencies",
106
+ "ignoredOptionalDependencies",
107
+ "neverBuiltDependencies",
108
+ "onlyBuiltDependencies",
109
+ "onlyBuiltDependenciesFile",
110
+ "packageExtensions",
111
+ "peerDependencyRules"
112
+ ]
70
113
  ],
71
114
  pathPattern: "^$"
72
115
  },
@@ -9,7 +9,7 @@ declare const defaultPluginRenaming: {
9
9
  vitest: string;
10
10
  yml: string;
11
11
  };
12
- declare function eienjs(options?: OptionsConfig & Omit<TypedFlatConfigItem, 'files'>): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
12
+ declare function eienjs(options?: OptionsConfig & Omit<TypedFlatConfigItem, 'files' | 'ignores'>): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
13
13
  type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
14
14
  declare function resolveSubOptions<K extends keyof OptionsConfig>(options: OptionsConfig, key: K): ResolvedOptions<OptionsConfig[K]>;
15
15
  declare function getOverrides(options: OptionsConfig, key: keyof OptionsConfig): Partial<Linter.RulesRecord & RuleOptions>;
package/dist/factory.mjs CHANGED
@@ -50,7 +50,7 @@ const defaultPluginRenaming = {
50
50
  "yml": "yaml"
51
51
  };
52
52
  function eienjs(options = {}) {
53
- const { astro: enableAstro = false, componentExts = [], gitignore: enableGitignore = true, ignores: userIgnores = [], imports: enableImports = true, pnpm: enableCatalogs = false, regexp: enableRegexp = true, typescript: enableTypeScript = isPackageExists("typescript"), unicorn: enableUnicorn = true, vue: enableVue = VuePackages.some((i) => isPackageExists(i)), adonisjs: enableAdonisjs = false, nuxt: enableNuxt = false } = options;
53
+ const { adonisjs: enableAdonisjs = false, astro: enableAstro = false, componentExts = [], gitignore: enableGitignore = true, ignores: userIgnores = [], imports: enableImports = true, nuxt: enableNuxt = false, pnpm: enableCatalogs = false, regexp: enableRegexp = true, typescript: enableTypeScript = isPackageExists("typescript"), unicorn: enableUnicorn = true, vue: enableVue = VuePackages.some((i) => isPackageExists(i)) } = options;
54
54
  let { isInEditor } = options;
55
55
  if (isInEditor == null) {
56
56
  isInEditor = isInEditorEnv();
@@ -80,8 +80,8 @@ function eienjs(options = {}) {
80
80
  if (enableTypeScript) configs.push(typescript({
81
81
  ...typescriptOptions,
82
82
  componentExts,
83
- stylistic: stylisticOptions,
84
- overrides: getOverrides(options, "typescript")
83
+ overrides: getOverrides(options, "typescript"),
84
+ stylistic: stylisticOptions
85
85
  }));
86
86
  if (stylisticOptions) configs.push(stylistic({
87
87
  ...stylisticOptions,
@@ -115,7 +115,7 @@ function eienjs(options = {}) {
115
115
  overrides: getOverrides(options, "jsonc"),
116
116
  stylistic: stylisticOptions
117
117
  }), sortPackageJson(), sortTsconfig());
118
- if (enableCatalogs) configs.push(pnpm());
118
+ if (enableCatalogs) configs.push(pnpm({ isInEditor }));
119
119
  if (options.yaml ?? true) configs.push(yaml({
120
120
  overrides: getOverrides(options, "yaml"),
121
121
  stylistic: stylisticOptions
package/dist/package.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "1.5.1";
2
+ var version = "1.6.0";
3
3
 
4
4
  //#endregion
5
5
  export { version };
@@ -983,6 +983,11 @@ interface RuleOptions {
983
983
  * @see https://typescript-eslint.io/rules/no-unused-expressions
984
984
  */
985
985
  '@typescript-eslint/no-unused-expressions'?: Linter.RuleEntry<TypescriptEslintNoUnusedExpressions>;
986
+ /**
987
+ * Disallow unused private class members
988
+ * @see https://typescript-eslint.io/rules/no-unused-private-class-members
989
+ */
990
+ '@typescript-eslint/no-unused-private-class-members'?: Linter.RuleEntry<[]>;
986
991
  /**
987
992
  * Disallow unused variables
988
993
  * @see https://typescript-eslint.io/rules/no-unused-vars
@@ -2134,6 +2139,11 @@ interface RuleOptions {
2134
2139
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-property-type.md#repos-sticky-header
2135
2140
  */
2136
2141
  'jsdoc/require-property-type'?: Linter.RuleEntry<[]>;
2142
+ /**
2143
+ * Requires that Promise rejections are documented with `@rejects` tags.
2144
+ * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-rejects.md#repos-sticky-header
2145
+ */
2146
+ 'jsdoc/require-rejects'?: Linter.RuleEntry<JsdocRequireRejects>;
2137
2147
  /**
2138
2148
  * Requires that returns are documented with `@returns`.
2139
2149
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-returns.md#repos-sticky-header
@@ -4552,6 +4562,11 @@ interface RuleOptions {
4552
4562
  * @deprecated
4553
4563
  */
4554
4564
  'template-tag-spacing'?: Linter.RuleEntry<TemplateTagSpacing>;
4565
+ /**
4566
+ * enforce using `.each` or `.for` consistently
4567
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-each-for.md
4568
+ */
4569
+ 'test/consistent-each-for'?: Linter.RuleEntry<TestConsistentEachFor>;
4555
4570
  /**
4556
4571
  * require test file pattern
4557
4572
  * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-test-filename.md
@@ -4774,7 +4789,7 @@ interface RuleOptions {
4774
4789
  */
4775
4790
  'test/prefer-each'?: Linter.RuleEntry<[]>;
4776
4791
  /**
4777
- * enforce using the built-in quality matchers
4792
+ * enforce using the built-in equality matchers
4778
4793
  * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-equality-matcher.md
4779
4794
  */
4780
4795
  'test/prefer-equality-matcher'?: Linter.RuleEntry<[]>;
@@ -4893,6 +4908,11 @@ interface RuleOptions {
4893
4908
  * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-hook.md
4894
4909
  */
4895
4910
  'test/require-hook'?: Linter.RuleEntry<TestRequireHook>;
4911
+ /**
4912
+ * require usage of import in vi.mock()
4913
+ * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-import-vi-mock.md
4914
+ */
4915
+ 'test/require-import-vi-mock'?: Linter.RuleEntry<[]>;
4896
4916
  /**
4897
4917
  * require local Test Context for concurrent snapshot tests
4898
4918
  * @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-local-test-context-for-concurrent-snapshots.md
@@ -6257,6 +6277,11 @@ interface RuleOptions {
6257
6277
  * @see https://eslint.vuejs.org/rules/no-duplicate-attributes.html
6258
6278
  */
6259
6279
  'vue/no-duplicate-attributes'?: Linter.RuleEntry<VueNoDuplicateAttributes>;
6280
+ /**
6281
+ * disallow duplication of class names in class attributes
6282
+ * @see https://eslint.vuejs.org/rules/no-duplicate-class-names.html
6283
+ */
6284
+ 'vue/no-duplicate-class-names'?: Linter.RuleEntry<[]>;
6260
6285
  /**
6261
6286
  * disallow the `<template>` `<script>` `<style>` block to be empty
6262
6287
  * @see https://eslint.vuejs.org/rules/no-empty-component-block.html
@@ -9807,6 +9832,7 @@ type JsdocCheckExamples = [] | [{
9807
9832
  }];
9808
9833
  // ----- jsdoc/check-indentation -----
9809
9834
  type JsdocCheckIndentation = [] | [{
9835
+ allowIndentedSections?: boolean;
9810
9836
  excludeTags?: string[];
9811
9837
  }];
9812
9838
  // ----- jsdoc/check-line-alignment -----
@@ -10153,6 +10179,14 @@ type JsdocRequireParamType = [] | [{
10153
10179
  defaultDestructuredRootType?: string;
10154
10180
  setDefaultDestructuredRootType?: boolean;
10155
10181
  }];
10182
+ // ----- jsdoc/require-rejects -----
10183
+ type JsdocRequireRejects = [] | [{
10184
+ contexts?: (string | {
10185
+ comment?: string;
10186
+ context?: string;
10187
+ })[];
10188
+ exemptedBy?: string[];
10189
+ }];
10156
10190
  // ----- jsdoc/require-returns -----
10157
10191
  type JsdocRequireReturns = [] | [{
10158
10192
  checkConstructors?: boolean;
@@ -13939,6 +13973,13 @@ type SwitchColonSpacing = [] | [{
13939
13973
  type TemplateCurlySpacing = [] | [("always" | "never")];
13940
13974
  // ----- template-tag-spacing -----
13941
13975
  type TemplateTagSpacing = [] | [("always" | "never")];
13976
+ // ----- test/consistent-each-for -----
13977
+ type TestConsistentEachFor = [] | [{
13978
+ test?: ("each" | "for");
13979
+ it?: ("each" | "for");
13980
+ describe?: ("each" | "for");
13981
+ suite?: ("each" | "for");
13982
+ }];
13942
13983
  // ----- test/consistent-test-filename -----
13943
13984
  type TestConsistentTestFilename = [] | [{
13944
13985
  pattern?: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@eienjs/eslint-config",
3
3
  "type": "module",
4
- "version": "1.5.1",
4
+ "version": "1.6.0",
5
5
  "description": "EienJS ESLint Config",
6
6
  "author": "Fernando Isidro <luffynando@gmail.com> (https://github.com/luffynando/)",
7
7
  "license": "MIT",
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@adonisjs/eslint-plugin": "^2.0.1",
40
- "@nuxt/eslint-plugin": "^1.10.0",
40
+ "@nuxt/eslint-plugin": "^1.11.0",
41
41
  "@prettier/plugin-xml": "^3.4.2",
42
42
  "astro-eslint-parser": "^1.2.2",
43
43
  "eslint": "^9.39.1",
@@ -77,10 +77,10 @@
77
77
  "@clack/prompts": "^0.11.0",
78
78
  "@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
79
79
  "@eslint/markdown": "^7.5.1",
80
- "@stylistic/eslint-plugin": "^5.5.0",
81
- "@typescript-eslint/eslint-plugin": "^8.46.4",
82
- "@typescript-eslint/parser": "^8.46.4",
83
- "@vitest/eslint-plugin": "^1.4.3",
80
+ "@stylistic/eslint-plugin": "^5.6.1",
81
+ "@typescript-eslint/eslint-plugin": "^8.48.1",
82
+ "@typescript-eslint/parser": "^8.48.1",
83
+ "@vitest/eslint-plugin": "^1.5.1",
84
84
  "ansis": "^4.2.0",
85
85
  "cac": "^6.7.14",
86
86
  "eslint-config-flat-gitignore": "^2.1.0",
@@ -89,7 +89,7 @@
89
89
  "eslint-plugin-antfu": "^3.1.1",
90
90
  "eslint-plugin-command": "^3.3.1",
91
91
  "eslint-plugin-import-lite": "^0.3.0",
92
- "eslint-plugin-jsdoc": "^61.2.1",
92
+ "eslint-plugin-jsdoc": "^61.4.1",
93
93
  "eslint-plugin-jsonc": "^2.21.0",
94
94
  "eslint-plugin-n": "^17.23.1",
95
95
  "eslint-plugin-no-only-tests": "^3.3.0",
@@ -99,7 +99,7 @@
99
99
  "eslint-plugin-toml": "^0.12.0",
100
100
  "eslint-plugin-unicorn": "^62.0.0",
101
101
  "eslint-plugin-unused-imports": "^4.3.0",
102
- "eslint-plugin-vue": "^10.5.1",
102
+ "eslint-plugin-vue": "^10.6.2",
103
103
  "eslint-plugin-yml": "^1.19.0",
104
104
  "eslint-processor-vue-blocks": "^2.0.0",
105
105
  "globals": "^16.5.0",
@@ -109,14 +109,14 @@
109
109
  "pathe": "^2.0.3",
110
110
  "toml-eslint-parser": "^0.10.0",
111
111
  "vue-eslint-parser": "^10.2.0",
112
- "yaml-eslint-parser": "^1.3.0"
112
+ "yaml-eslint-parser": "^1.3.2"
113
113
  },
114
114
  "devDependencies": {
115
115
  "@adonisjs/eslint-plugin": "^2.0.1",
116
116
  "@commitlint/cli": "^20.1.0",
117
117
  "@commitlint/config-conventional": "^20.0.0",
118
- "@eslint/config-inspector": "^1.3.0",
119
- "@nuxt/eslint-plugin": "^1.10.0",
118
+ "@eslint/config-inspector": "^1.4.2",
119
+ "@nuxt/eslint-plugin": "^1.11.0",
120
120
  "@prettier/plugin-xml": "^3.4.2",
121
121
  "@types/node": "^24.10.1",
122
122
  "astro-eslint-parser": "^1.2.2",
@@ -129,8 +129,8 @@
129
129
  "husky": "^9.1.7",
130
130
  "np": "^10.2.0",
131
131
  "prettier-plugin-astro": "^0.14.1",
132
- "tsdown": "^0.16.4",
133
- "tsx": "^4.20.6",
132
+ "tsdown": "^0.16.8",
133
+ "tsx": "^4.21.0",
134
134
  "typescript": "^5.9.3"
135
135
  },
136
136
  "resolutions": {