@siberiacancode/eslint 2.16.1 → 2.16.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/cjs/index.cjs +25 -10
- package/dist/cjs/index.d.cts +1 -0
- package/dist/esm/index.d.mts +1 -0
- package/dist/esm/index.mjs +24 -10
- package/package.json +2 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -30,6 +30,8 @@ let _antfu_eslint_config = require("@antfu/eslint-config");
|
|
|
30
30
|
_antfu_eslint_config = __toESM(_antfu_eslint_config);
|
|
31
31
|
let _eslint_css = require("@eslint/css");
|
|
32
32
|
_eslint_css = __toESM(_eslint_css);
|
|
33
|
+
let eslint_plugin_better_tailwindcss = require("eslint-plugin-better-tailwindcss");
|
|
34
|
+
eslint_plugin_better_tailwindcss = __toESM(eslint_plugin_better_tailwindcss);
|
|
33
35
|
let eslint_plugin_jsx_a11y = require("eslint-plugin-jsx-a11y");
|
|
34
36
|
eslint_plugin_jsx_a11y = __toESM(eslint_plugin_jsx_a11y);
|
|
35
37
|
let eslint_plugin_playwright = require("eslint-plugin-playwright");
|
|
@@ -392,11 +394,12 @@ const siberiacancodePlugin = {
|
|
|
392
394
|
//#endregion
|
|
393
395
|
//#region src/index.ts
|
|
394
396
|
const eslint = (inputOptions = {}, ...configs) => {
|
|
395
|
-
const { jsxA11y = false, playwright = false, typescript = false, ...options } = inputOptions;
|
|
397
|
+
const { jsxA11y = false, playwright = false, tailwind = false, typescript = false, ...options } = inputOptions;
|
|
396
398
|
const stylistic = options.stylistic ?? false;
|
|
397
399
|
if (typescript === "engine") configs.unshift({
|
|
398
400
|
name: "siberiacancode/typescript",
|
|
399
401
|
files: ["**/*.?([cm])ts", "**/*.?([cm])tsx"],
|
|
402
|
+
languageOptions: { parserOptions: { projectService: true } },
|
|
400
403
|
rules: {
|
|
401
404
|
"ts/promise-function-async": "off",
|
|
402
405
|
"ts/strict-boolean-expressions": "off",
|
|
@@ -429,6 +432,17 @@ const eslint = (inputOptions = {}, ...configs) => {
|
|
|
429
432
|
}, {}) }
|
|
430
433
|
});
|
|
431
434
|
}
|
|
435
|
+
if (tailwind) {
|
|
436
|
+
const tailwindRules = eslint_plugin_better_tailwindcss.default.configs.recommended.rules;
|
|
437
|
+
configs.unshift({
|
|
438
|
+
name: "siberiacancode/tailwind",
|
|
439
|
+
plugins: { "siberiacancode-tailwind": eslint_plugin_better_tailwindcss.default },
|
|
440
|
+
rules: { ...Object.entries(tailwindRules).reduce((acc, [key, value]) => {
|
|
441
|
+
acc[key.replace("better-tailwindcss", "siberiacancode-tailwind")] = value;
|
|
442
|
+
return acc;
|
|
443
|
+
}, {}) }
|
|
444
|
+
});
|
|
445
|
+
}
|
|
432
446
|
if (stylistic) configs.unshift({
|
|
433
447
|
name: "siberiacancode/formatter",
|
|
434
448
|
rules: {
|
|
@@ -467,14 +481,6 @@ const eslint = (inputOptions = {}, ...configs) => {
|
|
|
467
481
|
"style/semi": ["error", "always"]
|
|
468
482
|
}
|
|
469
483
|
});
|
|
470
|
-
configs.unshift({
|
|
471
|
-
name: "siberiacancode",
|
|
472
|
-
plugins: { siberiacancode: siberiacancodePlugin },
|
|
473
|
-
rules: {
|
|
474
|
-
"siberiacancode/function-component-definition": ["error", { namedComponents: ["arrow-function"] }],
|
|
475
|
-
"siberiacancode/no-unused-class": "error"
|
|
476
|
-
}
|
|
477
|
-
});
|
|
478
484
|
configs.unshift({
|
|
479
485
|
name: "siberiacancode/css",
|
|
480
486
|
plugins: { "siberiacancode-css": _eslint_css.default },
|
|
@@ -483,10 +489,18 @@ const eslint = (inputOptions = {}, ...configs) => {
|
|
|
483
489
|
return acc;
|
|
484
490
|
}, {}) }
|
|
485
491
|
});
|
|
492
|
+
configs.unshift({
|
|
493
|
+
name: "siberiacancode",
|
|
494
|
+
plugins: { siberiacancode: siberiacancodePlugin },
|
|
495
|
+
rules: {
|
|
496
|
+
"siberiacancode/function-component-definition": ["error", { namedComponents: ["arrow-function"] }],
|
|
497
|
+
"siberiacancode/no-unused-class": "error"
|
|
498
|
+
}
|
|
499
|
+
});
|
|
486
500
|
return (0, _antfu_eslint_config.default)({
|
|
487
501
|
...options,
|
|
488
502
|
stylistic,
|
|
489
|
-
...typescript
|
|
503
|
+
...typescript ? { typescript: { tsconfigPath: "./tsconfig.json" } } : typescript
|
|
490
504
|
}, {
|
|
491
505
|
name: "siberiacancode/rewrite",
|
|
492
506
|
rules: {
|
|
@@ -494,6 +508,7 @@ const eslint = (inputOptions = {}, ...configs) => {
|
|
|
494
508
|
"antfu/if-newline": "off",
|
|
495
509
|
"antfu/top-level-function": "off",
|
|
496
510
|
"no-console": "warn",
|
|
511
|
+
"react/prefer-namespace-import": "off",
|
|
497
512
|
"react-hooks/exhaustive-deps": "off",
|
|
498
513
|
"test/prefer-lowercase-title": "off"
|
|
499
514
|
}
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -6,6 +6,7 @@ import { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
|
6
6
|
type EslintOptions = OptionsConfig & TypedFlatConfigItem & {
|
|
7
7
|
jsxA11y?: boolean;
|
|
8
8
|
playwright?: boolean;
|
|
9
|
+
tailwind?: boolean;
|
|
9
10
|
typescript?: 'engine';
|
|
10
11
|
};
|
|
11
12
|
type Eslint = (options?: EslintOptions, ...userConfigs: Awaitable<FlatConfigComposer<any, any> | Linter.Config[] | TypedFlatConfigItem | TypedFlatConfigItem[]>[]) => FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
|
package/dist/esm/index.d.mts
CHANGED
|
@@ -6,6 +6,7 @@ import { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
|
6
6
|
type EslintOptions = OptionsConfig & TypedFlatConfigItem & {
|
|
7
7
|
jsxA11y?: boolean;
|
|
8
8
|
playwright?: boolean;
|
|
9
|
+
tailwind?: boolean;
|
|
9
10
|
typescript?: 'engine';
|
|
10
11
|
};
|
|
11
12
|
type Eslint = (options?: EslintOptions, ...userConfigs: Awaitable<FlatConfigComposer<any, any> | Linter.Config[] | TypedFlatConfigItem | TypedFlatConfigItem[]>[]) => FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import antfu from "@antfu/eslint-config";
|
|
2
2
|
import pluginCss from "@eslint/css";
|
|
3
|
+
import pluginBetterTailwindcss from "eslint-plugin-better-tailwindcss";
|
|
3
4
|
import pluginJsxA11y from "eslint-plugin-jsx-a11y";
|
|
4
5
|
import pluginPlaywright from "eslint-plugin-playwright";
|
|
5
6
|
import fs from "node:fs";
|
|
@@ -358,11 +359,12 @@ const siberiacancodePlugin = {
|
|
|
358
359
|
//#endregion
|
|
359
360
|
//#region src/index.ts
|
|
360
361
|
const eslint = (inputOptions = {}, ...configs) => {
|
|
361
|
-
const { jsxA11y = false, playwright = false, typescript = false, ...options } = inputOptions;
|
|
362
|
+
const { jsxA11y = false, playwright = false, tailwind = false, typescript = false, ...options } = inputOptions;
|
|
362
363
|
const stylistic = options.stylistic ?? false;
|
|
363
364
|
if (typescript === "engine") configs.unshift({
|
|
364
365
|
name: "siberiacancode/typescript",
|
|
365
366
|
files: ["**/*.?([cm])ts", "**/*.?([cm])tsx"],
|
|
367
|
+
languageOptions: { parserOptions: { projectService: true } },
|
|
366
368
|
rules: {
|
|
367
369
|
"ts/promise-function-async": "off",
|
|
368
370
|
"ts/strict-boolean-expressions": "off",
|
|
@@ -395,6 +397,17 @@ const eslint = (inputOptions = {}, ...configs) => {
|
|
|
395
397
|
}, {}) }
|
|
396
398
|
});
|
|
397
399
|
}
|
|
400
|
+
if (tailwind) {
|
|
401
|
+
const tailwindRules = pluginBetterTailwindcss.configs.recommended.rules;
|
|
402
|
+
configs.unshift({
|
|
403
|
+
name: "siberiacancode/tailwind",
|
|
404
|
+
plugins: { "siberiacancode-tailwind": pluginBetterTailwindcss },
|
|
405
|
+
rules: { ...Object.entries(tailwindRules).reduce((acc, [key, value]) => {
|
|
406
|
+
acc[key.replace("better-tailwindcss", "siberiacancode-tailwind")] = value;
|
|
407
|
+
return acc;
|
|
408
|
+
}, {}) }
|
|
409
|
+
});
|
|
410
|
+
}
|
|
398
411
|
if (stylistic) configs.unshift({
|
|
399
412
|
name: "siberiacancode/formatter",
|
|
400
413
|
rules: {
|
|
@@ -433,14 +446,6 @@ const eslint = (inputOptions = {}, ...configs) => {
|
|
|
433
446
|
"style/semi": ["error", "always"]
|
|
434
447
|
}
|
|
435
448
|
});
|
|
436
|
-
configs.unshift({
|
|
437
|
-
name: "siberiacancode",
|
|
438
|
-
plugins: { siberiacancode: siberiacancodePlugin },
|
|
439
|
-
rules: {
|
|
440
|
-
"siberiacancode/function-component-definition": ["error", { namedComponents: ["arrow-function"] }],
|
|
441
|
-
"siberiacancode/no-unused-class": "error"
|
|
442
|
-
}
|
|
443
|
-
});
|
|
444
449
|
configs.unshift({
|
|
445
450
|
name: "siberiacancode/css",
|
|
446
451
|
plugins: { "siberiacancode-css": pluginCss },
|
|
@@ -449,10 +454,18 @@ const eslint = (inputOptions = {}, ...configs) => {
|
|
|
449
454
|
return acc;
|
|
450
455
|
}, {}) }
|
|
451
456
|
});
|
|
457
|
+
configs.unshift({
|
|
458
|
+
name: "siberiacancode",
|
|
459
|
+
plugins: { siberiacancode: siberiacancodePlugin },
|
|
460
|
+
rules: {
|
|
461
|
+
"siberiacancode/function-component-definition": ["error", { namedComponents: ["arrow-function"] }],
|
|
462
|
+
"siberiacancode/no-unused-class": "error"
|
|
463
|
+
}
|
|
464
|
+
});
|
|
452
465
|
return antfu({
|
|
453
466
|
...options,
|
|
454
467
|
stylistic,
|
|
455
|
-
...typescript
|
|
468
|
+
...typescript ? { typescript: { tsconfigPath: "./tsconfig.json" } } : typescript
|
|
456
469
|
}, {
|
|
457
470
|
name: "siberiacancode/rewrite",
|
|
458
471
|
rules: {
|
|
@@ -460,6 +473,7 @@ const eslint = (inputOptions = {}, ...configs) => {
|
|
|
460
473
|
"antfu/if-newline": "off",
|
|
461
474
|
"antfu/top-level-function": "off",
|
|
462
475
|
"no-console": "warn",
|
|
476
|
+
"react/prefer-namespace-import": "off",
|
|
463
477
|
"react-hooks/exhaustive-deps": "off",
|
|
464
478
|
"test/prefer-lowercase-title": "off"
|
|
465
479
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@siberiacancode/eslint",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.16.
|
|
4
|
+
"version": "2.16.3",
|
|
5
5
|
"description": "eslint configs",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "SIBERIA CAN CODE 🧊",
|
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
"@vue/compiler-sfc": "3.5.29",
|
|
63
63
|
"eslint": "10.0.2",
|
|
64
64
|
"eslint-flat-config-utils": "^3.0.1",
|
|
65
|
+
"eslint-plugin-better-tailwindcss": "^4.3.2",
|
|
65
66
|
"eslint-plugin-jsx-a11y": "6.10.2",
|
|
66
67
|
"eslint-plugin-playwright": "^2.9.0",
|
|
67
68
|
"eslint-plugin-react-hooks": "7.0.1",
|