@dubium/eslint-config 1.0.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 +1 -0
- package/package.json +30 -0
- package/src/base.js +21 -0
- package/src/index.js +10 -0
- package/src/react.js +22 -0
- package/src/typescript.js +21 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# @dubium/eslint-config — конфигурация ESLint.
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dubium/eslint-config",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./src/index.js",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./src/index.js",
|
|
8
|
+
"./base": "./src/base.js",
|
|
9
|
+
"./react": "./src/react.js",
|
|
10
|
+
"./typescript": "./src/typescript.js"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"src"
|
|
14
|
+
],
|
|
15
|
+
"peerDependencies": {
|
|
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
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"eslint",
|
|
26
|
+
"eslintconfig",
|
|
27
|
+
"react",
|
|
28
|
+
"typescript"
|
|
29
|
+
]
|
|
30
|
+
}
|
package/src/base.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
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/react.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import pluginReact from "eslint-plugin-react";
|
|
2
|
+
import pluginReactHooks from "eslint-plugin-react-hooks";
|
|
3
|
+
|
|
4
|
+
/** @type {import('eslint').Linter.FlatConfig} */
|
|
5
|
+
export default {
|
|
6
|
+
files: ["**/*.{jsx,tsx}"], // Только JSX/TSX
|
|
7
|
+
plugins: {
|
|
8
|
+
react: pluginReact,
|
|
9
|
+
"react-hooks": pluginReactHooks,
|
|
10
|
+
},
|
|
11
|
+
settings: {
|
|
12
|
+
react: {
|
|
13
|
+
version: "detect",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
rules: {
|
|
17
|
+
"react/jsx-uses-react": "error",
|
|
18
|
+
"react/react-in-jsx-scope": "off",
|
|
19
|
+
"react-hooks/rules-of-hooks": "error",
|
|
20
|
+
"react-hooks/exhaustive-deps": "warn",
|
|
21
|
+
},
|
|
22
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
};
|