@siberiacancode/eslint 2.16.2 → 2.16.4
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 +18 -6
- package/dist/cjs/index.d.cts +1 -0
- package/dist/esm/index.d.mts +1 -0
- package/dist/esm/index.mjs +16 -4
- package/package.json +2 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -30,16 +30,16 @@ 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");
|
|
36
38
|
eslint_plugin_playwright = __toESM(eslint_plugin_playwright);
|
|
37
|
-
let node_path = require("node:path");
|
|
38
|
-
node_path = __toESM(node_path);
|
|
39
|
-
let node_process = require("node:process");
|
|
40
|
-
node_process = __toESM(node_process);
|
|
41
39
|
let node_fs = require("node:fs");
|
|
42
40
|
node_fs = __toESM(node_fs);
|
|
41
|
+
let node_path = require("node:path");
|
|
42
|
+
node_path = __toESM(node_path);
|
|
43
43
|
|
|
44
44
|
//#region src/plugin/rules/function-component-definition.ts
|
|
45
45
|
const NAMED_TEMPLATES = {
|
|
@@ -394,11 +394,12 @@ const siberiacancodePlugin = {
|
|
|
394
394
|
//#endregion
|
|
395
395
|
//#region src/index.ts
|
|
396
396
|
const eslint = (inputOptions = {}, ...configs) => {
|
|
397
|
-
const { jsxA11y = false, playwright = false, typescript = false, ...options } = inputOptions;
|
|
397
|
+
const { jsxA11y = false, playwright = false, tailwind = false, typescript = false, ...options } = inputOptions;
|
|
398
398
|
const stylistic = options.stylistic ?? false;
|
|
399
399
|
if (typescript === "engine") configs.unshift({
|
|
400
400
|
name: "siberiacancode/typescript",
|
|
401
401
|
files: ["**/*.?([cm])ts", "**/*.?([cm])tsx"],
|
|
402
|
+
languageOptions: { parserOptions: { projectService: true } },
|
|
402
403
|
rules: {
|
|
403
404
|
"ts/promise-function-async": "off",
|
|
404
405
|
"ts/strict-boolean-expressions": "off",
|
|
@@ -431,6 +432,17 @@ const eslint = (inputOptions = {}, ...configs) => {
|
|
|
431
432
|
}, {}) }
|
|
432
433
|
});
|
|
433
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
|
+
}
|
|
434
446
|
if (stylistic) configs.unshift({
|
|
435
447
|
name: "siberiacancode/formatter",
|
|
436
448
|
rules: {
|
|
@@ -488,7 +500,7 @@ const eslint = (inputOptions = {}, ...configs) => {
|
|
|
488
500
|
return (0, _antfu_eslint_config.default)({
|
|
489
501
|
...options,
|
|
490
502
|
stylistic,
|
|
491
|
-
...typescript === "engine" ? { typescript: { tsconfigPath:
|
|
503
|
+
...typescript === "engine" ? { typescript: { tsconfigPath: "./tsconfig.json" } } : typescript
|
|
492
504
|
}, {
|
|
493
505
|
name: "siberiacancode/rewrite",
|
|
494
506
|
rules: {
|
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,10 +1,10 @@
|
|
|
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
|
-
import path from "node:path";
|
|
6
|
-
import process from "node:process";
|
|
7
6
|
import fs from "node:fs";
|
|
7
|
+
import path from "node:path";
|
|
8
8
|
|
|
9
9
|
//#region src/plugin/rules/function-component-definition.ts
|
|
10
10
|
const NAMED_TEMPLATES = {
|
|
@@ -359,11 +359,12 @@ const siberiacancodePlugin = {
|
|
|
359
359
|
//#endregion
|
|
360
360
|
//#region src/index.ts
|
|
361
361
|
const eslint = (inputOptions = {}, ...configs) => {
|
|
362
|
-
const { jsxA11y = false, playwright = false, typescript = false, ...options } = inputOptions;
|
|
362
|
+
const { jsxA11y = false, playwright = false, tailwind = false, typescript = false, ...options } = inputOptions;
|
|
363
363
|
const stylistic = options.stylistic ?? false;
|
|
364
364
|
if (typescript === "engine") configs.unshift({
|
|
365
365
|
name: "siberiacancode/typescript",
|
|
366
366
|
files: ["**/*.?([cm])ts", "**/*.?([cm])tsx"],
|
|
367
|
+
languageOptions: { parserOptions: { projectService: true } },
|
|
367
368
|
rules: {
|
|
368
369
|
"ts/promise-function-async": "off",
|
|
369
370
|
"ts/strict-boolean-expressions": "off",
|
|
@@ -396,6 +397,17 @@ const eslint = (inputOptions = {}, ...configs) => {
|
|
|
396
397
|
}, {}) }
|
|
397
398
|
});
|
|
398
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
|
+
}
|
|
399
411
|
if (stylistic) configs.unshift({
|
|
400
412
|
name: "siberiacancode/formatter",
|
|
401
413
|
rules: {
|
|
@@ -453,7 +465,7 @@ const eslint = (inputOptions = {}, ...configs) => {
|
|
|
453
465
|
return antfu({
|
|
454
466
|
...options,
|
|
455
467
|
stylistic,
|
|
456
|
-
...typescript === "engine" ? { typescript: { tsconfigPath:
|
|
468
|
+
...typescript === "engine" ? { typescript: { tsconfigPath: "./tsconfig.json" } } : typescript
|
|
457
469
|
}, {
|
|
458
470
|
name: "siberiacancode/rewrite",
|
|
459
471
|
rules: {
|
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.4",
|
|
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",
|