@lincy/eslint-config 4.6.2 → 4.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1007,11 +1007,10 @@ async function react(options = {}) {
1007
1007
  files = [GLOB_JSX, GLOB_TSX],
1008
1008
  jsx = true,
1009
1009
  overrides = {},
1010
- typescript: typescript2 = true,
1011
1010
  version = "detect"
1012
1011
  } = options;
1013
1012
  const tsconfigPath = options?.tsconfigPath ? toArray(options.tsconfigPath) : void 0;
1014
- const isTypeAware = !!tsconfigPath || !typescript2;
1013
+ const isTypeAware = !!tsconfigPath;
1015
1014
  await ensurePackages([
1016
1015
  "@eslint-react/eslint-plugin",
1017
1016
  "eslint-plugin-react-hooks",
@@ -1463,6 +1462,7 @@ async function typescript(options = {}) {
1463
1462
  "ts/no-unsafe-return": "error",
1464
1463
  "ts/restrict-plus-operands": "error",
1465
1464
  "ts/restrict-template-expressions": "error",
1465
+ "ts/strict-boolean-expressions": "error",
1466
1466
  "ts/unbound-method": "error"
1467
1467
  };
1468
1468
  const [
@@ -1999,6 +1999,7 @@ function lincy(options = {}, ...userConfigs) {
1999
1999
  vue: enableVue = VuePackages.some((i) => (0, import_local_pkg4.isPackageExists)(i))
2000
2000
  } = options;
2001
2001
  const stylisticOptions = options.stylistic === false ? false : typeof options.stylistic === "object" ? options.stylistic : {};
2002
+ const tsconfigPath = typeof enableTypeScript !== "boolean" && "tsconfigPath" in enableTypeScript ? enableTypeScript.tsconfigPath : void 0;
2002
2003
  if (stylisticOptions) {
2003
2004
  if (!("jsx" in stylisticOptions)) {
2004
2005
  stylisticOptions.jsx = options.jsx ?? true;
@@ -2041,7 +2042,8 @@ function lincy(options = {}, ...userConfigs) {
2041
2042
  configs2.push(typescript({
2042
2043
  ...typeof enableTypeScript !== "boolean" ? enableTypeScript : {},
2043
2044
  componentExts,
2044
- overrides: overrides.typescript
2045
+ overrides: overrides.typescript,
2046
+ tsconfigPath
2045
2047
  }));
2046
2048
  }
2047
2049
  if (stylisticOptions) {
@@ -2073,9 +2075,9 @@ function lincy(options = {}, ...userConfigs) {
2073
2075
  }
2074
2076
  if (enableReact) {
2075
2077
  configs2.push(react({
2078
+ tsconfigPath,
2076
2079
  ...typeof enableReact !== "boolean" ? enableReact : {},
2077
- overrides: overrides.react,
2078
- typescript: !!enableTypeScript
2080
+ overrides: overrides.react
2079
2081
  }));
2080
2082
  }
2081
2083
  if (enableUnoCSS) {
package/dist/index.d.cts CHANGED
@@ -398,7 +398,7 @@ interface RuleOptions {
398
398
  */
399
399
  'func-names'?: Linter.RuleEntry<FuncNames>
400
400
  /**
401
- * Enforce the consistent use of either `function` declarations or expressions
401
+ * Enforce the consistent use of either `function` declarations or expressions assigned to variables
402
402
  * @see https://eslint.org/docs/latest/rules/func-style
403
403
  */
404
404
  'func-style'?: Linter.RuleEntry<FuncStyle>
@@ -2686,6 +2686,16 @@ interface RuleOptions {
2686
2686
  */
2687
2687
  'react-naming-convention/use-state'?: Linter.RuleEntry<[]>
2688
2688
  'react-refresh/only-export-components'?: Linter.RuleEntry<ReactRefreshOnlyExportComponents>
2689
+ /**
2690
+ * enforce boolean attributes notation in JSX
2691
+ * @see https://eslint-react.xyz/rules/avoid-shorthand-boolean
2692
+ */
2693
+ 'react/avoid-shorthand-boolean'?: Linter.RuleEntry<[]>
2694
+ /**
2695
+ * enforce using fragment component instead of shorthand fragment syntax
2696
+ * @see https://eslint-react.xyz/rules/avoid-shorthand-fragment
2697
+ */
2698
+ 'react/avoid-shorthand-fragment'?: Linter.RuleEntry<[]>
2689
2699
  /**
2690
2700
  * require all 'forwardRef' components include a 'ref' parameter
2691
2701
  * @see https://eslint-react.xyz/rules/ensure-forward-ref-using-ref
@@ -14495,8 +14505,7 @@ interface OptionsIsInEditor {
14495
14505
  isInEditor?: boolean;
14496
14506
  }
14497
14507
  interface OptionsReact {
14498
- tsconfigPath?: string;
14499
- typescript?: boolean;
14508
+ tsconfigPath?: string | string[];
14500
14509
  jsx?: boolean;
14501
14510
  /** react 版本 */
14502
14511
  version?: string;
package/dist/index.d.ts CHANGED
@@ -398,7 +398,7 @@ interface RuleOptions {
398
398
  */
399
399
  'func-names'?: Linter.RuleEntry<FuncNames>
400
400
  /**
401
- * Enforce the consistent use of either `function` declarations or expressions
401
+ * Enforce the consistent use of either `function` declarations or expressions assigned to variables
402
402
  * @see https://eslint.org/docs/latest/rules/func-style
403
403
  */
404
404
  'func-style'?: Linter.RuleEntry<FuncStyle>
@@ -2686,6 +2686,16 @@ interface RuleOptions {
2686
2686
  */
2687
2687
  'react-naming-convention/use-state'?: Linter.RuleEntry<[]>
2688
2688
  'react-refresh/only-export-components'?: Linter.RuleEntry<ReactRefreshOnlyExportComponents>
2689
+ /**
2690
+ * enforce boolean attributes notation in JSX
2691
+ * @see https://eslint-react.xyz/rules/avoid-shorthand-boolean
2692
+ */
2693
+ 'react/avoid-shorthand-boolean'?: Linter.RuleEntry<[]>
2694
+ /**
2695
+ * enforce using fragment component instead of shorthand fragment syntax
2696
+ * @see https://eslint-react.xyz/rules/avoid-shorthand-fragment
2697
+ */
2698
+ 'react/avoid-shorthand-fragment'?: Linter.RuleEntry<[]>
2689
2699
  /**
2690
2700
  * require all 'forwardRef' components include a 'ref' parameter
2691
2701
  * @see https://eslint-react.xyz/rules/ensure-forward-ref-using-ref
@@ -14495,8 +14505,7 @@ interface OptionsIsInEditor {
14495
14505
  isInEditor?: boolean;
14496
14506
  }
14497
14507
  interface OptionsReact {
14498
- tsconfigPath?: string;
14499
- typescript?: boolean;
14508
+ tsconfigPath?: string | string[];
14500
14509
  jsx?: boolean;
14501
14510
  /** react 版本 */
14502
14511
  version?: string;
package/dist/index.js CHANGED
@@ -914,11 +914,10 @@ async function react(options = {}) {
914
914
  files = [GLOB_JSX, GLOB_TSX],
915
915
  jsx = true,
916
916
  overrides = {},
917
- typescript: typescript2 = true,
918
917
  version = "detect"
919
918
  } = options;
920
919
  const tsconfigPath = options?.tsconfigPath ? toArray(options.tsconfigPath) : void 0;
921
- const isTypeAware = !!tsconfigPath || !typescript2;
920
+ const isTypeAware = !!tsconfigPath;
922
921
  await ensurePackages([
923
922
  "@eslint-react/eslint-plugin",
924
923
  "eslint-plugin-react-hooks",
@@ -1370,6 +1369,7 @@ async function typescript(options = {}) {
1370
1369
  "ts/no-unsafe-return": "error",
1371
1370
  "ts/restrict-plus-operands": "error",
1372
1371
  "ts/restrict-template-expressions": "error",
1372
+ "ts/strict-boolean-expressions": "error",
1373
1373
  "ts/unbound-method": "error"
1374
1374
  };
1375
1375
  const [
@@ -1906,6 +1906,7 @@ function lincy(options = {}, ...userConfigs) {
1906
1906
  vue: enableVue = VuePackages.some((i) => isPackageExists3(i))
1907
1907
  } = options;
1908
1908
  const stylisticOptions = options.stylistic === false ? false : typeof options.stylistic === "object" ? options.stylistic : {};
1909
+ const tsconfigPath = typeof enableTypeScript !== "boolean" && "tsconfigPath" in enableTypeScript ? enableTypeScript.tsconfigPath : void 0;
1909
1910
  if (stylisticOptions) {
1910
1911
  if (!("jsx" in stylisticOptions)) {
1911
1912
  stylisticOptions.jsx = options.jsx ?? true;
@@ -1948,7 +1949,8 @@ function lincy(options = {}, ...userConfigs) {
1948
1949
  configs2.push(typescript({
1949
1950
  ...typeof enableTypeScript !== "boolean" ? enableTypeScript : {},
1950
1951
  componentExts,
1951
- overrides: overrides.typescript
1952
+ overrides: overrides.typescript,
1953
+ tsconfigPath
1952
1954
  }));
1953
1955
  }
1954
1956
  if (stylisticOptions) {
@@ -1980,9 +1982,9 @@ function lincy(options = {}, ...userConfigs) {
1980
1982
  }
1981
1983
  if (enableReact) {
1982
1984
  configs2.push(react({
1985
+ tsconfigPath,
1983
1986
  ...typeof enableReact !== "boolean" ? enableReact : {},
1984
- overrides: overrides.react,
1985
- typescript: !!enableTypeScript
1987
+ overrides: overrides.react
1986
1988
  }));
1987
1989
  }
1988
1990
  if (enableUnoCSS) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lincy/eslint-config",
3
3
  "type": "module",
4
- "version": "4.6.2",
4
+ "version": "4.6.3",
5
5
  "packageManager": "pnpm@9.1.0",
6
6
  "description": "LinCenYing's ESLint config",
7
7
  "author": "LinCenYing <lincenying@gmail.com> (https://github.com/lincenying/)",
@@ -74,7 +74,7 @@
74
74
  "eslint-plugin-antfu": "^2.3.3",
75
75
  "eslint-plugin-eslint-comments": "^3.2.0",
76
76
  "eslint-plugin-import-x": "^0.5.1",
77
- "eslint-plugin-jsdoc": "^48.2.6",
77
+ "eslint-plugin-jsdoc": "^48.2.7",
78
78
  "eslint-plugin-jsonc": "^2.16.0",
79
79
  "eslint-plugin-markdown": "^5.0.0",
80
80
  "eslint-plugin-n": "^17.7.0",
@@ -93,22 +93,22 @@
93
93
  "local-pkg": "^0.5.0",
94
94
  "prompts": "^2.4.2",
95
95
  "toml-eslint-parser": "^0.9.3",
96
- "vue-eslint-parser": "^9.4.2",
96
+ "vue-eslint-parser": "^9.4.3",
97
97
  "yaml-eslint-parser": "^1.2.3"
98
98
  },
99
99
  "devDependencies": {
100
100
  "@antfu/ni": "^0.21.12",
101
- "@eslint-react/eslint-plugin": "^1.5.13",
101
+ "@eslint-react/eslint-plugin": "^1.5.14",
102
102
  "@eslint-types/jsdoc": "48.2.2",
103
103
  "@eslint-types/typescript-eslint": "^7.5.0",
104
104
  "@eslint-types/unicorn": "^52.0.0",
105
- "@eslint/config-inspector": "^0.4.8",
105
+ "@eslint/config-inspector": "^0.4.10",
106
106
  "@lincy/eslint-config": "workspace:*",
107
107
  "@stylistic/eslint-plugin-migrate": "^2.1.0",
108
108
  "@types/eslint": "^8.56.10",
109
- "@types/node": "^20.12.12",
109
+ "@types/node": "^20.14.0",
110
110
  "@types/prompts": "^2.4.9",
111
- "@unocss/eslint-plugin": "^0.60.3",
111
+ "@unocss/eslint-plugin": "^0.60.4",
112
112
  "bumpp": "^9.4.1",
113
113
  "eslint": "npm:eslint-ts-patch@9.2.0-6",
114
114
  "eslint-plugin-format": "^0.1.1",
@@ -118,7 +118,7 @@
118
118
  "eslint-typegen": "^0.2.4",
119
119
  "esno": "^4.7.0",
120
120
  "lint-staged": "^15.2.5",
121
- "prettier": "^3.2.5",
121
+ "prettier": "^3.3.0",
122
122
  "react": "^18.3.1",
123
123
  "rimraf": "^5.0.7",
124
124
  "simple-git-hooks": "^2.11.1",