@antfu/eslint-config 2.19.0 → 2.19.2

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
@@ -146,7 +146,12 @@ Add the following settings to your `.vscode/settings.json`:
146
146
  "xml",
147
147
  "gql",
148
148
  "graphql",
149
- "astro"
149
+ "astro",
150
+ "css",
151
+ "less",
152
+ "scss",
153
+ "pcss",
154
+ "postcss"
150
155
  ]
151
156
  }
152
157
  ```
package/dist/cli.cjs CHANGED
@@ -48,8 +48,8 @@ var import_picocolors = __toESM(require("picocolors"), 1);
48
48
  var package_default = {
49
49
  name: "@antfu/eslint-config",
50
50
  type: "module",
51
- version: "2.19.0",
52
- packageManager: "pnpm@9.1.2",
51
+ version: "2.19.2",
52
+ packageManager: "pnpm@9.1.4",
53
53
  description: "Anthony's ESLint config",
54
54
  author: "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
55
55
  license: "MIT",
@@ -146,16 +146,16 @@ var package_default = {
146
146
  "@antfu/install-pkg": "^0.3.3",
147
147
  "@clack/prompts": "^0.7.0",
148
148
  "@stylistic/eslint-plugin": "^2.1.0",
149
- "@typescript-eslint/eslint-plugin": "^7.10.0",
150
- "@typescript-eslint/parser": "^7.10.0",
149
+ "@typescript-eslint/eslint-plugin": "^7.11.0",
150
+ "@typescript-eslint/parser": "^7.11.0",
151
151
  "eslint-config-flat-gitignore": "^0.1.5",
152
152
  "eslint-flat-config-utils": "^0.2.5",
153
153
  "eslint-merge-processors": "^0.1.0",
154
- "eslint-plugin-antfu": "^2.3.0",
154
+ "eslint-plugin-antfu": "^2.3.3",
155
155
  "eslint-plugin-command": "^0.2.3",
156
156
  "eslint-plugin-eslint-comments": "^3.2.0",
157
157
  "eslint-plugin-import-x": "^0.5.1",
158
- "eslint-plugin-jsdoc": "^48.2.6",
158
+ "eslint-plugin-jsdoc": "^48.2.7",
159
159
  "eslint-plugin-jsonc": "^2.16.0",
160
160
  "eslint-plugin-markdown": "^5.0.0",
161
161
  "eslint-plugin-n": "^17.7.0",
@@ -175,23 +175,23 @@ var package_default = {
175
175
  "parse-gitignore": "^2.0.0",
176
176
  picocolors: "^1.0.1",
177
177
  "toml-eslint-parser": "^0.9.3",
178
- "vue-eslint-parser": "^9.4.2",
178
+ "vue-eslint-parser": "^9.4.3",
179
179
  "yaml-eslint-parser": "^1.2.3",
180
180
  yargs: "^17.7.2"
181
181
  },
182
182
  devDependencies: {
183
183
  "@antfu/eslint-config": "workspace:*",
184
184
  "@antfu/ni": "^0.21.12",
185
- "@eslint-react/eslint-plugin": "^1.5.12",
186
- "@eslint/config-inspector": "^0.4.8",
185
+ "@eslint-react/eslint-plugin": "^1.5.14",
186
+ "@eslint/config-inspector": "^0.4.9",
187
187
  "@prettier/plugin-xml": "^3.4.1",
188
188
  "@stylistic/eslint-plugin-migrate": "^2.1.0",
189
189
  "@types/eslint": "^8.56.10",
190
190
  "@types/fs-extra": "^11.0.4",
191
- "@types/node": "^20.12.12",
191
+ "@types/node": "^20.13.0",
192
192
  "@types/prompts": "^2.4.9",
193
193
  "@types/yargs": "^17.0.32",
194
- "@unocss/eslint-plugin": "^0.60.3",
194
+ "@unocss/eslint-plugin": "^0.60.4",
195
195
  "astro-eslint-parser": "^1.0.2",
196
196
  bumpp: "^9.4.1",
197
197
  "bundle-require": "^4.1.0",
@@ -275,7 +275,12 @@ var vscodeSettingsString = `
275
275
  "xml",
276
276
  "gql",
277
277
  "graphql",
278
- "astro"
278
+ "astro",
279
+ "css",
280
+ "less",
281
+ "scss",
282
+ "pcss",
283
+ "postcss"
279
284
  ]
280
285
  `;
281
286
  var frameworkOptions = [
package/dist/cli.js CHANGED
@@ -19,8 +19,8 @@ import c from "picocolors";
19
19
  var package_default = {
20
20
  name: "@antfu/eslint-config",
21
21
  type: "module",
22
- version: "2.19.0",
23
- packageManager: "pnpm@9.1.2",
22
+ version: "2.19.2",
23
+ packageManager: "pnpm@9.1.4",
24
24
  description: "Anthony's ESLint config",
25
25
  author: "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
26
26
  license: "MIT",
@@ -117,16 +117,16 @@ var package_default = {
117
117
  "@antfu/install-pkg": "^0.3.3",
118
118
  "@clack/prompts": "^0.7.0",
119
119
  "@stylistic/eslint-plugin": "^2.1.0",
120
- "@typescript-eslint/eslint-plugin": "^7.10.0",
121
- "@typescript-eslint/parser": "^7.10.0",
120
+ "@typescript-eslint/eslint-plugin": "^7.11.0",
121
+ "@typescript-eslint/parser": "^7.11.0",
122
122
  "eslint-config-flat-gitignore": "^0.1.5",
123
123
  "eslint-flat-config-utils": "^0.2.5",
124
124
  "eslint-merge-processors": "^0.1.0",
125
- "eslint-plugin-antfu": "^2.3.0",
125
+ "eslint-plugin-antfu": "^2.3.3",
126
126
  "eslint-plugin-command": "^0.2.3",
127
127
  "eslint-plugin-eslint-comments": "^3.2.0",
128
128
  "eslint-plugin-import-x": "^0.5.1",
129
- "eslint-plugin-jsdoc": "^48.2.6",
129
+ "eslint-plugin-jsdoc": "^48.2.7",
130
130
  "eslint-plugin-jsonc": "^2.16.0",
131
131
  "eslint-plugin-markdown": "^5.0.0",
132
132
  "eslint-plugin-n": "^17.7.0",
@@ -146,23 +146,23 @@ var package_default = {
146
146
  "parse-gitignore": "^2.0.0",
147
147
  picocolors: "^1.0.1",
148
148
  "toml-eslint-parser": "^0.9.3",
149
- "vue-eslint-parser": "^9.4.2",
149
+ "vue-eslint-parser": "^9.4.3",
150
150
  "yaml-eslint-parser": "^1.2.3",
151
151
  yargs: "^17.7.2"
152
152
  },
153
153
  devDependencies: {
154
154
  "@antfu/eslint-config": "workspace:*",
155
155
  "@antfu/ni": "^0.21.12",
156
- "@eslint-react/eslint-plugin": "^1.5.12",
157
- "@eslint/config-inspector": "^0.4.8",
156
+ "@eslint-react/eslint-plugin": "^1.5.14",
157
+ "@eslint/config-inspector": "^0.4.9",
158
158
  "@prettier/plugin-xml": "^3.4.1",
159
159
  "@stylistic/eslint-plugin-migrate": "^2.1.0",
160
160
  "@types/eslint": "^8.56.10",
161
161
  "@types/fs-extra": "^11.0.4",
162
- "@types/node": "^20.12.12",
162
+ "@types/node": "^20.13.0",
163
163
  "@types/prompts": "^2.4.9",
164
164
  "@types/yargs": "^17.0.32",
165
- "@unocss/eslint-plugin": "^0.60.3",
165
+ "@unocss/eslint-plugin": "^0.60.4",
166
166
  "astro-eslint-parser": "^1.0.2",
167
167
  bumpp: "^9.4.1",
168
168
  "bundle-require": "^4.1.0",
@@ -246,7 +246,12 @@ var vscodeSettingsString = `
246
246
  "xml",
247
247
  "gql",
248
248
  "graphql",
249
- "astro"
249
+ "astro",
250
+ "css",
251
+ "less",
252
+ "scss",
253
+ "pcss",
254
+ "postcss"
250
255
  ]
251
256
  `;
252
257
  var frameworkOptions = [
package/dist/index.cjs CHANGED
@@ -1176,7 +1176,7 @@ var NextJsPackages = [
1176
1176
  ];
1177
1177
  async function react(options = {}) {
1178
1178
  const {
1179
- files = [GLOB_TS, GLOB_TSX],
1179
+ files = [GLOB_JS, GLOB_JSX, GLOB_TS, GLOB_TSX],
1180
1180
  overrides = {}
1181
1181
  } = options;
1182
1182
  await ensurePackages([
@@ -1853,6 +1853,7 @@ async function typescript(options = {}) {
1853
1853
  "ts/no-unsafe-return": "error",
1854
1854
  "ts/restrict-plus-operands": "error",
1855
1855
  "ts/restrict-template-expressions": "error",
1856
+ "ts/strict-boolean-expressions": "error",
1856
1857
  "ts/unbound-method": "error"
1857
1858
  };
1858
1859
  const [
@@ -2354,6 +2355,8 @@ function antfu(options = {}, ...userConfigs) {
2354
2355
  configs2.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r()]));
2355
2356
  }
2356
2357
  }
2358
+ const typescriptOptions = resolveSubOptions(options, "typescript");
2359
+ const tsconfigPath = "tsconfigPath" in typescriptOptions ? typescriptOptions.tsconfigPath : void 0;
2357
2360
  configs2.push(
2358
2361
  ignores(),
2359
2362
  javascript({
@@ -2378,7 +2381,7 @@ function antfu(options = {}, ...userConfigs) {
2378
2381
  }
2379
2382
  if (enableTypeScript) {
2380
2383
  configs2.push(typescript({
2381
- ...resolveSubOptions(options, "typescript"),
2384
+ ...typescriptOptions,
2382
2385
  componentExts,
2383
2386
  overrides: getOverrides(options, "typescript")
2384
2387
  }));
@@ -2410,13 +2413,13 @@ function antfu(options = {}, ...userConfigs) {
2410
2413
  if (enableReact) {
2411
2414
  configs2.push(react({
2412
2415
  overrides: getOverrides(options, "react"),
2413
- tsconfigPath: getOverrides(options, "typescript").tsconfigPath
2416
+ tsconfigPath
2414
2417
  }));
2415
2418
  }
2416
2419
  if (enableSolid) {
2417
2420
  configs2.push(solid({
2418
2421
  overrides: getOverrides(options, "solid"),
2419
- tsconfigPath: getOverrides(options, "typescript").tsconfigPath,
2422
+ tsconfigPath,
2420
2423
  typescript: !!enableTypeScript
2421
2424
  }));
2422
2425
  }
package/dist/index.d.cts CHANGED
@@ -2964,6 +2964,16 @@ interface RuleOptions {
2964
2964
  */
2965
2965
  'react-naming-convention/use-state'?: Linter.RuleEntry<[]>
2966
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<[]>
2967
2977
  /**
2968
2978
  * require all 'forwardRef' components include a 'ref' parameter
2969
2979
  * @see https://eslint-react.xyz/rules/ensure-forward-ref-using-ref
@@ -5598,6 +5608,7 @@ interface RuleOptions {
5598
5608
  /**
5599
5609
  * Enforce using `@ts-expect-error` over `@ts-ignore`
5600
5610
  * @see https://typescript-eslint.io/rules/prefer-ts-expect-error
5611
+ * @deprecated
5601
5612
  */
5602
5613
  'ts/prefer-ts-expect-error'?: Linter.RuleEntry<[]>
5603
5614
  /**
package/dist/index.d.ts CHANGED
@@ -2964,6 +2964,16 @@ interface RuleOptions {
2964
2964
  */
2965
2965
  'react-naming-convention/use-state'?: Linter.RuleEntry<[]>
2966
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<[]>
2967
2977
  /**
2968
2978
  * require all 'forwardRef' components include a 'ref' parameter
2969
2979
  * @see https://eslint-react.xyz/rules/ensure-forward-ref-using-ref
@@ -5598,6 +5608,7 @@ interface RuleOptions {
5598
5608
  /**
5599
5609
  * Enforce using `@ts-expect-error` over `@ts-ignore`
5600
5610
  * @see https://typescript-eslint.io/rules/prefer-ts-expect-error
5611
+ * @deprecated
5601
5612
  */
5602
5613
  'ts/prefer-ts-expect-error'?: Linter.RuleEntry<[]>
5603
5614
  /**
package/dist/index.js CHANGED
@@ -1074,7 +1074,7 @@ var NextJsPackages = [
1074
1074
  ];
1075
1075
  async function react(options = {}) {
1076
1076
  const {
1077
- files = [GLOB_TS, GLOB_TSX],
1077
+ files = [GLOB_JS, GLOB_JSX, GLOB_TS, GLOB_TSX],
1078
1078
  overrides = {}
1079
1079
  } = options;
1080
1080
  await ensurePackages([
@@ -1751,6 +1751,7 @@ async function typescript(options = {}) {
1751
1751
  "ts/no-unsafe-return": "error",
1752
1752
  "ts/restrict-plus-operands": "error",
1753
1753
  "ts/restrict-template-expressions": "error",
1754
+ "ts/strict-boolean-expressions": "error",
1754
1755
  "ts/unbound-method": "error"
1755
1756
  };
1756
1757
  const [
@@ -2252,6 +2253,8 @@ function antfu(options = {}, ...userConfigs) {
2252
2253
  configs2.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r()]));
2253
2254
  }
2254
2255
  }
2256
+ const typescriptOptions = resolveSubOptions(options, "typescript");
2257
+ const tsconfigPath = "tsconfigPath" in typescriptOptions ? typescriptOptions.tsconfigPath : void 0;
2255
2258
  configs2.push(
2256
2259
  ignores(),
2257
2260
  javascript({
@@ -2276,7 +2279,7 @@ function antfu(options = {}, ...userConfigs) {
2276
2279
  }
2277
2280
  if (enableTypeScript) {
2278
2281
  configs2.push(typescript({
2279
- ...resolveSubOptions(options, "typescript"),
2282
+ ...typescriptOptions,
2280
2283
  componentExts,
2281
2284
  overrides: getOverrides(options, "typescript")
2282
2285
  }));
@@ -2308,13 +2311,13 @@ function antfu(options = {}, ...userConfigs) {
2308
2311
  if (enableReact) {
2309
2312
  configs2.push(react({
2310
2313
  overrides: getOverrides(options, "react"),
2311
- tsconfigPath: getOverrides(options, "typescript").tsconfigPath
2314
+ tsconfigPath
2312
2315
  }));
2313
2316
  }
2314
2317
  if (enableSolid) {
2315
2318
  configs2.push(solid({
2316
2319
  overrides: getOverrides(options, "solid"),
2317
- tsconfigPath: getOverrides(options, "typescript").tsconfigPath,
2320
+ tsconfigPath,
2318
2321
  typescript: !!enableTypeScript
2319
2322
  }));
2320
2323
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@antfu/eslint-config",
3
3
  "type": "module",
4
- "version": "2.19.0",
4
+ "version": "2.19.2",
5
5
  "description": "Anthony's ESLint config",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
7
7
  "license": "MIT",
@@ -84,16 +84,16 @@
84
84
  "@antfu/install-pkg": "^0.3.3",
85
85
  "@clack/prompts": "^0.7.0",
86
86
  "@stylistic/eslint-plugin": "^2.1.0",
87
- "@typescript-eslint/eslint-plugin": "^7.10.0",
88
- "@typescript-eslint/parser": "^7.10.0",
87
+ "@typescript-eslint/eslint-plugin": "^7.11.0",
88
+ "@typescript-eslint/parser": "^7.11.0",
89
89
  "eslint-config-flat-gitignore": "^0.1.5",
90
90
  "eslint-flat-config-utils": "^0.2.5",
91
91
  "eslint-merge-processors": "^0.1.0",
92
- "eslint-plugin-antfu": "^2.3.0",
92
+ "eslint-plugin-antfu": "^2.3.3",
93
93
  "eslint-plugin-command": "^0.2.3",
94
94
  "eslint-plugin-eslint-comments": "^3.2.0",
95
95
  "eslint-plugin-import-x": "^0.5.1",
96
- "eslint-plugin-jsdoc": "^48.2.6",
96
+ "eslint-plugin-jsdoc": "^48.2.7",
97
97
  "eslint-plugin-jsonc": "^2.16.0",
98
98
  "eslint-plugin-markdown": "^5.0.0",
99
99
  "eslint-plugin-n": "^17.7.0",
@@ -113,22 +113,22 @@
113
113
  "parse-gitignore": "^2.0.0",
114
114
  "picocolors": "^1.0.1",
115
115
  "toml-eslint-parser": "^0.9.3",
116
- "vue-eslint-parser": "^9.4.2",
116
+ "vue-eslint-parser": "^9.4.3",
117
117
  "yaml-eslint-parser": "^1.2.3",
118
118
  "yargs": "^17.7.2"
119
119
  },
120
120
  "devDependencies": {
121
121
  "@antfu/ni": "^0.21.12",
122
- "@eslint-react/eslint-plugin": "^1.5.12",
123
- "@eslint/config-inspector": "^0.4.8",
122
+ "@eslint-react/eslint-plugin": "^1.5.14",
123
+ "@eslint/config-inspector": "^0.4.9",
124
124
  "@prettier/plugin-xml": "^3.4.1",
125
125
  "@stylistic/eslint-plugin-migrate": "^2.1.0",
126
126
  "@types/eslint": "^8.56.10",
127
127
  "@types/fs-extra": "^11.0.4",
128
- "@types/node": "^20.12.12",
128
+ "@types/node": "^20.13.0",
129
129
  "@types/prompts": "^2.4.9",
130
130
  "@types/yargs": "^17.0.32",
131
- "@unocss/eslint-plugin": "^0.60.3",
131
+ "@unocss/eslint-plugin": "^0.60.4",
132
132
  "astro-eslint-parser": "^1.0.2",
133
133
  "bumpp": "^9.4.1",
134
134
  "bundle-require": "^4.1.0",
@@ -157,7 +157,7 @@
157
157
  "typescript": "^5.4.5",
158
158
  "vitest": "^1.6.0",
159
159
  "vue": "^3.4.27",
160
- "@antfu/eslint-config": "2.19.0"
160
+ "@antfu/eslint-config": "2.19.2"
161
161
  },
162
162
  "simple-git-hooks": {
163
163
  "pre-commit": "npx lint-staged"