@dhzh/eslint-config 0.6.2 → 0.8.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/README.md CHANGED
@@ -10,8 +10,13 @@ Differences from [@antfu/eslint-config](./README-antfu.md):
10
10
  2. Always arrow parens: `arrowParens: true`.
11
11
  3. Explicitly use `1tbs` as brace style: `braceStyle: '1tbs'`.
12
12
  4. Disabled antfu's top level function rule: `'antfu/top-level-function': 'off'`.
13
- 5. Always curly: `'curly': ['error', 'all']`.
13
+ 5. Always curly:
14
+
15
+ - `'antfu/curly': 'off'`
16
+ - `'curly': ['error', 'all']`
17
+
14
18
  6. This eslint-config will enable `ts/consistent-type-imports` rule. But it will cause [compile issue](https://github.com/typescript-eslint/typescript-eslint/issues/2559) in [nest](https://nestjs.com/) projects. So I [disabled it](https://github.com/typescript-eslint/typescript-eslint/issues/2559#issuecomment-692780580) in this config in nest framework.
19
+ 7. Support `'**/*.?([cm])js` and `'**/*.?([cm])jsx` files in react projects.
15
20
 
16
21
  ## Usage
17
22
 
package/dist/cli.cjs CHANGED
@@ -48,8 +48,8 @@ var import_picocolors = __toESM(require("picocolors"), 1);
48
48
  var package_default = {
49
49
  name: "@dhzh/eslint-config",
50
50
  type: "module",
51
- version: "0.6.2",
52
- packageManager: "pnpm@9.1.1",
51
+ version: "0.8.0",
52
+ packageManager: "pnpm@9.1.4",
53
53
  description: "Easton's ESLint config",
54
54
  author: "Easton Zheng <dhzhme@gmail.com>",
55
55
  license: "MIT",
@@ -133,26 +133,26 @@ var package_default = {
133
133
  dependencies: {
134
134
  "@antfu/install-pkg": "^0.3.3",
135
135
  "@clack/prompts": "^0.7.0",
136
- "@eslint-react/eslint-plugin": "^1.5.12",
136
+ "@eslint-react/eslint-plugin": "^1.5.14",
137
137
  "@stylistic/eslint-plugin": "^2.1.0",
138
- "@typescript-eslint/eslint-plugin": "^7.9.0",
139
- "@typescript-eslint/parser": "^7.9.0",
138
+ "@typescript-eslint/eslint-plugin": "^7.11.0",
139
+ "@typescript-eslint/parser": "^7.11.0",
140
140
  "eslint-config-flat-gitignore": "^0.1.5",
141
141
  "eslint-flat-config-utils": "^0.2.5",
142
142
  "eslint-merge-processors": "^0.1.0",
143
- "eslint-plugin-antfu": "^2.2.0",
144
- "eslint-plugin-command": "^0.2.2",
143
+ "eslint-plugin-antfu": "^2.3.3",
144
+ "eslint-plugin-command": "^0.2.3",
145
145
  "eslint-plugin-eslint-comments": "^3.2.0",
146
- "eslint-plugin-import-x": "^0.5.0",
147
- "eslint-plugin-jsdoc": "^48.2.5",
148
- "eslint-plugin-jsonc": "^2.15.1",
146
+ "eslint-plugin-import-x": "^0.5.1",
147
+ "eslint-plugin-jsdoc": "^48.2.7",
148
+ "eslint-plugin-jsonc": "^2.16.0",
149
149
  "eslint-plugin-markdown": "^5.0.0",
150
150
  "eslint-plugin-n": "^17.7.0",
151
151
  "eslint-plugin-no-only-tests": "^3.1.0",
152
152
  "eslint-plugin-perfectionist": "^2.10.0",
153
153
  "eslint-plugin-react-hooks": "^4.6.2",
154
154
  "eslint-plugin-react-refresh": "^0.4.7",
155
- "eslint-plugin-regexp": "^2.5.0",
155
+ "eslint-plugin-regexp": "^2.6.0",
156
156
  "eslint-plugin-toml": "^0.11.0",
157
157
  "eslint-plugin-unicorn": "^53.0.0",
158
158
  "eslint-plugin-unused-imports": "^3.2.0",
@@ -160,28 +160,28 @@ var package_default = {
160
160
  "eslint-plugin-vue": "^9.26.0",
161
161
  "eslint-plugin-yml": "^1.14.0",
162
162
  "eslint-processor-vue-blocks": "^0.1.2",
163
- globals: "^15.2.0",
163
+ globals: "^15.3.0",
164
164
  "jsonc-eslint-parser": "^2.4.0",
165
165
  "local-pkg": "^0.5.0",
166
166
  "parse-gitignore": "^2.0.0",
167
167
  picocolors: "^1.0.1",
168
168
  "toml-eslint-parser": "^0.9.3",
169
- "vue-eslint-parser": "^9.4.2",
170
- "yaml-eslint-parser": "^1.2.2",
169
+ "vue-eslint-parser": "^9.4.3",
170
+ "yaml-eslint-parser": "^1.2.3",
171
171
  yargs: "^17.7.2"
172
172
  },
173
173
  devDependencies: {
174
174
  "@antfu/ni": "^0.21.12",
175
175
  "@dhzh/eslint-config": "workspace:*",
176
- "@eslint/config-inspector": "^0.4.8",
176
+ "@eslint/config-inspector": "^0.4.9",
177
177
  "@prettier/plugin-xml": "^3.4.1",
178
178
  "@stylistic/eslint-plugin-migrate": "^2.1.0",
179
179
  "@types/eslint": "^8.56.10",
180
180
  "@types/fs-extra": "^11.0.4",
181
- "@types/node": "^20.12.12",
181
+ "@types/node": "^20.13.0",
182
182
  "@types/prompts": "^2.4.9",
183
183
  "@types/yargs": "^17.0.32",
184
- "@unocss/eslint-plugin": "^0.60.2",
184
+ "@unocss/eslint-plugin": "^0.60.4",
185
185
  "astro-eslint-parser": "^1.0.2",
186
186
  bumpp: "^9.4.1",
187
187
  "bundle-require": "^4.1.0",
@@ -196,21 +196,21 @@ var package_default = {
196
196
  execa: "^9.1.0",
197
197
  "fast-glob": "^3.3.2",
198
198
  "fs-extra": "^11.2.0",
199
- "lint-staged": "^15.2.2",
200
- "prettier-plugin-astro": "^0.13.0",
199
+ "lint-staged": "^15.2.5",
200
+ "prettier-plugin-astro": "^0.14.0",
201
201
  "prettier-plugin-slidev": "^1.0.5",
202
202
  rimraf: "^5.0.7",
203
203
  "simple-git-hooks": "^2.11.1",
204
204
  svelte: "^4.2.17",
205
205
  "svelte-eslint-parser": "^0.36.0",
206
206
  tsup: "^8.0.2",
207
- tsx: "^4.10.4",
207
+ tsx: "^4.11.0",
208
208
  typescript: "^5.4.5",
209
209
  vitest: "^1.6.0",
210
210
  vue: "^3.4.27"
211
211
  },
212
212
  "simple-git-hooks": {
213
- "pre-commit": "pnpm lint-staged"
213
+ "pre-commit": "npx lint-staged"
214
214
  },
215
215
  "lint-staged": {
216
216
  "*": "eslint --fix"
@@ -271,7 +271,12 @@ var vscodeSettingsString = `
271
271
  "scss",
272
272
  "gql",
273
273
  "graphql",
274
- "astro"
274
+ "astro",
275
+ "css",
276
+ "less",
277
+ "scss",
278
+ "pcss",
279
+ "postcss"
275
280
  ],
276
281
 
277
282
  // Enable eslint as the default formatter
@@ -404,13 +409,13 @@ function isGitClean() {
404
409
  }
405
410
  function getEslintConfigContent(mainConfig, additionalConfigs) {
406
411
  return `
407
- import dhzh from '@dhzh/eslint-config'
412
+ import dhzh from '@dhzh/eslint-config';
408
413
 
409
414
  export default dhzh({
410
415
  ${mainConfig}
411
416
  }${additionalConfigs?.map((config) => `,{
412
417
  ${config}
413
- }`)})
418
+ }`)});
414
419
  `.trimStart();
415
420
  }
416
421
 
package/dist/cli.js CHANGED
@@ -19,8 +19,8 @@ import c from "picocolors";
19
19
  var package_default = {
20
20
  name: "@dhzh/eslint-config",
21
21
  type: "module",
22
- version: "0.6.2",
23
- packageManager: "pnpm@9.1.1",
22
+ version: "0.8.0",
23
+ packageManager: "pnpm@9.1.4",
24
24
  description: "Easton's ESLint config",
25
25
  author: "Easton Zheng <dhzhme@gmail.com>",
26
26
  license: "MIT",
@@ -104,26 +104,26 @@ var package_default = {
104
104
  dependencies: {
105
105
  "@antfu/install-pkg": "^0.3.3",
106
106
  "@clack/prompts": "^0.7.0",
107
- "@eslint-react/eslint-plugin": "^1.5.12",
107
+ "@eslint-react/eslint-plugin": "^1.5.14",
108
108
  "@stylistic/eslint-plugin": "^2.1.0",
109
- "@typescript-eslint/eslint-plugin": "^7.9.0",
110
- "@typescript-eslint/parser": "^7.9.0",
109
+ "@typescript-eslint/eslint-plugin": "^7.11.0",
110
+ "@typescript-eslint/parser": "^7.11.0",
111
111
  "eslint-config-flat-gitignore": "^0.1.5",
112
112
  "eslint-flat-config-utils": "^0.2.5",
113
113
  "eslint-merge-processors": "^0.1.0",
114
- "eslint-plugin-antfu": "^2.2.0",
115
- "eslint-plugin-command": "^0.2.2",
114
+ "eslint-plugin-antfu": "^2.3.3",
115
+ "eslint-plugin-command": "^0.2.3",
116
116
  "eslint-plugin-eslint-comments": "^3.2.0",
117
- "eslint-plugin-import-x": "^0.5.0",
118
- "eslint-plugin-jsdoc": "^48.2.5",
119
- "eslint-plugin-jsonc": "^2.15.1",
117
+ "eslint-plugin-import-x": "^0.5.1",
118
+ "eslint-plugin-jsdoc": "^48.2.7",
119
+ "eslint-plugin-jsonc": "^2.16.0",
120
120
  "eslint-plugin-markdown": "^5.0.0",
121
121
  "eslint-plugin-n": "^17.7.0",
122
122
  "eslint-plugin-no-only-tests": "^3.1.0",
123
123
  "eslint-plugin-perfectionist": "^2.10.0",
124
124
  "eslint-plugin-react-hooks": "^4.6.2",
125
125
  "eslint-plugin-react-refresh": "^0.4.7",
126
- "eslint-plugin-regexp": "^2.5.0",
126
+ "eslint-plugin-regexp": "^2.6.0",
127
127
  "eslint-plugin-toml": "^0.11.0",
128
128
  "eslint-plugin-unicorn": "^53.0.0",
129
129
  "eslint-plugin-unused-imports": "^3.2.0",
@@ -131,28 +131,28 @@ var package_default = {
131
131
  "eslint-plugin-vue": "^9.26.0",
132
132
  "eslint-plugin-yml": "^1.14.0",
133
133
  "eslint-processor-vue-blocks": "^0.1.2",
134
- globals: "^15.2.0",
134
+ globals: "^15.3.0",
135
135
  "jsonc-eslint-parser": "^2.4.0",
136
136
  "local-pkg": "^0.5.0",
137
137
  "parse-gitignore": "^2.0.0",
138
138
  picocolors: "^1.0.1",
139
139
  "toml-eslint-parser": "^0.9.3",
140
- "vue-eslint-parser": "^9.4.2",
141
- "yaml-eslint-parser": "^1.2.2",
140
+ "vue-eslint-parser": "^9.4.3",
141
+ "yaml-eslint-parser": "^1.2.3",
142
142
  yargs: "^17.7.2"
143
143
  },
144
144
  devDependencies: {
145
145
  "@antfu/ni": "^0.21.12",
146
146
  "@dhzh/eslint-config": "workspace:*",
147
- "@eslint/config-inspector": "^0.4.8",
147
+ "@eslint/config-inspector": "^0.4.9",
148
148
  "@prettier/plugin-xml": "^3.4.1",
149
149
  "@stylistic/eslint-plugin-migrate": "^2.1.0",
150
150
  "@types/eslint": "^8.56.10",
151
151
  "@types/fs-extra": "^11.0.4",
152
- "@types/node": "^20.12.12",
152
+ "@types/node": "^20.13.0",
153
153
  "@types/prompts": "^2.4.9",
154
154
  "@types/yargs": "^17.0.32",
155
- "@unocss/eslint-plugin": "^0.60.2",
155
+ "@unocss/eslint-plugin": "^0.60.4",
156
156
  "astro-eslint-parser": "^1.0.2",
157
157
  bumpp: "^9.4.1",
158
158
  "bundle-require": "^4.1.0",
@@ -167,21 +167,21 @@ var package_default = {
167
167
  execa: "^9.1.0",
168
168
  "fast-glob": "^3.3.2",
169
169
  "fs-extra": "^11.2.0",
170
- "lint-staged": "^15.2.2",
171
- "prettier-plugin-astro": "^0.13.0",
170
+ "lint-staged": "^15.2.5",
171
+ "prettier-plugin-astro": "^0.14.0",
172
172
  "prettier-plugin-slidev": "^1.0.5",
173
173
  rimraf: "^5.0.7",
174
174
  "simple-git-hooks": "^2.11.1",
175
175
  svelte: "^4.2.17",
176
176
  "svelte-eslint-parser": "^0.36.0",
177
177
  tsup: "^8.0.2",
178
- tsx: "^4.10.4",
178
+ tsx: "^4.11.0",
179
179
  typescript: "^5.4.5",
180
180
  vitest: "^1.6.0",
181
181
  vue: "^3.4.27"
182
182
  },
183
183
  "simple-git-hooks": {
184
- "pre-commit": "pnpm lint-staged"
184
+ "pre-commit": "npx lint-staged"
185
185
  },
186
186
  "lint-staged": {
187
187
  "*": "eslint --fix"
@@ -242,7 +242,12 @@ var vscodeSettingsString = `
242
242
  "scss",
243
243
  "gql",
244
244
  "graphql",
245
- "astro"
245
+ "astro",
246
+ "css",
247
+ "less",
248
+ "scss",
249
+ "pcss",
250
+ "postcss"
246
251
  ],
247
252
 
248
253
  // Enable eslint as the default formatter
@@ -375,13 +380,13 @@ function isGitClean() {
375
380
  }
376
381
  function getEslintConfigContent(mainConfig, additionalConfigs) {
377
382
  return `
378
- import dhzh from '@dhzh/eslint-config'
383
+ import dhzh from '@dhzh/eslint-config';
379
384
 
380
385
  export default dhzh({
381
386
  ${mainConfig}
382
387
  }${additionalConfigs?.map((config) => `,{
383
388
  ${config}
384
- }`)})
389
+ }`)});
385
390
  `.trimStart();
386
391
  }
387
392
 
package/dist/index.cjs CHANGED
@@ -398,6 +398,7 @@ async function stylistic(options = {}) {
398
398
  ...lessOpinionated ? {
399
399
  curly: ["error", "all"]
400
400
  } : {
401
+ "antfu/curly": "off",
401
402
  "antfu/if-newline": "error",
402
403
  "antfu/top-level-function": "off",
403
404
  "curly": ["error", "all"]
@@ -1185,7 +1186,7 @@ var NextJsPackages = [
1185
1186
  ];
1186
1187
  async function react(options = {}) {
1187
1188
  const {
1188
- files = [GLOB_TS, GLOB_TSX],
1189
+ files = [GLOB_TS, GLOB_TSX, GLOB_JS, GLOB_JSX],
1189
1190
  overrides = {}
1190
1191
  } = options;
1191
1192
  await ensurePackages([
@@ -1862,6 +1863,7 @@ async function typescript(options = {}) {
1862
1863
  "ts/no-unsafe-return": "error",
1863
1864
  "ts/restrict-plus-operands": "error",
1864
1865
  "ts/restrict-template-expressions": "error",
1866
+ "ts/strict-boolean-expressions": "error",
1865
1867
  "ts/unbound-method": "error"
1866
1868
  };
1867
1869
  const [
@@ -2366,6 +2368,8 @@ function dhzh(options = {}, ...userConfigs) {
2366
2368
  }
2367
2369
  }
2368
2370
  }
2371
+ const typescriptOptions = resolveSubOptions(options, "typescript");
2372
+ const tsconfigPath = "tsconfigPath" in typescriptOptions ? typescriptOptions.tsconfigPath : void 0;
2369
2373
  configs2.push(
2370
2374
  ignores(),
2371
2375
  javascript({
@@ -2390,7 +2394,7 @@ function dhzh(options = {}, ...userConfigs) {
2390
2394
  }
2391
2395
  if (enableTypeScript) {
2392
2396
  configs2.push(typescript({
2393
- ...resolveSubOptions(options, "typescript"),
2397
+ ...typescriptOptions,
2394
2398
  componentExts,
2395
2399
  overrides: getOverrides(options, "typescript")
2396
2400
  }));
@@ -2422,13 +2426,13 @@ function dhzh(options = {}, ...userConfigs) {
2422
2426
  if (enableReact) {
2423
2427
  configs2.push(react({
2424
2428
  overrides: getOverrides(options, "react"),
2425
- tsconfigPath: getOverrides(options, "typescript").tsconfigPath
2429
+ tsconfigPath
2426
2430
  }));
2427
2431
  }
2428
2432
  if (enableSolid) {
2429
2433
  configs2.push(solid({
2430
2434
  overrides: getOverrides(options, "solid"),
2431
- tsconfigPath: getOverrides(options, "typescript").tsconfigPath,
2435
+ tsconfigPath,
2432
2436
  typescript: !!enableTypeScript
2433
2437
  }));
2434
2438
  }
package/dist/index.d.cts CHANGED
@@ -139,6 +139,11 @@ interface RuleOptions {
139
139
  * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/consistent-list-newline.md
140
140
  */
141
141
  'antfu/consistent-list-newline'?: Linter.RuleEntry<AntfuConsistentListNewline>
142
+ /**
143
+ * Enforce Anthony's style of curly bracket
144
+ * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/curly.test.ts
145
+ */
146
+ 'antfu/curly'?: Linter.RuleEntry<[]>
142
147
  /**
143
148
  * Newline after if
144
149
  * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/if-newline.md
@@ -751,42 +756,42 @@ interface RuleOptions {
751
756
  'implicit-arrow-linebreak'?: Linter.RuleEntry<ImplicitArrowLinebreak>
752
757
  /**
753
758
  * Enforce or ban the use of inline type-only markers for named imports.
754
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/consistent-type-specifier-style.md
759
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/consistent-type-specifier-style.md
755
760
  */
756
761
  'import/consistent-type-specifier-style'?: Linter.RuleEntry<ImportConsistentTypeSpecifierStyle>
757
762
  /**
758
763
  * Ensure a default export is present, given a default import.
759
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/default.md
764
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/default.md
760
765
  */
761
766
  'import/default'?: Linter.RuleEntry<[]>
762
767
  /**
763
768
  * Enforce a leading comment with the webpackChunkName for dynamic imports.
764
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/dynamic-import-chunkname.md
769
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/dynamic-import-chunkname.md
765
770
  */
766
771
  'import/dynamic-import-chunkname'?: Linter.RuleEntry<ImportDynamicImportChunkname>
767
772
  /**
768
773
  * Forbid any invalid exports, i.e. re-export of the same name.
769
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/export.md
774
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/export.md
770
775
  */
771
776
  'import/export'?: Linter.RuleEntry<[]>
772
777
  /**
773
778
  * Ensure all exports appear after other statements.
774
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/exports-last.md
779
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/exports-last.md
775
780
  */
776
781
  'import/exports-last'?: Linter.RuleEntry<[]>
777
782
  /**
778
783
  * Ensure consistent use of file extension within the import path.
779
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/extensions.md
784
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/extensions.md
780
785
  */
781
786
  'import/extensions'?: Linter.RuleEntry<ImportExtensions>
782
787
  /**
783
788
  * Ensure all imports appear before other statements.
784
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/first.md
789
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/first.md
785
790
  */
786
791
  'import/first'?: Linter.RuleEntry<ImportFirst>
787
792
  /**
788
793
  * Prefer named exports to be grouped together in a single export declaration.
789
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/group-exports.md
794
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/group-exports.md
790
795
  */
791
796
  'import/group-exports'?: Linter.RuleEntry<[]>
792
797
  /**
@@ -797,182 +802,182 @@ interface RuleOptions {
797
802
  'import/imports-first'?: Linter.RuleEntry<ImportImportsFirst>
798
803
  /**
799
804
  * Enforce the maximum number of dependencies a module can have.
800
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/max-dependencies.md
805
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/max-dependencies.md
801
806
  */
802
807
  'import/max-dependencies'?: Linter.RuleEntry<ImportMaxDependencies>
803
808
  /**
804
809
  * Ensure named imports correspond to a named export in the remote file.
805
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/named.md
810
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/named.md
806
811
  */
807
812
  'import/named'?: Linter.RuleEntry<ImportNamed>
808
813
  /**
809
814
  * Ensure imported namespaces contain dereferenced properties as they are dereferenced.
810
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/namespace.md
815
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/namespace.md
811
816
  */
812
817
  'import/namespace'?: Linter.RuleEntry<ImportNamespace>
813
818
  /**
814
819
  * Enforce a newline after import statements.
815
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/newline-after-import.md
820
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/newline-after-import.md
816
821
  */
817
822
  'import/newline-after-import'?: Linter.RuleEntry<ImportNewlineAfterImport>
818
823
  /**
819
824
  * Forbid import of modules using absolute paths.
820
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-absolute-path.md
825
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-absolute-path.md
821
826
  */
822
827
  'import/no-absolute-path'?: Linter.RuleEntry<ImportNoAbsolutePath>
823
828
  /**
824
829
  * Forbid AMD `require` and `define` calls.
825
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-amd.md
830
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-amd.md
826
831
  */
827
832
  'import/no-amd'?: Linter.RuleEntry<[]>
828
833
  /**
829
834
  * Forbid anonymous values as default exports.
830
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-anonymous-default-export.md
835
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-anonymous-default-export.md
831
836
  */
832
837
  'import/no-anonymous-default-export'?: Linter.RuleEntry<ImportNoAnonymousDefaultExport>
833
838
  /**
834
839
  * Forbid CommonJS `require` calls and `module.exports` or `exports.*`.
835
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-commonjs.md
840
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-commonjs.md
836
841
  */
837
842
  'import/no-commonjs'?: Linter.RuleEntry<ImportNoCommonjs>
838
843
  /**
839
844
  * Forbid a module from importing a module with a dependency path back to itself.
840
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-cycle.md
845
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-cycle.md
841
846
  */
842
847
  'import/no-cycle'?: Linter.RuleEntry<ImportNoCycle>
843
848
  /**
844
849
  * Forbid default exports.
845
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-default-export.md
850
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-default-export.md
846
851
  */
847
852
  'import/no-default-export'?: Linter.RuleEntry<[]>
848
853
  /**
849
854
  * Forbid imported names marked with `@deprecated` documentation tag.
850
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-deprecated.md
855
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-deprecated.md
851
856
  */
852
857
  'import/no-deprecated'?: Linter.RuleEntry<[]>
853
858
  /**
854
859
  * Forbid repeated import of the same module in multiple places.
855
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-duplicates.md
860
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-duplicates.md
856
861
  */
857
862
  'import/no-duplicates'?: Linter.RuleEntry<ImportNoDuplicates>
858
863
  /**
859
864
  * Forbid `require()` calls with expressions.
860
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-dynamic-require.md
865
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-dynamic-require.md
861
866
  */
862
867
  'import/no-dynamic-require'?: Linter.RuleEntry<ImportNoDynamicRequire>
863
868
  /**
864
869
  * Forbid empty named import blocks.
865
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-empty-named-blocks.md
870
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-empty-named-blocks.md
866
871
  */
867
872
  'import/no-empty-named-blocks'?: Linter.RuleEntry<[]>
868
873
  /**
869
874
  * Forbid the use of extraneous packages.
870
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-extraneous-dependencies.md
875
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-extraneous-dependencies.md
871
876
  */
872
877
  'import/no-extraneous-dependencies'?: Linter.RuleEntry<ImportNoExtraneousDependencies>
873
878
  /**
874
879
  * Forbid import statements with CommonJS module.exports.
875
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-import-module-exports.md
880
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-import-module-exports.md
876
881
  */
877
882
  'import/no-import-module-exports'?: Linter.RuleEntry<ImportNoImportModuleExports>
878
883
  /**
879
884
  * Forbid importing the submodules of other modules.
880
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-internal-modules.md
885
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-internal-modules.md
881
886
  */
882
887
  'import/no-internal-modules'?: Linter.RuleEntry<ImportNoInternalModules>
883
888
  /**
884
889
  * Forbid the use of mutable exports with `var` or `let`.
885
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-mutable-exports.md
890
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-mutable-exports.md
886
891
  */
887
892
  'import/no-mutable-exports'?: Linter.RuleEntry<[]>
888
893
  /**
889
894
  * Forbid use of exported name as identifier of default export.
890
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-named-as-default.md
895
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-named-as-default.md
891
896
  */
892
897
  'import/no-named-as-default'?: Linter.RuleEntry<[]>
893
898
  /**
894
899
  * Forbid use of exported name as property of default export.
895
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-named-as-default-member.md
900
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-named-as-default-member.md
896
901
  */
897
902
  'import/no-named-as-default-member'?: Linter.RuleEntry<[]>
898
903
  /**
899
904
  * Forbid named default exports.
900
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-named-default.md
905
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-named-default.md
901
906
  */
902
907
  'import/no-named-default'?: Linter.RuleEntry<[]>
903
908
  /**
904
909
  * Forbid named exports.
905
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-named-export.md
910
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-named-export.md
906
911
  */
907
912
  'import/no-named-export'?: Linter.RuleEntry<[]>
908
913
  /**
909
914
  * Forbid namespace (a.k.a. "wildcard" `*`) imports.
910
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-namespace.md
915
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-namespace.md
911
916
  */
912
917
  'import/no-namespace'?: Linter.RuleEntry<ImportNoNamespace>
913
918
  /**
914
919
  * Forbid Node.js builtin modules.
915
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-nodejs-modules.md
920
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-nodejs-modules.md
916
921
  */
917
922
  'import/no-nodejs-modules'?: Linter.RuleEntry<ImportNoNodejsModules>
918
923
  /**
919
924
  * Forbid importing packages through relative paths.
920
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-relative-packages.md
925
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-relative-packages.md
921
926
  */
922
927
  'import/no-relative-packages'?: Linter.RuleEntry<ImportNoRelativePackages>
923
928
  /**
924
929
  * Forbid importing modules from parent directories.
925
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-relative-parent-imports.md
930
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-relative-parent-imports.md
926
931
  */
927
932
  'import/no-relative-parent-imports'?: Linter.RuleEntry<ImportNoRelativeParentImports>
928
933
  /**
929
934
  * Enforce which files can be imported in a given folder.
930
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-restricted-paths.md
935
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-restricted-paths.md
931
936
  */
932
937
  'import/no-restricted-paths'?: Linter.RuleEntry<ImportNoRestrictedPaths>
933
938
  /**
934
939
  * Forbid a module from importing itself.
935
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-self-import.md
940
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-self-import.md
936
941
  */
937
942
  'import/no-self-import'?: Linter.RuleEntry<[]>
938
943
  /**
939
944
  * Forbid unassigned imports.
940
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-unassigned-import.md
945
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-unassigned-import.md
941
946
  */
942
947
  'import/no-unassigned-import'?: Linter.RuleEntry<ImportNoUnassignedImport>
943
948
  /**
944
949
  * Ensure imports point to a file/module that can be resolved.
945
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-unresolved.md
950
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-unresolved.md
946
951
  */
947
952
  'import/no-unresolved'?: Linter.RuleEntry<ImportNoUnresolved>
948
953
  /**
949
954
  * Forbid modules without exports, or exports without matching import in another module.
950
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-unused-modules.md
955
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-unused-modules.md
951
956
  */
952
957
  'import/no-unused-modules'?: Linter.RuleEntry<ImportNoUnusedModules>
953
958
  /**
954
959
  * Forbid unnecessary path segments in import and require statements.
955
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-useless-path-segments.md
960
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-useless-path-segments.md
956
961
  */
957
962
  'import/no-useless-path-segments'?: Linter.RuleEntry<ImportNoUselessPathSegments>
958
963
  /**
959
964
  * Forbid webpack loader syntax in imports.
960
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-webpack-loader-syntax.md
965
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-webpack-loader-syntax.md
961
966
  */
962
967
  'import/no-webpack-loader-syntax'?: Linter.RuleEntry<[]>
963
968
  /**
964
969
  * Enforce a convention in module import order.
965
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/order.md
970
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/order.md
966
971
  */
967
972
  'import/order'?: Linter.RuleEntry<ImportOrder>
968
973
  /**
969
974
  * Prefer a default export if module exports a single name or multiple names.
970
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/prefer-default-export.md
975
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/prefer-default-export.md
971
976
  */
972
977
  'import/prefer-default-export'?: Linter.RuleEntry<ImportPreferDefaultExport>
973
978
  /**
974
979
  * Forbid potentially ambiguous parse goal (`script` vs. `module`).
975
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/unambiguous.md
980
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/unambiguous.md
976
981
  */
977
982
  'import/unambiguous'?: Linter.RuleEntry<[]>
978
983
  /**
@@ -2959,6 +2964,16 @@ interface RuleOptions {
2959
2964
  */
2960
2965
  'react-naming-convention/use-state'?: Linter.RuleEntry<[]>
2961
2966
  'react-refresh/only-export-components'?: Linter.RuleEntry<ReactRefreshOnlyExportComponents>
2967
+ /**
2968
+ * enforce boolean attributes notation in JSX
2969
+ * @see https://eslint-react.xyz/rules/avoid-shorthand-boolean
2970
+ */
2971
+ 'react/avoid-shorthand-boolean'?: Linter.RuleEntry<[]>
2972
+ /**
2973
+ * enforce using fragment component instead of shorthand fragment syntax
2974
+ * @see https://eslint-react.xyz/rules/avoid-shorthand-fragment
2975
+ */
2976
+ 'react/avoid-shorthand-fragment'?: Linter.RuleEntry<[]>
2962
2977
  /**
2963
2978
  * require all 'forwardRef' components include a 'ref' parameter
2964
2979
  * @see https://eslint-react.xyz/rules/ensure-forward-ref-using-ref
@@ -5593,6 +5608,7 @@ interface RuleOptions {
5593
5608
  /**
5594
5609
  * Enforce using `@ts-expect-error` over `@ts-ignore`
5595
5610
  * @see https://typescript-eslint.io/rules/prefer-ts-expect-error
5611
+ * @deprecated
5596
5612
  */
5597
5613
  'ts/prefer-ts-expect-error'?: Linter.RuleEntry<[]>
5598
5614
  /**
@@ -7838,6 +7854,8 @@ type AntfuConsistentListNewline = []|[{
7838
7854
  ObjectPattern?: boolean
7839
7855
  ArrayPattern?: boolean
7840
7856
  JSXOpeningElement?: boolean
7857
+ JSONArrayExpression?: boolean
7858
+ JSONObjectExpression?: boolean
7841
7859
  }]
7842
7860
  // ----- antfu/indent-unindent -----
7843
7861
  type AntfuIndentUnindent = []|[{
@@ -13568,6 +13586,8 @@ type TsSortTypeConstituents = []|[{
13568
13586
 
13569
13587
  checkUnions?: boolean
13570
13588
 
13589
+ caseSensitive?: boolean
13590
+
13571
13591
  groupOrder?: ("conditional" | "function" | "import" | "intersection" | "keyword" | "nullish" | "literal" | "named" | "object" | "operator" | "tuple" | "union")[]
13572
13592
  }]
13573
13593
  // ----- ts/space-before-blocks -----
package/dist/index.d.ts CHANGED
@@ -139,6 +139,11 @@ interface RuleOptions {
139
139
  * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/consistent-list-newline.md
140
140
  */
141
141
  'antfu/consistent-list-newline'?: Linter.RuleEntry<AntfuConsistentListNewline>
142
+ /**
143
+ * Enforce Anthony's style of curly bracket
144
+ * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/curly.test.ts
145
+ */
146
+ 'antfu/curly'?: Linter.RuleEntry<[]>
142
147
  /**
143
148
  * Newline after if
144
149
  * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/if-newline.md
@@ -751,42 +756,42 @@ interface RuleOptions {
751
756
  'implicit-arrow-linebreak'?: Linter.RuleEntry<ImplicitArrowLinebreak>
752
757
  /**
753
758
  * Enforce or ban the use of inline type-only markers for named imports.
754
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/consistent-type-specifier-style.md
759
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/consistent-type-specifier-style.md
755
760
  */
756
761
  'import/consistent-type-specifier-style'?: Linter.RuleEntry<ImportConsistentTypeSpecifierStyle>
757
762
  /**
758
763
  * Ensure a default export is present, given a default import.
759
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/default.md
764
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/default.md
760
765
  */
761
766
  'import/default'?: Linter.RuleEntry<[]>
762
767
  /**
763
768
  * Enforce a leading comment with the webpackChunkName for dynamic imports.
764
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/dynamic-import-chunkname.md
769
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/dynamic-import-chunkname.md
765
770
  */
766
771
  'import/dynamic-import-chunkname'?: Linter.RuleEntry<ImportDynamicImportChunkname>
767
772
  /**
768
773
  * Forbid any invalid exports, i.e. re-export of the same name.
769
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/export.md
774
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/export.md
770
775
  */
771
776
  'import/export'?: Linter.RuleEntry<[]>
772
777
  /**
773
778
  * Ensure all exports appear after other statements.
774
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/exports-last.md
779
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/exports-last.md
775
780
  */
776
781
  'import/exports-last'?: Linter.RuleEntry<[]>
777
782
  /**
778
783
  * Ensure consistent use of file extension within the import path.
779
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/extensions.md
784
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/extensions.md
780
785
  */
781
786
  'import/extensions'?: Linter.RuleEntry<ImportExtensions>
782
787
  /**
783
788
  * Ensure all imports appear before other statements.
784
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/first.md
789
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/first.md
785
790
  */
786
791
  'import/first'?: Linter.RuleEntry<ImportFirst>
787
792
  /**
788
793
  * Prefer named exports to be grouped together in a single export declaration.
789
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/group-exports.md
794
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/group-exports.md
790
795
  */
791
796
  'import/group-exports'?: Linter.RuleEntry<[]>
792
797
  /**
@@ -797,182 +802,182 @@ interface RuleOptions {
797
802
  'import/imports-first'?: Linter.RuleEntry<ImportImportsFirst>
798
803
  /**
799
804
  * Enforce the maximum number of dependencies a module can have.
800
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/max-dependencies.md
805
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/max-dependencies.md
801
806
  */
802
807
  'import/max-dependencies'?: Linter.RuleEntry<ImportMaxDependencies>
803
808
  /**
804
809
  * Ensure named imports correspond to a named export in the remote file.
805
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/named.md
810
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/named.md
806
811
  */
807
812
  'import/named'?: Linter.RuleEntry<ImportNamed>
808
813
  /**
809
814
  * Ensure imported namespaces contain dereferenced properties as they are dereferenced.
810
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/namespace.md
815
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/namespace.md
811
816
  */
812
817
  'import/namespace'?: Linter.RuleEntry<ImportNamespace>
813
818
  /**
814
819
  * Enforce a newline after import statements.
815
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/newline-after-import.md
820
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/newline-after-import.md
816
821
  */
817
822
  'import/newline-after-import'?: Linter.RuleEntry<ImportNewlineAfterImport>
818
823
  /**
819
824
  * Forbid import of modules using absolute paths.
820
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-absolute-path.md
825
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-absolute-path.md
821
826
  */
822
827
  'import/no-absolute-path'?: Linter.RuleEntry<ImportNoAbsolutePath>
823
828
  /**
824
829
  * Forbid AMD `require` and `define` calls.
825
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-amd.md
830
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-amd.md
826
831
  */
827
832
  'import/no-amd'?: Linter.RuleEntry<[]>
828
833
  /**
829
834
  * Forbid anonymous values as default exports.
830
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-anonymous-default-export.md
835
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-anonymous-default-export.md
831
836
  */
832
837
  'import/no-anonymous-default-export'?: Linter.RuleEntry<ImportNoAnonymousDefaultExport>
833
838
  /**
834
839
  * Forbid CommonJS `require` calls and `module.exports` or `exports.*`.
835
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-commonjs.md
840
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-commonjs.md
836
841
  */
837
842
  'import/no-commonjs'?: Linter.RuleEntry<ImportNoCommonjs>
838
843
  /**
839
844
  * Forbid a module from importing a module with a dependency path back to itself.
840
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-cycle.md
845
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-cycle.md
841
846
  */
842
847
  'import/no-cycle'?: Linter.RuleEntry<ImportNoCycle>
843
848
  /**
844
849
  * Forbid default exports.
845
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-default-export.md
850
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-default-export.md
846
851
  */
847
852
  'import/no-default-export'?: Linter.RuleEntry<[]>
848
853
  /**
849
854
  * Forbid imported names marked with `@deprecated` documentation tag.
850
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-deprecated.md
855
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-deprecated.md
851
856
  */
852
857
  'import/no-deprecated'?: Linter.RuleEntry<[]>
853
858
  /**
854
859
  * Forbid repeated import of the same module in multiple places.
855
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-duplicates.md
860
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-duplicates.md
856
861
  */
857
862
  'import/no-duplicates'?: Linter.RuleEntry<ImportNoDuplicates>
858
863
  /**
859
864
  * Forbid `require()` calls with expressions.
860
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-dynamic-require.md
865
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-dynamic-require.md
861
866
  */
862
867
  'import/no-dynamic-require'?: Linter.RuleEntry<ImportNoDynamicRequire>
863
868
  /**
864
869
  * Forbid empty named import blocks.
865
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-empty-named-blocks.md
870
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-empty-named-blocks.md
866
871
  */
867
872
  'import/no-empty-named-blocks'?: Linter.RuleEntry<[]>
868
873
  /**
869
874
  * Forbid the use of extraneous packages.
870
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-extraneous-dependencies.md
875
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-extraneous-dependencies.md
871
876
  */
872
877
  'import/no-extraneous-dependencies'?: Linter.RuleEntry<ImportNoExtraneousDependencies>
873
878
  /**
874
879
  * Forbid import statements with CommonJS module.exports.
875
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-import-module-exports.md
880
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-import-module-exports.md
876
881
  */
877
882
  'import/no-import-module-exports'?: Linter.RuleEntry<ImportNoImportModuleExports>
878
883
  /**
879
884
  * Forbid importing the submodules of other modules.
880
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-internal-modules.md
885
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-internal-modules.md
881
886
  */
882
887
  'import/no-internal-modules'?: Linter.RuleEntry<ImportNoInternalModules>
883
888
  /**
884
889
  * Forbid the use of mutable exports with `var` or `let`.
885
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-mutable-exports.md
890
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-mutable-exports.md
886
891
  */
887
892
  'import/no-mutable-exports'?: Linter.RuleEntry<[]>
888
893
  /**
889
894
  * Forbid use of exported name as identifier of default export.
890
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-named-as-default.md
895
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-named-as-default.md
891
896
  */
892
897
  'import/no-named-as-default'?: Linter.RuleEntry<[]>
893
898
  /**
894
899
  * Forbid use of exported name as property of default export.
895
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-named-as-default-member.md
900
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-named-as-default-member.md
896
901
  */
897
902
  'import/no-named-as-default-member'?: Linter.RuleEntry<[]>
898
903
  /**
899
904
  * Forbid named default exports.
900
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-named-default.md
905
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-named-default.md
901
906
  */
902
907
  'import/no-named-default'?: Linter.RuleEntry<[]>
903
908
  /**
904
909
  * Forbid named exports.
905
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-named-export.md
910
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-named-export.md
906
911
  */
907
912
  'import/no-named-export'?: Linter.RuleEntry<[]>
908
913
  /**
909
914
  * Forbid namespace (a.k.a. "wildcard" `*`) imports.
910
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-namespace.md
915
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-namespace.md
911
916
  */
912
917
  'import/no-namespace'?: Linter.RuleEntry<ImportNoNamespace>
913
918
  /**
914
919
  * Forbid Node.js builtin modules.
915
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-nodejs-modules.md
920
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-nodejs-modules.md
916
921
  */
917
922
  'import/no-nodejs-modules'?: Linter.RuleEntry<ImportNoNodejsModules>
918
923
  /**
919
924
  * Forbid importing packages through relative paths.
920
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-relative-packages.md
925
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-relative-packages.md
921
926
  */
922
927
  'import/no-relative-packages'?: Linter.RuleEntry<ImportNoRelativePackages>
923
928
  /**
924
929
  * Forbid importing modules from parent directories.
925
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-relative-parent-imports.md
930
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-relative-parent-imports.md
926
931
  */
927
932
  'import/no-relative-parent-imports'?: Linter.RuleEntry<ImportNoRelativeParentImports>
928
933
  /**
929
934
  * Enforce which files can be imported in a given folder.
930
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-restricted-paths.md
935
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-restricted-paths.md
931
936
  */
932
937
  'import/no-restricted-paths'?: Linter.RuleEntry<ImportNoRestrictedPaths>
933
938
  /**
934
939
  * Forbid a module from importing itself.
935
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-self-import.md
940
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-self-import.md
936
941
  */
937
942
  'import/no-self-import'?: Linter.RuleEntry<[]>
938
943
  /**
939
944
  * Forbid unassigned imports.
940
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-unassigned-import.md
945
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-unassigned-import.md
941
946
  */
942
947
  'import/no-unassigned-import'?: Linter.RuleEntry<ImportNoUnassignedImport>
943
948
  /**
944
949
  * Ensure imports point to a file/module that can be resolved.
945
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-unresolved.md
950
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-unresolved.md
946
951
  */
947
952
  'import/no-unresolved'?: Linter.RuleEntry<ImportNoUnresolved>
948
953
  /**
949
954
  * Forbid modules without exports, or exports without matching import in another module.
950
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-unused-modules.md
955
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-unused-modules.md
951
956
  */
952
957
  'import/no-unused-modules'?: Linter.RuleEntry<ImportNoUnusedModules>
953
958
  /**
954
959
  * Forbid unnecessary path segments in import and require statements.
955
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-useless-path-segments.md
960
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-useless-path-segments.md
956
961
  */
957
962
  'import/no-useless-path-segments'?: Linter.RuleEntry<ImportNoUselessPathSegments>
958
963
  /**
959
964
  * Forbid webpack loader syntax in imports.
960
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/no-webpack-loader-syntax.md
965
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/no-webpack-loader-syntax.md
961
966
  */
962
967
  'import/no-webpack-loader-syntax'?: Linter.RuleEntry<[]>
963
968
  /**
964
969
  * Enforce a convention in module import order.
965
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/order.md
970
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/order.md
966
971
  */
967
972
  'import/order'?: Linter.RuleEntry<ImportOrder>
968
973
  /**
969
974
  * Prefer a default export if module exports a single name or multiple names.
970
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/prefer-default-export.md
975
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/prefer-default-export.md
971
976
  */
972
977
  'import/prefer-default-export'?: Linter.RuleEntry<ImportPreferDefaultExport>
973
978
  /**
974
979
  * Forbid potentially ambiguous parse goal (`script` vs. `module`).
975
- * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.0/docs/rules/unambiguous.md
980
+ * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v0.5.1/docs/rules/unambiguous.md
976
981
  */
977
982
  'import/unambiguous'?: Linter.RuleEntry<[]>
978
983
  /**
@@ -2959,6 +2964,16 @@ interface RuleOptions {
2959
2964
  */
2960
2965
  'react-naming-convention/use-state'?: Linter.RuleEntry<[]>
2961
2966
  'react-refresh/only-export-components'?: Linter.RuleEntry<ReactRefreshOnlyExportComponents>
2967
+ /**
2968
+ * enforce boolean attributes notation in JSX
2969
+ * @see https://eslint-react.xyz/rules/avoid-shorthand-boolean
2970
+ */
2971
+ 'react/avoid-shorthand-boolean'?: Linter.RuleEntry<[]>
2972
+ /**
2973
+ * enforce using fragment component instead of shorthand fragment syntax
2974
+ * @see https://eslint-react.xyz/rules/avoid-shorthand-fragment
2975
+ */
2976
+ 'react/avoid-shorthand-fragment'?: Linter.RuleEntry<[]>
2962
2977
  /**
2963
2978
  * require all 'forwardRef' components include a 'ref' parameter
2964
2979
  * @see https://eslint-react.xyz/rules/ensure-forward-ref-using-ref
@@ -5593,6 +5608,7 @@ interface RuleOptions {
5593
5608
  /**
5594
5609
  * Enforce using `@ts-expect-error` over `@ts-ignore`
5595
5610
  * @see https://typescript-eslint.io/rules/prefer-ts-expect-error
5611
+ * @deprecated
5596
5612
  */
5597
5613
  'ts/prefer-ts-expect-error'?: Linter.RuleEntry<[]>
5598
5614
  /**
@@ -7838,6 +7854,8 @@ type AntfuConsistentListNewline = []|[{
7838
7854
  ObjectPattern?: boolean
7839
7855
  ArrayPattern?: boolean
7840
7856
  JSXOpeningElement?: boolean
7857
+ JSONArrayExpression?: boolean
7858
+ JSONObjectExpression?: boolean
7841
7859
  }]
7842
7860
  // ----- antfu/indent-unindent -----
7843
7861
  type AntfuIndentUnindent = []|[{
@@ -13568,6 +13586,8 @@ type TsSortTypeConstituents = []|[{
13568
13586
 
13569
13587
  checkUnions?: boolean
13570
13588
 
13589
+ caseSensitive?: boolean
13590
+
13571
13591
  groupOrder?: ("conditional" | "function" | "import" | "intersection" | "keyword" | "nullish" | "literal" | "named" | "object" | "operator" | "tuple" | "union")[]
13572
13592
  }]
13573
13593
  // ----- ts/space-before-blocks -----
package/dist/index.js CHANGED
@@ -296,6 +296,7 @@ async function stylistic(options = {}) {
296
296
  ...lessOpinionated ? {
297
297
  curly: ["error", "all"]
298
298
  } : {
299
+ "antfu/curly": "off",
299
300
  "antfu/if-newline": "error",
300
301
  "antfu/top-level-function": "off",
301
302
  "curly": ["error", "all"]
@@ -1083,7 +1084,7 @@ var NextJsPackages = [
1083
1084
  ];
1084
1085
  async function react(options = {}) {
1085
1086
  const {
1086
- files = [GLOB_TS, GLOB_TSX],
1087
+ files = [GLOB_TS, GLOB_TSX, GLOB_JS, GLOB_JSX],
1087
1088
  overrides = {}
1088
1089
  } = options;
1089
1090
  await ensurePackages([
@@ -1760,6 +1761,7 @@ async function typescript(options = {}) {
1760
1761
  "ts/no-unsafe-return": "error",
1761
1762
  "ts/restrict-plus-operands": "error",
1762
1763
  "ts/restrict-template-expressions": "error",
1764
+ "ts/strict-boolean-expressions": "error",
1763
1765
  "ts/unbound-method": "error"
1764
1766
  };
1765
1767
  const [
@@ -2264,6 +2266,8 @@ function dhzh(options = {}, ...userConfigs) {
2264
2266
  }
2265
2267
  }
2266
2268
  }
2269
+ const typescriptOptions = resolveSubOptions(options, "typescript");
2270
+ const tsconfigPath = "tsconfigPath" in typescriptOptions ? typescriptOptions.tsconfigPath : void 0;
2267
2271
  configs2.push(
2268
2272
  ignores(),
2269
2273
  javascript({
@@ -2288,7 +2292,7 @@ function dhzh(options = {}, ...userConfigs) {
2288
2292
  }
2289
2293
  if (enableTypeScript) {
2290
2294
  configs2.push(typescript({
2291
- ...resolveSubOptions(options, "typescript"),
2295
+ ...typescriptOptions,
2292
2296
  componentExts,
2293
2297
  overrides: getOverrides(options, "typescript")
2294
2298
  }));
@@ -2320,13 +2324,13 @@ function dhzh(options = {}, ...userConfigs) {
2320
2324
  if (enableReact) {
2321
2325
  configs2.push(react({
2322
2326
  overrides: getOverrides(options, "react"),
2323
- tsconfigPath: getOverrides(options, "typescript").tsconfigPath
2327
+ tsconfigPath
2324
2328
  }));
2325
2329
  }
2326
2330
  if (enableSolid) {
2327
2331
  configs2.push(solid({
2328
2332
  overrides: getOverrides(options, "solid"),
2329
- tsconfigPath: getOverrides(options, "typescript").tsconfigPath,
2333
+ tsconfigPath,
2330
2334
  typescript: !!enableTypeScript
2331
2335
  }));
2332
2336
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dhzh/eslint-config",
3
3
  "type": "module",
4
- "version": "0.6.2",
4
+ "version": "0.8.0",
5
5
  "description": "Easton's ESLint config",
6
6
  "author": "Easton Zheng <dhzhme@gmail.com>",
7
7
  "license": "MIT",
@@ -71,26 +71,26 @@
71
71
  "dependencies": {
72
72
  "@antfu/install-pkg": "^0.3.3",
73
73
  "@clack/prompts": "^0.7.0",
74
- "@eslint-react/eslint-plugin": "^1.5.12",
74
+ "@eslint-react/eslint-plugin": "^1.5.14",
75
75
  "@stylistic/eslint-plugin": "^2.1.0",
76
- "@typescript-eslint/eslint-plugin": "^7.9.0",
77
- "@typescript-eslint/parser": "^7.9.0",
76
+ "@typescript-eslint/eslint-plugin": "^7.11.0",
77
+ "@typescript-eslint/parser": "^7.11.0",
78
78
  "eslint-config-flat-gitignore": "^0.1.5",
79
79
  "eslint-flat-config-utils": "^0.2.5",
80
80
  "eslint-merge-processors": "^0.1.0",
81
- "eslint-plugin-antfu": "^2.2.0",
82
- "eslint-plugin-command": "^0.2.2",
81
+ "eslint-plugin-antfu": "^2.3.3",
82
+ "eslint-plugin-command": "^0.2.3",
83
83
  "eslint-plugin-eslint-comments": "^3.2.0",
84
- "eslint-plugin-import-x": "^0.5.0",
85
- "eslint-plugin-jsdoc": "^48.2.5",
86
- "eslint-plugin-jsonc": "^2.15.1",
84
+ "eslint-plugin-import-x": "^0.5.1",
85
+ "eslint-plugin-jsdoc": "^48.2.7",
86
+ "eslint-plugin-jsonc": "^2.16.0",
87
87
  "eslint-plugin-markdown": "^5.0.0",
88
88
  "eslint-plugin-n": "^17.7.0",
89
89
  "eslint-plugin-no-only-tests": "^3.1.0",
90
90
  "eslint-plugin-perfectionist": "^2.10.0",
91
91
  "eslint-plugin-react-hooks": "^4.6.2",
92
92
  "eslint-plugin-react-refresh": "^0.4.7",
93
- "eslint-plugin-regexp": "^2.5.0",
93
+ "eslint-plugin-regexp": "^2.6.0",
94
94
  "eslint-plugin-toml": "^0.11.0",
95
95
  "eslint-plugin-unicorn": "^53.0.0",
96
96
  "eslint-plugin-unused-imports": "^3.2.0",
@@ -98,27 +98,27 @@
98
98
  "eslint-plugin-vue": "^9.26.0",
99
99
  "eslint-plugin-yml": "^1.14.0",
100
100
  "eslint-processor-vue-blocks": "^0.1.2",
101
- "globals": "^15.2.0",
101
+ "globals": "^15.3.0",
102
102
  "jsonc-eslint-parser": "^2.4.0",
103
103
  "local-pkg": "^0.5.0",
104
104
  "parse-gitignore": "^2.0.0",
105
105
  "picocolors": "^1.0.1",
106
106
  "toml-eslint-parser": "^0.9.3",
107
- "vue-eslint-parser": "^9.4.2",
108
- "yaml-eslint-parser": "^1.2.2",
107
+ "vue-eslint-parser": "^9.4.3",
108
+ "yaml-eslint-parser": "^1.2.3",
109
109
  "yargs": "^17.7.2"
110
110
  },
111
111
  "devDependencies": {
112
112
  "@antfu/ni": "^0.21.12",
113
- "@eslint/config-inspector": "^0.4.8",
113
+ "@eslint/config-inspector": "^0.4.9",
114
114
  "@prettier/plugin-xml": "^3.4.1",
115
115
  "@stylistic/eslint-plugin-migrate": "^2.1.0",
116
116
  "@types/eslint": "^8.56.10",
117
117
  "@types/fs-extra": "^11.0.4",
118
- "@types/node": "^20.12.12",
118
+ "@types/node": "^20.13.0",
119
119
  "@types/prompts": "^2.4.9",
120
120
  "@types/yargs": "^17.0.32",
121
- "@unocss/eslint-plugin": "^0.60.2",
121
+ "@unocss/eslint-plugin": "^0.60.4",
122
122
  "astro-eslint-parser": "^1.0.2",
123
123
  "bumpp": "^9.4.1",
124
124
  "bundle-require": "^4.1.0",
@@ -133,22 +133,22 @@
133
133
  "execa": "^9.1.0",
134
134
  "fast-glob": "^3.3.2",
135
135
  "fs-extra": "^11.2.0",
136
- "lint-staged": "^15.2.2",
137
- "prettier-plugin-astro": "^0.13.0",
136
+ "lint-staged": "^15.2.5",
137
+ "prettier-plugin-astro": "^0.14.0",
138
138
  "prettier-plugin-slidev": "^1.0.5",
139
139
  "rimraf": "^5.0.7",
140
140
  "simple-git-hooks": "^2.11.1",
141
141
  "svelte": "^4.2.17",
142
142
  "svelte-eslint-parser": "^0.36.0",
143
143
  "tsup": "^8.0.2",
144
- "tsx": "^4.10.4",
144
+ "tsx": "^4.11.0",
145
145
  "typescript": "^5.4.5",
146
146
  "vitest": "^1.6.0",
147
147
  "vue": "^3.4.27",
148
- "@dhzh/eslint-config": "0.6.2"
148
+ "@dhzh/eslint-config": "0.8.0"
149
149
  },
150
150
  "simple-git-hooks": {
151
- "pre-commit": "pnpm lint-staged"
151
+ "pre-commit": "npx lint-staged"
152
152
  },
153
153
  "lint-staged": {
154
154
  "*": "eslint --fix"