@icebreakers/eslint-config 1.5.10 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/README.zh.md +2 -0
- package/dist/index.cjs +11 -0
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +11 -0
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -46,6 +46,7 @@ import { icebreaker } from '@icebreakers/eslint-config'
|
|
|
46
46
|
export default icebreaker({
|
|
47
47
|
vue: true, // or { vueVersion: 2 }
|
|
48
48
|
react: true,
|
|
49
|
+
query: true,
|
|
49
50
|
typescript: true,
|
|
50
51
|
test: true,
|
|
51
52
|
tailwindcss: {
|
|
@@ -62,6 +63,7 @@ export default icebreaker({
|
|
|
62
63
|
|
|
63
64
|
- `vue` – enables Vue + optionally version specific overrides (Vue 2/3) and ionic/weapp adjustments.
|
|
64
65
|
- `react` – defers to the upstream React preset and unlocks accessibility helpers when `a11y` is enabled.
|
|
66
|
+
- `query` – toggles the TanStack Query plugin (`@tanstack/eslint-plugin-query`) and its recommended lint rules.
|
|
65
67
|
- `tailwindcss` – pass `true` to use the built-in Tailwind flat config or provide `{ entryPoint, tailwindConfig }` for Tailwind v4/v3 projects.
|
|
66
68
|
- `mdx` – activates MDX linting via `eslint-plugin-mdx`.
|
|
67
69
|
- `a11y` – wires in JSX (React) and Vue accessibility plugins.
|
package/README.zh.md
CHANGED
|
@@ -44,6 +44,7 @@ import { icebreaker } from '@icebreakers/eslint-config'
|
|
|
44
44
|
export default icebreaker({
|
|
45
45
|
vue: true, // 或 { vueVersion: 2 }
|
|
46
46
|
react: true,
|
|
47
|
+
query: true,
|
|
47
48
|
typescript: true,
|
|
48
49
|
test: true,
|
|
49
50
|
tailwindcss: {
|
|
@@ -60,6 +61,7 @@ export default icebreaker({
|
|
|
60
61
|
|
|
61
62
|
- `vue`:启用 Vue 规则,可根据 Vue 2/3 自动切换,并在 `ionic`、`weapp` 选项开启时追加对应覆盖。
|
|
62
63
|
- `react`:复用上游 React 预设,配合 `a11y` 注入无障碍插件。
|
|
64
|
+
- `query`:按需启用 TanStack Query 插件(`@tanstack/eslint-plugin-query`)及其推荐规则。
|
|
63
65
|
- `tailwindcss`:传入 `true` 使用内置 Tailwind flat 配置,或通过对象指定 Tailwind v4 的入口文件 / v3 的配置文件路径。
|
|
64
66
|
- `mdx`:激活 `eslint-plugin-mdx` 处理 `.mdx` 文件。
|
|
65
67
|
- `a11y`:按需引入 JSX 与 Vue 的无障碍规则。
|
package/dist/index.cjs
CHANGED
|
@@ -296,6 +296,16 @@ function resolveNestPresets(isEnabled) {
|
|
|
296
296
|
rules: nestjsTypeScriptRules
|
|
297
297
|
}];
|
|
298
298
|
}
|
|
299
|
+
function resolveQueryPresets(isEnabled) {
|
|
300
|
+
if (!isEnabled) {
|
|
301
|
+
return [];
|
|
302
|
+
}
|
|
303
|
+
return [
|
|
304
|
+
(0, antfu_exports.interopDefault)(
|
|
305
|
+
import("@tanstack/eslint-plugin-query")
|
|
306
|
+
).then((pluginQuery) => pluginQuery.configs["flat/recommended"])
|
|
307
|
+
];
|
|
308
|
+
}
|
|
299
309
|
|
|
300
310
|
// ../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs
|
|
301
311
|
function isPlainObject(value) {
|
|
@@ -453,6 +463,7 @@ function getPresets(options, mode) {
|
|
|
453
463
|
...resolveTailwindPresets(resolved.tailwindcss),
|
|
454
464
|
...resolveMdxPresets(resolved.mdx),
|
|
455
465
|
...resolveNestPresets(resolved.nestjs),
|
|
466
|
+
...resolveQueryPresets(resolved.query),
|
|
456
467
|
...resolveAccessibilityPresets(resolved.a11y, resolved.vue, resolved.react)
|
|
457
468
|
);
|
|
458
469
|
return [resolved, ...presets];
|
package/dist/index.d.cts
CHANGED
|
@@ -36,6 +36,11 @@ type UserDefinedOptions = OptionsConfig & TypedFlatConfigItem & {
|
|
|
36
36
|
* @default false
|
|
37
37
|
*/
|
|
38
38
|
nestjs?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Enable TanStack Query support
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
query?: boolean;
|
|
39
44
|
/**
|
|
40
45
|
* Enable Ionic support
|
|
41
46
|
* @default false
|
package/dist/index.d.ts
CHANGED
|
@@ -36,6 +36,11 @@ type UserDefinedOptions = OptionsConfig & TypedFlatConfigItem & {
|
|
|
36
36
|
* @default false
|
|
37
37
|
*/
|
|
38
38
|
nestjs?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Enable TanStack Query support
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
query?: boolean;
|
|
39
44
|
/**
|
|
40
45
|
* Enable Ionic support
|
|
41
46
|
* @default false
|
package/dist/index.js
CHANGED
|
@@ -272,6 +272,16 @@ function resolveNestPresets(isEnabled) {
|
|
|
272
272
|
rules: nestjsTypeScriptRules
|
|
273
273
|
}];
|
|
274
274
|
}
|
|
275
|
+
function resolveQueryPresets(isEnabled) {
|
|
276
|
+
if (!isEnabled) {
|
|
277
|
+
return [];
|
|
278
|
+
}
|
|
279
|
+
return [
|
|
280
|
+
(0, antfu_exports.interopDefault)(
|
|
281
|
+
import("@tanstack/eslint-plugin-query")
|
|
282
|
+
).then((pluginQuery) => pluginQuery.configs["flat/recommended"])
|
|
283
|
+
];
|
|
284
|
+
}
|
|
275
285
|
|
|
276
286
|
// ../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs
|
|
277
287
|
function isPlainObject(value) {
|
|
@@ -429,6 +439,7 @@ function getPresets(options, mode) {
|
|
|
429
439
|
...resolveTailwindPresets(resolved.tailwindcss),
|
|
430
440
|
...resolveMdxPresets(resolved.mdx),
|
|
431
441
|
...resolveNestPresets(resolved.nestjs),
|
|
442
|
+
...resolveQueryPresets(resolved.query),
|
|
432
443
|
...resolveAccessibilityPresets(resolved.a11y, resolved.vue, resolved.react)
|
|
433
444
|
);
|
|
434
445
|
return [resolved, ...presets];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icebreakers/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.6.0",
|
|
5
5
|
"description": "ESLint preset from Icebreaker's dev-configs",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -42,8 +42,9 @@
|
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@antfu/eslint-config": "6.2.0",
|
|
45
|
-
"@eslint-react/eslint-plugin": "^2.3.
|
|
46
|
-
"@next/eslint-plugin-next": "^16.0.
|
|
45
|
+
"@eslint-react/eslint-plugin": "^2.3.9",
|
|
46
|
+
"@next/eslint-plugin-next": "^16.0.5",
|
|
47
|
+
"@tanstack/eslint-plugin-query": "^5.91.2",
|
|
47
48
|
"eslint-plugin-better-tailwindcss": "^3.7.11",
|
|
48
49
|
"eslint-plugin-format": "1.0.2",
|
|
49
50
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|