@coderwyd/eslint-config 2.5.3 → 2.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.cjs CHANGED
@@ -46,20 +46,20 @@ var import_parse_gitignore = __toESM(require("parse-gitignore"), 1);
46
46
  var import_picocolors = __toESM(require("picocolors"), 1);
47
47
 
48
48
  // package.json
49
- var version = "2.5.3";
49
+ var version = "2.5.4";
50
50
  var devDependencies = {
51
51
  "@antfu/ni": "^0.21.12",
52
- "@eslint-react/eslint-plugin": "^1.5.13",
53
- "@eslint/config-inspector": "^0.4.8",
52
+ "@eslint-react/eslint-plugin": "^1.5.14",
53
+ "@eslint/config-inspector": "^0.4.10",
54
54
  "@stylistic/eslint-plugin-migrate": "^2.1.0",
55
55
  "@types/eslint": "^8.56.10",
56
56
  "@types/fs-extra": "^11.0.4",
57
- "@types/node": "^20.12.12",
57
+ "@types/node": "^20.14.0",
58
58
  "@types/prompts": "^2.4.9",
59
59
  "@types/yargs": "^17.0.32",
60
- "@unocss/eslint-plugin": "^0.60.3",
60
+ "@unocss/eslint-plugin": "^0.60.4",
61
61
  bumpp: "^9.4.1",
62
- eslint: "^9.3.0",
62
+ eslint: "^9.4.0",
63
63
  "eslint-plugin-react-hooks": "^4.6.2",
64
64
  "eslint-plugin-react-refresh": "^0.4.7",
65
65
  "eslint-plugin-svelte": "2.39.0",
package/dist/cli.js CHANGED
@@ -17,20 +17,20 @@ import parse from "parse-gitignore";
17
17
  import c from "picocolors";
18
18
 
19
19
  // package.json
20
- var version = "2.5.3";
20
+ var version = "2.5.4";
21
21
  var devDependencies = {
22
22
  "@antfu/ni": "^0.21.12",
23
- "@eslint-react/eslint-plugin": "^1.5.13",
24
- "@eslint/config-inspector": "^0.4.8",
23
+ "@eslint-react/eslint-plugin": "^1.5.14",
24
+ "@eslint/config-inspector": "^0.4.10",
25
25
  "@stylistic/eslint-plugin-migrate": "^2.1.0",
26
26
  "@types/eslint": "^8.56.10",
27
27
  "@types/fs-extra": "^11.0.4",
28
- "@types/node": "^20.12.12",
28
+ "@types/node": "^20.14.0",
29
29
  "@types/prompts": "^2.4.9",
30
30
  "@types/yargs": "^17.0.32",
31
- "@unocss/eslint-plugin": "^0.60.3",
31
+ "@unocss/eslint-plugin": "^0.60.4",
32
32
  bumpp: "^9.4.1",
33
- eslint: "^9.3.0",
33
+ eslint: "^9.4.0",
34
34
  "eslint-plugin-react-hooks": "^4.6.2",
35
35
  "eslint-plugin-react-refresh": "^0.4.7",
36
36
  "eslint-plugin-svelte": "2.39.0",
package/dist/index.cjs CHANGED
@@ -358,15 +358,7 @@ async function javascript(options = {}) {
358
358
  allowTernary: true
359
359
  }
360
360
  ],
361
- "no-unused-vars": [
362
- "error",
363
- {
364
- args: "none",
365
- caughtErrors: "none",
366
- ignoreRestSiblings: true,
367
- vars: "all"
368
- }
369
- ],
361
+ "no-unused-vars": "off",
370
362
  "no-use-before-define": [
371
363
  "error",
372
364
  { classes: false, functions: false, variables: true }
@@ -404,7 +396,7 @@ async function javascript(options = {}) {
404
396
  }
405
397
  ],
406
398
  "prefer-exponentiation-operator": "error",
407
- "prefer-promise-reject-errors": "error",
399
+ // 'prefer-promise-reject-errors': 'error',
408
400
  "prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
409
401
  "prefer-rest-params": "error",
410
402
  "prefer-spread": "error",
@@ -995,6 +987,7 @@ async function typescript(options = {}) {
995
987
  "ts/no-unsafe-return": "error",
996
988
  "ts/restrict-plus-operands": "error",
997
989
  "ts/restrict-template-expressions": "error",
990
+ "ts/strict-boolean-expressions": "error",
998
991
  "ts/unbound-method": "error"
999
992
  };
1000
993
  const [pluginTs, parserTs] = await Promise.all([
@@ -1985,6 +1978,8 @@ async function defineConfig(options = {}, ...userConfigs) {
1985
1978
  }
1986
1979
  }
1987
1980
  }
1981
+ const typescriptOptions = resolveSubOptions(options, "typescript");
1982
+ const tsconfigPath = "tsconfigPath" in typescriptOptions ? typescriptOptions.tsconfigPath : void 0;
1988
1983
  configs2.push(
1989
1984
  ignores(),
1990
1985
  javascript({
@@ -2009,7 +2004,7 @@ async function defineConfig(options = {}, ...userConfigs) {
2009
2004
  if (enableTypeScript) {
2010
2005
  configs2.push(
2011
2006
  typescript({
2012
- ...resolveSubOptions(options, "typescript"),
2007
+ ...typescriptOptions,
2013
2008
  componentExts,
2014
2009
  overrides: getOverrides(options, "typescript")
2015
2010
  })
@@ -2047,7 +2042,7 @@ async function defineConfig(options = {}, ...userConfigs) {
2047
2042
  configs2.push(
2048
2043
  react({
2049
2044
  overrides: getOverrides(options, "react"),
2050
- tsconfigPath: getOverrides(options, "typescript").tsconfigPath
2045
+ tsconfigPath
2051
2046
  })
2052
2047
  );
2053
2048
  }
package/dist/index.d.cts CHANGED
@@ -304,7 +304,7 @@ interface RuleOptions {
304
304
  */
305
305
  'func-names'?: Linter.RuleEntry<FuncNames>
306
306
  /**
307
- * Enforce the consistent use of either `function` declarations or expressions
307
+ * Enforce the consistent use of either `function` declarations or expressions assigned to variables
308
308
  * @see https://eslint.org/docs/latest/rules/func-style
309
309
  */
310
310
  'func-style'?: Linter.RuleEntry<FuncStyle>
@@ -2592,6 +2592,16 @@ interface RuleOptions {
2592
2592
  */
2593
2593
  'react-naming-convention/use-state'?: Linter.RuleEntry<[]>
2594
2594
  'react-refresh/only-export-components'?: Linter.RuleEntry<ReactRefreshOnlyExportComponents>
2595
+ /**
2596
+ * enforce boolean attributes notation in JSX
2597
+ * @see https://eslint-react.xyz/rules/avoid-shorthand-boolean
2598
+ */
2599
+ 'react/avoid-shorthand-boolean'?: Linter.RuleEntry<[]>
2600
+ /**
2601
+ * enforce using fragment component instead of shorthand fragment syntax
2602
+ * @see https://eslint-react.xyz/rules/avoid-shorthand-fragment
2603
+ */
2604
+ 'react/avoid-shorthand-fragment'?: Linter.RuleEntry<[]>
2595
2605
  /**
2596
2606
  * require all 'forwardRef' components include a 'ref' parameter
2597
2607
  * @see https://eslint-react.xyz/rules/ensure-forward-ref-using-ref
@@ -15289,6 +15299,8 @@ declare function getOverrides<K extends keyof OptionsConfig>(options: OptionsCon
15289
15299
  'react-naming-convention/filename-extension'?: eslint.Linter.RuleEntry<undefined> | undefined;
15290
15300
  'react-naming-convention/use-state'?: eslint.Linter.RuleEntry<[]> | undefined;
15291
15301
  'react-refresh/only-export-components'?: eslint.Linter.RuleEntry<undefined> | undefined;
15302
+ 'react/avoid-shorthand-boolean'?: eslint.Linter.RuleEntry<[]> | undefined;
15303
+ 'react/avoid-shorthand-fragment'?: eslint.Linter.RuleEntry<[]> | undefined;
15292
15304
  'react/ensure-forward-ref-using-ref'?: eslint.Linter.RuleEntry<[]> | undefined;
15293
15305
  'react/no-access-state-in-setstate'?: eslint.Linter.RuleEntry<[]> | undefined;
15294
15306
  'react/no-array-index-key'?: eslint.Linter.RuleEntry<[]> | undefined;
package/dist/index.d.ts CHANGED
@@ -304,7 +304,7 @@ interface RuleOptions {
304
304
  */
305
305
  'func-names'?: Linter.RuleEntry<FuncNames>
306
306
  /**
307
- * Enforce the consistent use of either `function` declarations or expressions
307
+ * Enforce the consistent use of either `function` declarations or expressions assigned to variables
308
308
  * @see https://eslint.org/docs/latest/rules/func-style
309
309
  */
310
310
  'func-style'?: Linter.RuleEntry<FuncStyle>
@@ -2592,6 +2592,16 @@ interface RuleOptions {
2592
2592
  */
2593
2593
  'react-naming-convention/use-state'?: Linter.RuleEntry<[]>
2594
2594
  'react-refresh/only-export-components'?: Linter.RuleEntry<ReactRefreshOnlyExportComponents>
2595
+ /**
2596
+ * enforce boolean attributes notation in JSX
2597
+ * @see https://eslint-react.xyz/rules/avoid-shorthand-boolean
2598
+ */
2599
+ 'react/avoid-shorthand-boolean'?: Linter.RuleEntry<[]>
2600
+ /**
2601
+ * enforce using fragment component instead of shorthand fragment syntax
2602
+ * @see https://eslint-react.xyz/rules/avoid-shorthand-fragment
2603
+ */
2604
+ 'react/avoid-shorthand-fragment'?: Linter.RuleEntry<[]>
2595
2605
  /**
2596
2606
  * require all 'forwardRef' components include a 'ref' parameter
2597
2607
  * @see https://eslint-react.xyz/rules/ensure-forward-ref-using-ref
@@ -15289,6 +15299,8 @@ declare function getOverrides<K extends keyof OptionsConfig>(options: OptionsCon
15289
15299
  'react-naming-convention/filename-extension'?: eslint.Linter.RuleEntry<undefined> | undefined;
15290
15300
  'react-naming-convention/use-state'?: eslint.Linter.RuleEntry<[]> | undefined;
15291
15301
  'react-refresh/only-export-components'?: eslint.Linter.RuleEntry<undefined> | undefined;
15302
+ 'react/avoid-shorthand-boolean'?: eslint.Linter.RuleEntry<[]> | undefined;
15303
+ 'react/avoid-shorthand-fragment'?: eslint.Linter.RuleEntry<[]> | undefined;
15292
15304
  'react/ensure-forward-ref-using-ref'?: eslint.Linter.RuleEntry<[]> | undefined;
15293
15305
  'react/no-access-state-in-setstate'?: eslint.Linter.RuleEntry<[]> | undefined;
15294
15306
  'react/no-array-index-key'?: eslint.Linter.RuleEntry<[]> | undefined;
package/dist/index.js CHANGED
@@ -313,15 +313,7 @@ async function javascript(options = {}) {
313
313
  allowTernary: true
314
314
  }
315
315
  ],
316
- "no-unused-vars": [
317
- "error",
318
- {
319
- args: "none",
320
- caughtErrors: "none",
321
- ignoreRestSiblings: true,
322
- vars: "all"
323
- }
324
- ],
316
+ "no-unused-vars": "off",
325
317
  "no-use-before-define": [
326
318
  "error",
327
319
  { classes: false, functions: false, variables: true }
@@ -359,7 +351,7 @@ async function javascript(options = {}) {
359
351
  }
360
352
  ],
361
353
  "prefer-exponentiation-operator": "error",
362
- "prefer-promise-reject-errors": "error",
354
+ // 'prefer-promise-reject-errors': 'error',
363
355
  "prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
364
356
  "prefer-rest-params": "error",
365
357
  "prefer-spread": "error",
@@ -950,6 +942,7 @@ async function typescript(options = {}) {
950
942
  "ts/no-unsafe-return": "error",
951
943
  "ts/restrict-plus-operands": "error",
952
944
  "ts/restrict-template-expressions": "error",
945
+ "ts/strict-boolean-expressions": "error",
953
946
  "ts/unbound-method": "error"
954
947
  };
955
948
  const [pluginTs, parserTs] = await Promise.all([
@@ -1940,6 +1933,8 @@ async function defineConfig(options = {}, ...userConfigs) {
1940
1933
  }
1941
1934
  }
1942
1935
  }
1936
+ const typescriptOptions = resolveSubOptions(options, "typescript");
1937
+ const tsconfigPath = "tsconfigPath" in typescriptOptions ? typescriptOptions.tsconfigPath : void 0;
1943
1938
  configs2.push(
1944
1939
  ignores(),
1945
1940
  javascript({
@@ -1964,7 +1959,7 @@ async function defineConfig(options = {}, ...userConfigs) {
1964
1959
  if (enableTypeScript) {
1965
1960
  configs2.push(
1966
1961
  typescript({
1967
- ...resolveSubOptions(options, "typescript"),
1962
+ ...typescriptOptions,
1968
1963
  componentExts,
1969
1964
  overrides: getOverrides(options, "typescript")
1970
1965
  })
@@ -2002,7 +1997,7 @@ async function defineConfig(options = {}, ...userConfigs) {
2002
1997
  configs2.push(
2003
1998
  react({
2004
1999
  overrides: getOverrides(options, "react"),
2005
- tsconfigPath: getOverrides(options, "typescript").tsconfigPath
2000
+ tsconfigPath
2006
2001
  })
2007
2002
  );
2008
2003
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coderwyd/eslint-config",
3
3
  "type": "module",
4
- "version": "2.5.3",
4
+ "version": "2.5.4",
5
5
  "description": "Donny's ESLint config",
6
6
  "author": "Donny Wang <donny526@outlook.com> (https://github.com/coderwyd/)",
7
7
  "license": "MIT",
@@ -80,7 +80,7 @@
80
80
  "eslint-plugin-eslint-comments": "^3.2.0",
81
81
  "eslint-plugin-format": "^0.1.1",
82
82
  "eslint-plugin-import-x": "^0.5.1",
83
- "eslint-plugin-jsdoc": "^48.2.6",
83
+ "eslint-plugin-jsdoc": "^48.2.7",
84
84
  "eslint-plugin-jsonc": "^2.16.0",
85
85
  "eslint-plugin-n": "^17.7.0",
86
86
  "eslint-plugin-no-only-tests": "^3.1.0",
@@ -99,22 +99,22 @@
99
99
  "picocolors": "^1.0.1",
100
100
  "prettier-plugin-toml": "^2.0.1",
101
101
  "prompts": "^2.4.2",
102
- "vue-eslint-parser": "^9.4.2",
102
+ "vue-eslint-parser": "^9.4.3",
103
103
  "yargs": "^17.7.2"
104
104
  },
105
105
  "devDependencies": {
106
106
  "@antfu/ni": "^0.21.12",
107
- "@eslint-react/eslint-plugin": "^1.5.13",
108
- "@eslint/config-inspector": "^0.4.8",
107
+ "@eslint-react/eslint-plugin": "^1.5.14",
108
+ "@eslint/config-inspector": "^0.4.10",
109
109
  "@stylistic/eslint-plugin-migrate": "^2.1.0",
110
110
  "@types/eslint": "^8.56.10",
111
111
  "@types/fs-extra": "^11.0.4",
112
- "@types/node": "^20.12.12",
112
+ "@types/node": "^20.14.0",
113
113
  "@types/prompts": "^2.4.9",
114
114
  "@types/yargs": "^17.0.32",
115
- "@unocss/eslint-plugin": "^0.60.3",
115
+ "@unocss/eslint-plugin": "^0.60.4",
116
116
  "bumpp": "^9.4.1",
117
- "eslint": "^9.3.0",
117
+ "eslint": "^9.4.0",
118
118
  "eslint-plugin-react-hooks": "^4.6.2",
119
119
  "eslint-plugin-react-refresh": "^0.4.7",
120
120
  "eslint-plugin-svelte": "2.39.0",