@siberiacancode/eslint 2.16.5 → 2.16.7

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.
@@ -32,8 +32,6 @@ let _eslint_css = require("@eslint/css");
32
32
  _eslint_css = __toESM(_eslint_css);
33
33
  let eslint_plugin_better_tailwindcss = require("eslint-plugin-better-tailwindcss");
34
34
  eslint_plugin_better_tailwindcss = __toESM(eslint_plugin_better_tailwindcss);
35
- let eslint_plugin_jsx_a11y = require("eslint-plugin-jsx-a11y");
36
- eslint_plugin_jsx_a11y = __toESM(eslint_plugin_jsx_a11y);
37
35
  let eslint_plugin_playwright = require("eslint-plugin-playwright");
38
36
  eslint_plugin_playwright = __toESM(eslint_plugin_playwright);
39
37
 
@@ -262,33 +260,23 @@ const siberiacancodePlugin = {
262
260
  //#endregion
263
261
  //#region src/index.ts
264
262
  const eslint = (inputOptions = {}, ...configs) => {
265
- const { jsxA11y = false, playwright = false, tailwind = false, typescript = false, ...options } = inputOptions;
263
+ const { playwright = false, tailwind = false, typescript = false, ...options } = inputOptions;
266
264
  const stylistic = options.stylistic ?? false;
267
265
  if (typescript === "engine") configs.unshift({
268
266
  name: "siberiacancode/typescript",
269
267
  files: ["**/*.?([cm])ts", "**/*.?([cm])tsx"],
270
268
  languageOptions: { parserOptions: { projectService: true } },
271
269
  rules: {
270
+ ...options.react && { "react/no-leaked-conditional-rendering": "error" },
272
271
  "ts/promise-function-async": "off",
273
272
  "ts/strict-boolean-expressions": "off",
274
273
  "ts/no-unnecessary-condition": "error",
275
274
  "ts/no-namespace": "off",
276
275
  "ts/no-floating-promises": "off",
277
- "ts/no-misused-promises": "off",
276
+ "ts/no-misused-promises": ["error", { checksVoidReturn: false }],
278
277
  "ts/no-empty-object-type": "warn"
279
278
  }
280
279
  });
281
- if (jsxA11y) {
282
- const jsxA11yRules = eslint_plugin_jsx_a11y.default.flatConfigs.recommended.rules;
283
- configs.unshift({
284
- name: "siberiacancode/jsx-a11y",
285
- plugins: { "siberiacancode-jsx-a11y": eslint_plugin_jsx_a11y.default },
286
- rules: { ...Object.entries(jsxA11yRules).reduce((acc, [key, value]) => {
287
- acc[key.replace("jsx-a11y", "siberiacancode-jsx-a11y")] = value;
288
- return acc;
289
- }, {}) }
290
- });
291
- }
292
280
  if (playwright) {
293
281
  const playwrightRules = eslint_plugin_playwright.default.configs["flat/recommended"].rules;
294
282
  configs.unshift({
@@ -365,7 +353,7 @@ const eslint = (inputOptions = {}, ...configs) => {
365
353
  return (0, _antfu_eslint_config.default)({
366
354
  ...options,
367
355
  stylistic,
368
- ...typescript === "engine" ? { typescript: { tsconfigPath: "./tsconfig.json" } } : typescript
356
+ ...typescript === "engine" ? { typescript: { tsconfigPath: "./tsconfig.json" } } : { typescript }
369
357
  }, {
370
358
  name: "siberiacancode/rewrite",
371
359
  rules: {
@@ -458,6 +446,10 @@ const eslint = (inputOptions = {}, ...configs) => {
458
446
  type: "alphabetical"
459
447
  }]
460
448
  }
449
+ }, {
450
+ name: "siberiacancode/disable/markdown",
451
+ files: ["**/*.md"],
452
+ rules: { "perfectionist/sort-imports": "off" }
461
453
  }, ...configs);
462
454
  };
463
455
 
@@ -1,13 +1,12 @@
1
- import { Awaitable, ConfigNames, OptionsConfig, TypedFlatConfigItem } from "@antfu/eslint-config";
1
+ import { Awaitable, ConfigNames, OptionsConfig, OptionsTypescript, TypedFlatConfigItem } from "@antfu/eslint-config";
2
2
  import { Linter } from "eslint";
3
3
  import { FlatConfigComposer } from "eslint-flat-config-utils";
4
4
 
5
5
  //#region src/index.d.ts
6
6
  type EslintOptions = OptionsConfig & TypedFlatConfigItem & {
7
- jsxA11y?: boolean;
8
7
  playwright?: boolean;
9
8
  tailwind?: boolean;
10
- typescript?: 'engine';
9
+ typescript?: boolean | 'engine' | OptionsTypescript;
11
10
  };
12
11
  type Eslint = (options?: EslintOptions, ...userConfigs: Awaitable<FlatConfigComposer<any, any> | Linter.Config[] | TypedFlatConfigItem | TypedFlatConfigItem[]>[]) => FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
13
12
  declare const eslint: Eslint;
@@ -1,13 +1,12 @@
1
- import { Awaitable, ConfigNames, OptionsConfig, TypedFlatConfigItem } from "@antfu/eslint-config";
1
+ import { Awaitable, ConfigNames, OptionsConfig, OptionsTypescript, TypedFlatConfigItem } from "@antfu/eslint-config";
2
2
  import { Linter } from "eslint";
3
3
  import { FlatConfigComposer } from "eslint-flat-config-utils";
4
4
 
5
5
  //#region src/index.d.ts
6
6
  type EslintOptions = OptionsConfig & TypedFlatConfigItem & {
7
- jsxA11y?: boolean;
8
7
  playwright?: boolean;
9
8
  tailwind?: boolean;
10
- typescript?: 'engine';
9
+ typescript?: boolean | 'engine' | OptionsTypescript;
11
10
  };
12
11
  type Eslint = (options?: EslintOptions, ...userConfigs: Awaitable<FlatConfigComposer<any, any> | Linter.Config[] | TypedFlatConfigItem | TypedFlatConfigItem[]>[]) => FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
13
12
  declare const eslint: Eslint;
@@ -1,7 +1,6 @@
1
1
  import antfu from "@antfu/eslint-config";
2
2
  import pluginCss from "@eslint/css";
3
3
  import pluginBetterTailwindcss from "eslint-plugin-better-tailwindcss";
4
- import pluginJsxA11y from "eslint-plugin-jsx-a11y";
5
4
  import pluginPlaywright from "eslint-plugin-playwright";
6
5
 
7
6
  //#region src/plugin/rules/function-component-definition.ts
@@ -229,33 +228,23 @@ const siberiacancodePlugin = {
229
228
  //#endregion
230
229
  //#region src/index.ts
231
230
  const eslint = (inputOptions = {}, ...configs) => {
232
- const { jsxA11y = false, playwright = false, tailwind = false, typescript = false, ...options } = inputOptions;
231
+ const { playwright = false, tailwind = false, typescript = false, ...options } = inputOptions;
233
232
  const stylistic = options.stylistic ?? false;
234
233
  if (typescript === "engine") configs.unshift({
235
234
  name: "siberiacancode/typescript",
236
235
  files: ["**/*.?([cm])ts", "**/*.?([cm])tsx"],
237
236
  languageOptions: { parserOptions: { projectService: true } },
238
237
  rules: {
238
+ ...options.react && { "react/no-leaked-conditional-rendering": "error" },
239
239
  "ts/promise-function-async": "off",
240
240
  "ts/strict-boolean-expressions": "off",
241
241
  "ts/no-unnecessary-condition": "error",
242
242
  "ts/no-namespace": "off",
243
243
  "ts/no-floating-promises": "off",
244
- "ts/no-misused-promises": "off",
244
+ "ts/no-misused-promises": ["error", { checksVoidReturn: false }],
245
245
  "ts/no-empty-object-type": "warn"
246
246
  }
247
247
  });
248
- if (jsxA11y) {
249
- const jsxA11yRules = pluginJsxA11y.flatConfigs.recommended.rules;
250
- configs.unshift({
251
- name: "siberiacancode/jsx-a11y",
252
- plugins: { "siberiacancode-jsx-a11y": pluginJsxA11y },
253
- rules: { ...Object.entries(jsxA11yRules).reduce((acc, [key, value]) => {
254
- acc[key.replace("jsx-a11y", "siberiacancode-jsx-a11y")] = value;
255
- return acc;
256
- }, {}) }
257
- });
258
- }
259
248
  if (playwright) {
260
249
  const playwrightRules = pluginPlaywright.configs["flat/recommended"].rules;
261
250
  configs.unshift({
@@ -332,7 +321,7 @@ const eslint = (inputOptions = {}, ...configs) => {
332
321
  return antfu({
333
322
  ...options,
334
323
  stylistic,
335
- ...typescript === "engine" ? { typescript: { tsconfigPath: "./tsconfig.json" } } : typescript
324
+ ...typescript === "engine" ? { typescript: { tsconfigPath: "./tsconfig.json" } } : { typescript }
336
325
  }, {
337
326
  name: "siberiacancode/rewrite",
338
327
  rules: {
@@ -425,6 +414,10 @@ const eslint = (inputOptions = {}, ...configs) => {
425
414
  type: "alphabetical"
426
415
  }]
427
416
  }
417
+ }, {
418
+ name: "siberiacancode/disable/markdown",
419
+ files: ["**/*.md"],
420
+ rules: { "perfectionist/sort-imports": "off" }
428
421
  }, ...configs);
429
422
  };
430
423
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@siberiacancode/eslint",
3
3
  "type": "module",
4
- "version": "2.16.5",
4
+ "version": "2.16.7",
5
5
  "description": "eslint configs",
6
6
  "author": {
7
7
  "name": "SIBERIA CAN CODE 🧊",
@@ -45,26 +45,25 @@
45
45
  "dist"
46
46
  ],
47
47
  "scripts": {
48
- "prepublishOnly": "yarn type && yarn build",
48
+ "prepublishOnly": "pnpm type && pnpm build",
49
49
  "build": "tsdown",
50
50
  "lint": "eslint . --fix",
51
51
  "lint-inspector": "npx @eslint/config-inspector",
52
52
  "type": "tsc --noEmit",
53
53
  "format": "prettier --write .",
54
- "pretty": "yarn type && yarn lint && yarn format"
54
+ "pretty": "pnpm type && pnpm lint && pnpm format"
55
55
  },
56
56
  "dependencies": {
57
- "@antfu/eslint-config": "7.4.3",
57
+ "@antfu/eslint-config": "7.7.0",
58
58
  "@eslint-react/eslint-plugin": "2.13.0",
59
- "@eslint/css": "^0.14.1",
59
+ "@eslint/css": "1.0.0",
60
60
  "@next/eslint-plugin-next": "16.1.6",
61
- "@types/eslint-plugin-jsx-a11y": "^6.10.1",
62
- "@vue/compiler-sfc": "3.5.29",
63
- "eslint": "10.0.2",
64
- "eslint-flat-config-utils": "^3.0.1",
65
- "eslint-plugin-better-tailwindcss": "^4.3.2",
66
- "eslint-plugin-jsx-a11y": "6.10.2",
67
- "eslint-plugin-playwright": "^2.9.0",
61
+ "@types/eslint-plugin-jsx-a11y": "6.10.1",
62
+ "@vue/compiler-sfc": "3.5.30",
63
+ "eslint": "10.0.3",
64
+ "eslint-flat-config-utils": "3.0.2",
65
+ "eslint-plugin-better-tailwindcss": "4.3.2",
66
+ "eslint-plugin-playwright": "2.9.0",
68
67
  "eslint-plugin-react-hooks": "7.0.1",
69
68
  "eslint-plugin-react-refresh": "0.5.2"
70
69
  },