@paratco/eslint-config 0.2.0 → 0.3.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/eslint.config.mjs
CHANGED
|
@@ -12,8 +12,8 @@ import reactRefresh from 'eslint-plugin-react-refresh';
|
|
|
12
12
|
import eslintConfigPrettier from 'eslint-config-prettier';
|
|
13
13
|
|
|
14
14
|
// Custom Rules
|
|
15
|
-
import typescriptRules from './lints/typescript/index.js';
|
|
16
|
-
import reactRules from './lints/react/index.js';
|
|
15
|
+
import typescriptRules from './src/lints/typescript/index.js';
|
|
16
|
+
import reactRules from './src/lints/react/index.js';
|
|
17
17
|
|
|
18
18
|
export default [
|
|
19
19
|
// Set predefined configs
|
package/index.js
CHANGED
|
@@ -1,81 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import tseslint from "typescript-eslint";
|
|
1
|
+
import baseConfig from "./src/configs/base.js";
|
|
2
|
+
import reactConfig from "./src/configs/react.js";
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import react from "eslint-plugin-react";
|
|
10
|
-
import reactHooks from "eslint-plugin-react-hooks";
|
|
11
|
-
import reactRefresh from "eslint-plugin-react-refresh";
|
|
12
|
-
import eslintConfigPrettier from "eslint-config-prettier";
|
|
13
|
-
|
|
14
|
-
// Custom Rules
|
|
15
|
-
import typescriptRules from "./lints/typescript/index.js";
|
|
16
|
-
import reactRules from "./lints/react/index.js";
|
|
17
|
-
|
|
18
|
-
export default [
|
|
19
|
-
// Set predefined configs
|
|
20
|
-
eslint.configs.recommended,
|
|
21
|
-
...tseslint.configs.strictTypeChecked,
|
|
22
|
-
...tseslint.configs.stylisticTypeChecked,
|
|
23
|
-
|
|
24
|
-
// Browser Only
|
|
25
|
-
{ languageOptions: { globals: globals.browser } },
|
|
26
|
-
|
|
27
|
-
// Enable JSX
|
|
28
|
-
{ files: ["**/*.tsx"], languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } } },
|
|
29
|
-
|
|
30
|
-
// TypeScript Rules
|
|
31
|
-
{
|
|
32
|
-
files: ["**/*.{ts,tsx}"],
|
|
33
|
-
rules: {
|
|
34
|
-
...typescriptRules
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
// React Plugin
|
|
39
|
-
{
|
|
40
|
-
files: ["**/*.{js,jsx,mjs,cjs,ts,tsx}"],
|
|
41
|
-
plugins: {
|
|
42
|
-
react: fixupPluginRules(react),
|
|
43
|
-
"react-hooks": reactHooks,
|
|
44
|
-
"react-refresh": reactRefresh
|
|
45
|
-
},
|
|
46
|
-
settings: {
|
|
47
|
-
react: {
|
|
48
|
-
version: "detect"
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
languageOptions: {
|
|
52
|
-
parserOptions: {
|
|
53
|
-
ecmaFeatures: {
|
|
54
|
-
jsx: true
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
globals: {
|
|
58
|
-
...globals.browser
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
rules: {
|
|
62
|
-
...reactRules,
|
|
63
|
-
// ...react.configs.recommended.rules,
|
|
64
|
-
...reactHooks.configs.recommended.rules,
|
|
65
|
-
|
|
66
|
-
// Enforce Rules of Hooks
|
|
67
|
-
"react-hooks/rules-of-hooks": ["error"],
|
|
68
|
-
// Verify the list of the dependencies for Hooks like useEffect and similar
|
|
69
|
-
"react-hooks/exhaustive-deps": ["error"],
|
|
70
|
-
|
|
71
|
-
// React Refresh
|
|
72
|
-
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }]
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
{
|
|
77
|
-
ignores: ["lints"]
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
eslintConfigPrettier
|
|
81
|
-
];
|
|
4
|
+
export default {
|
|
5
|
+
base: baseConfig,
|
|
6
|
+
react: reactConfig
|
|
7
|
+
};
|
package/package.json
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import eslint from "@eslint/js";
|
|
2
|
+
import tseslint from "typescript-eslint";
|
|
3
|
+
|
|
4
|
+
// Plugins
|
|
5
|
+
import eslintConfigPrettier from "eslint-config-prettier";
|
|
6
|
+
|
|
7
|
+
// Custom Rules
|
|
8
|
+
import typescriptRules from "../lints/typescript/index.js";
|
|
9
|
+
|
|
10
|
+
export default [
|
|
11
|
+
// Set predefined configs
|
|
12
|
+
eslint.configs.recommended,
|
|
13
|
+
...tseslint.configs.strictTypeChecked,
|
|
14
|
+
...tseslint.configs.stylisticTypeChecked,
|
|
15
|
+
|
|
16
|
+
// TypeScript Rules
|
|
17
|
+
{
|
|
18
|
+
files: ["**/*.{ts,tsx}"],
|
|
19
|
+
rules: {
|
|
20
|
+
...typescriptRules
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
eslintConfigPrettier
|
|
25
|
+
];
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import globals from "globals";
|
|
2
|
+
|
|
3
|
+
// Fix plugins compatibility with ESLint 9.x
|
|
4
|
+
import { fixupPluginRules } from "@eslint/compat";
|
|
5
|
+
|
|
6
|
+
// Plugins
|
|
7
|
+
import react from "eslint-plugin-react";
|
|
8
|
+
import reactHooks from "eslint-plugin-react-hooks";
|
|
9
|
+
import reactRefresh from "eslint-plugin-react-refresh";
|
|
10
|
+
|
|
11
|
+
// Custom Rules
|
|
12
|
+
import reactRules from "../lints/react/index.js";
|
|
13
|
+
|
|
14
|
+
export default [
|
|
15
|
+
// Browser Only
|
|
16
|
+
{ languageOptions: { globals: globals.browser } },
|
|
17
|
+
|
|
18
|
+
// Enable JSX
|
|
19
|
+
{ files: ["**/*.tsx"], languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } } },
|
|
20
|
+
|
|
21
|
+
// React Plugin
|
|
22
|
+
{
|
|
23
|
+
files: ["**/*.{js,jsx,mjs,cjs,ts,tsx}"],
|
|
24
|
+
plugins: {
|
|
25
|
+
react: fixupPluginRules(react),
|
|
26
|
+
"react-hooks": reactHooks,
|
|
27
|
+
"react-refresh": reactRefresh
|
|
28
|
+
},
|
|
29
|
+
settings: {
|
|
30
|
+
react: {
|
|
31
|
+
version: "detect"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
languageOptions: {
|
|
35
|
+
parserOptions: {
|
|
36
|
+
ecmaFeatures: {
|
|
37
|
+
jsx: true
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
globals: {
|
|
41
|
+
...globals.browser
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
rules: {
|
|
45
|
+
...reactRules,
|
|
46
|
+
// ...react.configs.recommended.rules,
|
|
47
|
+
...reactHooks.configs.recommended.rules,
|
|
48
|
+
|
|
49
|
+
// Enforce Rules of Hooks
|
|
50
|
+
"react-hooks/rules-of-hooks": ["error"],
|
|
51
|
+
// Verify the list of the dependencies for Hooks like useEffect and similar
|
|
52
|
+
"react-hooks/exhaustive-deps": ["error"],
|
|
53
|
+
|
|
54
|
+
// React Refresh
|
|
55
|
+
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }]
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
];
|
|
File without changes
|
|
File without changes
|