@dubium/eslint-config 1.0.0 → 1.0.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 +0 -1
- package/config/base.js +19 -0
- package/config/index.js +3 -0
- package/{src → config}/react.js +13 -3
- package/config/typescript.js +28 -0
- package/package.json +50 -20
- package/src/base.js +0 -21
- package/src/index.js +0 -10
- package/src/typescript.js +0 -21
package/README.md
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# @dubium/eslint-config — конфигурация ESLint.
|
package/config/base.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import globals from "globals";
|
|
2
|
+
|
|
3
|
+
export const base = {
|
|
4
|
+
name: "@dubium/eslint-config/base",
|
|
5
|
+
files: ["**/*.{js,mjs,cjs,jsx,ts,tsx}"],
|
|
6
|
+
languageOptions: {
|
|
7
|
+
ecmaVersion: "latest",
|
|
8
|
+
globals: {
|
|
9
|
+
...globals.browser,
|
|
10
|
+
...globals.commonjs,
|
|
11
|
+
...globals.node,
|
|
12
|
+
...globals.jest,
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
rules: {
|
|
16
|
+
"no-console": "warn",
|
|
17
|
+
strict: ["error", "global"],
|
|
18
|
+
},
|
|
19
|
+
};
|
package/config/index.js
ADDED
package/{src → config}/react.js
RENAMED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import pluginReact from "eslint-plugin-react";
|
|
2
|
+
import reactRefresh from "eslint-plugin-react-refresh";
|
|
2
3
|
import pluginReactHooks from "eslint-plugin-react-hooks";
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
files: ["**/*.{jsx,tsx}"],
|
|
5
|
+
export const react = {
|
|
6
|
+
name: "@dubium/eslint-config/react",
|
|
7
|
+
files: ["**/*.{jsx,js,ts,tsx}"],
|
|
8
|
+
languageOptions: {
|
|
9
|
+
parserOptions: {
|
|
10
|
+
ecmaFeatures: {
|
|
11
|
+
jsx: true,
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
},
|
|
7
15
|
plugins: {
|
|
8
16
|
react: pluginReact,
|
|
9
17
|
"react-hooks": pluginReactHooks,
|
|
18
|
+
"react-refresh": reactRefresh,
|
|
10
19
|
},
|
|
11
20
|
settings: {
|
|
12
21
|
react: {
|
|
@@ -18,5 +27,6 @@ export default {
|
|
|
18
27
|
"react/react-in-jsx-scope": "off",
|
|
19
28
|
"react-hooks/rules-of-hooks": "error",
|
|
20
29
|
"react-hooks/exhaustive-deps": "warn",
|
|
30
|
+
"react-refresh/only-export-components": ["warn"],
|
|
21
31
|
},
|
|
22
32
|
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import tsParser from "@typescript-eslint/parser";
|
|
2
|
+
import tsPlugin from "@typescript-eslint/eslint-plugin";
|
|
3
|
+
|
|
4
|
+
export const typescript = {
|
|
5
|
+
name: "@dubium/eslint-config/typescript",
|
|
6
|
+
files: ["**/*.{ts,tsx}"],
|
|
7
|
+
languageOptions: {
|
|
8
|
+
parser: tsParser,
|
|
9
|
+
parserOptions: {
|
|
10
|
+
project: "./tsconfig.json",
|
|
11
|
+
tsconfigRootDir: process.cwd(),
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
plugins: {
|
|
15
|
+
"@typescript-eslint": tsPlugin,
|
|
16
|
+
},
|
|
17
|
+
rules: {
|
|
18
|
+
"@typescript-eslint/no-explicit-any": "warn",
|
|
19
|
+
"@typescript-eslint/consistent-type-imports": "error",
|
|
20
|
+
"@typescript-eslint/no-unused-vars": ["warn"],
|
|
21
|
+
"@typescript-eslint/no-unsafe-argument": "error",
|
|
22
|
+
"@typescript-eslint/no-unsafe-assignment": "error",
|
|
23
|
+
"@typescript-eslint/no-unsafe-call": "error",
|
|
24
|
+
"@typescript-eslint/no-unsafe-member-access": "error",
|
|
25
|
+
"@typescript-eslint/require-await": "warn",
|
|
26
|
+
"@typescript-eslint/await-thenable": "warn",
|
|
27
|
+
},
|
|
28
|
+
};
|
package/package.json
CHANGED
|
@@ -1,30 +1,60 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dubium/eslint-config",
|
|
3
|
-
"
|
|
3
|
+
"private": false,
|
|
4
|
+
"version": "1.0.2",
|
|
4
5
|
"type": "module",
|
|
5
|
-
"main": "./
|
|
6
|
+
"main": "./config/index.js",
|
|
6
7
|
"exports": {
|
|
7
|
-
".": "./
|
|
8
|
-
"./base": "./
|
|
9
|
-
"./react": "./
|
|
10
|
-
"./typescript": "./
|
|
8
|
+
".": "./config/index.js",
|
|
9
|
+
"./base": "./config/base.js",
|
|
10
|
+
"./react": "./config/react.js",
|
|
11
|
+
"./typescript": "./config/typescript.js"
|
|
11
12
|
},
|
|
12
13
|
"files": [
|
|
13
|
-
"
|
|
14
|
+
"config",
|
|
15
|
+
"README.md",
|
|
16
|
+
"LICENSE"
|
|
14
17
|
],
|
|
15
|
-
"
|
|
16
|
-
"eslint": ">=9.0.0",
|
|
17
|
-
"typescript": ">=5.0.0",
|
|
18
|
-
"react": ">=18.0.0",
|
|
19
|
-
"@typescript-eslint/parser": "^8.0.0",
|
|
20
|
-
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
21
|
-
"eslint-plugin-react": "^7.33.0",
|
|
22
|
-
"eslint-plugin-react-hooks": "^4.6.0"
|
|
23
|
-
},
|
|
18
|
+
"description": "",
|
|
24
19
|
"keywords": [
|
|
25
20
|
"eslint",
|
|
26
|
-
"eslintconfig"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
"eslintconfig"
|
|
22
|
+
],
|
|
23
|
+
"homepage": "https://github.com/DubiumEkb/dubium-design/",
|
|
24
|
+
"bugs": {
|
|
25
|
+
"url": "https://github.com/DubiumEkb/dubium-design/issues"
|
|
26
|
+
},
|
|
27
|
+
"repository": "https://github.com/DubiumEkb/dubium-design",
|
|
28
|
+
"author": "https://github.com/DubiumEkb",
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"scripts": {
|
|
31
|
+
"dev": "vite",
|
|
32
|
+
"lint:inspect": "npx eslint --inspect-config",
|
|
33
|
+
"lint": "eslint --no-cache .",
|
|
34
|
+
"lint:write": "eslint --debug --no-cache src/",
|
|
35
|
+
"build": "tsc -b && vite build",
|
|
36
|
+
"preview": "vite preview"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"eslint": "^9.0.0"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"react": ">=19.1.0",
|
|
43
|
+
"react-dom": "^19.1.0"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@eslint/js": "^9.24.0",
|
|
47
|
+
"@types/react": "^19.1.0",
|
|
48
|
+
"@types/react-dom": "^19.1.2",
|
|
49
|
+
"@typescript-eslint/eslint-plugin": "^8.29.1",
|
|
50
|
+
"@typescript-eslint/parser": "^8.29.1",
|
|
51
|
+
"@vitejs/plugin-react-swc": "^3.8.1",
|
|
52
|
+
"eslint": ">=9.24.0",
|
|
53
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
54
|
+
"eslint-plugin-react-refresh": "^0.4.19",
|
|
55
|
+
"globals": "^16.0.0",
|
|
56
|
+
"typescript": "^5.8.3",
|
|
57
|
+
"typescript-eslint": "^8.29.1",
|
|
58
|
+
"vite": "^6.2.6"
|
|
59
|
+
}
|
|
30
60
|
}
|
package/src/base.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import globals from "globals";
|
|
2
|
-
|
|
3
|
-
/** @type {import('eslint').Linter.FlatConfig} */
|
|
4
|
-
export default {
|
|
5
|
-
files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"], // Все JS/TS файлы
|
|
6
|
-
languageOptions: {
|
|
7
|
-
ecmaVersion: "latest",
|
|
8
|
-
sourceType: "module",
|
|
9
|
-
globals: {
|
|
10
|
-
...globals.browser,
|
|
11
|
-
...globals.node,
|
|
12
|
-
...globals.es2021,
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
rules: {
|
|
16
|
-
"no-console": process.env.NODE_ENV === "production" ? "error" : "warn",
|
|
17
|
-
semi: ["error", "always"],
|
|
18
|
-
quotes: ["error", "single"],
|
|
19
|
-
eqeqeq: ["error", "always"],
|
|
20
|
-
},
|
|
21
|
-
};
|
package/src/index.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import base from "./base.js";
|
|
2
|
-
import react from "./react.js";
|
|
3
|
-
import typescript from "./typescript.js";
|
|
4
|
-
|
|
5
|
-
/** @type {import('eslint').Linter.FlatConfig[]} */
|
|
6
|
-
const all = [base, react, typescript];
|
|
7
|
-
|
|
8
|
-
export { base, react, typescript };
|
|
9
|
-
export default all;
|
|
10
|
-
|
package/src/typescript.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import tsParser from "@typescript-eslint/parser";
|
|
2
|
-
import tsPlugin from "@typescript-eslint/eslint-plugin";
|
|
3
|
-
|
|
4
|
-
/** @type {import('eslint').Linter.FlatConfig} */
|
|
5
|
-
export default {
|
|
6
|
-
files: ["**/*.{ts,tsx}"], // Только TS/TSX
|
|
7
|
-
languageOptions: {
|
|
8
|
-
parser: tsParser,
|
|
9
|
-
parserOptions: {
|
|
10
|
-
project: true, // Автопоиск tsconfig.json
|
|
11
|
-
tsconfigRootDir: process.cwd(),
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
plugins: {
|
|
15
|
-
"@typescript-eslint": tsPlugin,
|
|
16
|
-
},
|
|
17
|
-
rules: {
|
|
18
|
-
"@typescript-eslint/no-explicit-any": "warn",
|
|
19
|
-
"@typescript-eslint/consistent-type-imports": "error",
|
|
20
|
-
},
|
|
21
|
-
};
|