@ciridae/configs 0.1.0 → 0.2.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/CHANGELOG.md +6 -0
- package/eslint.js +20 -42
- package/package.json +7 -10
package/CHANGELOG.md
CHANGED
package/eslint.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { fixupPluginRules } from "@eslint/compat";
|
|
2
|
+
import eslintReact from "@eslint-react/eslint-plugin";
|
|
2
3
|
import js from "@eslint/js";
|
|
3
|
-
import
|
|
4
|
-
import react from "eslint-plugin-react";
|
|
4
|
+
import { createNodeResolver, importX } from "eslint-plugin-import-x";
|
|
5
5
|
import globals from "globals";
|
|
6
6
|
import reactHooks from "eslint-plugin-react-hooks";
|
|
7
|
-
import legacyReactHooks from "eslint-plugin-react-hooks-legacy";
|
|
8
7
|
import reactRefresh from "eslint-plugin-react-refresh";
|
|
9
|
-
import legacyReactRefresh from "eslint-plugin-react-refresh-legacy";
|
|
10
8
|
import tailwindcss from "eslint-plugin-tailwindcss";
|
|
11
|
-
import legacyTailwindcss from "eslint-plugin-tailwindcss-legacy";
|
|
12
9
|
import tseslint from "typescript-eslint";
|
|
13
10
|
|
|
14
11
|
const typeAssertionBan = [
|
|
@@ -36,11 +33,11 @@ export function reactAppConfig({ ignores = ["dist"], rules = {} } = {}) {
|
|
|
36
33
|
globals: globals.browser,
|
|
37
34
|
},
|
|
38
35
|
plugins: {
|
|
39
|
-
"react-hooks":
|
|
40
|
-
"react-refresh":
|
|
36
|
+
"react-hooks": reactHooks,
|
|
37
|
+
"react-refresh": reactRefresh,
|
|
41
38
|
},
|
|
42
39
|
rules: {
|
|
43
|
-
...
|
|
40
|
+
...reactHooks.configs.recommended.rules,
|
|
44
41
|
"react-refresh/only-export-components": [
|
|
45
42
|
"warn",
|
|
46
43
|
{ allowConstantExport: true },
|
|
@@ -52,20 +49,8 @@ export function reactAppConfig({ ignores = ["dist"], rules = {} } = {}) {
|
|
|
52
49
|
);
|
|
53
50
|
}
|
|
54
51
|
|
|
55
|
-
export function legacyStrictReactAppConfig(options = {}) {
|
|
56
|
-
return createStrictReactAppConfig(options, {
|
|
57
|
-
reactHooks: legacyReactHooks,
|
|
58
|
-
reactRefresh: legacyReactRefresh,
|
|
59
|
-
tailwindcss: legacyTailwindcss,
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
|
|
63
52
|
export function strictReactAppConfig(options = {}) {
|
|
64
|
-
return createStrictReactAppConfig(options
|
|
65
|
-
reactHooks,
|
|
66
|
-
reactRefresh,
|
|
67
|
-
tailwindcss,
|
|
68
|
-
});
|
|
53
|
+
return createStrictReactAppConfig(options);
|
|
69
54
|
}
|
|
70
55
|
|
|
71
56
|
function createStrictReactAppConfig(
|
|
@@ -80,14 +65,13 @@ function createStrictReactAppConfig(
|
|
|
80
65
|
testFiles = ["**/*.test.{ts,tsx}", "**/test/**/*.{ts,tsx}"],
|
|
81
66
|
overrides = [],
|
|
82
67
|
} = {},
|
|
83
|
-
policyPlugins,
|
|
84
68
|
) {
|
|
85
69
|
const plugins = {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
"react-hooks":
|
|
89
|
-
"react-refresh":
|
|
90
|
-
tailwindcss: fixupPluginRules(
|
|
70
|
+
"@eslint-react": eslintReact,
|
|
71
|
+
"import-x": importX,
|
|
72
|
+
"react-hooks": reactHooks,
|
|
73
|
+
"react-refresh": reactRefresh,
|
|
74
|
+
tailwindcss: fixupPluginRules(tailwindcss),
|
|
91
75
|
};
|
|
92
76
|
|
|
93
77
|
return tseslint.config(
|
|
@@ -120,8 +104,8 @@ function createStrictReactAppConfig(
|
|
|
120
104
|
"@typescript-eslint/no-unsafe-return": "error",
|
|
121
105
|
"@typescript-eslint/switch-exhaustiveness-check": "error",
|
|
122
106
|
complexity: ["error", 12],
|
|
123
|
-
"import/no-cycle": "error",
|
|
124
|
-
"import/no-self-import": "error",
|
|
107
|
+
"import-x/no-cycle": "error",
|
|
108
|
+
"import-x/no-self-import": "error",
|
|
125
109
|
"max-depth": ["error", 3],
|
|
126
110
|
"max-lines": [
|
|
127
111
|
"error",
|
|
@@ -138,9 +122,8 @@ function createStrictReactAppConfig(
|
|
|
138
122
|
"max-nested-callbacks": ["error", 3],
|
|
139
123
|
"max-params": ["error", 4],
|
|
140
124
|
"no-restricted-syntax": ["error", ...typeAssertionBan],
|
|
141
|
-
"react/
|
|
142
|
-
"react/
|
|
143
|
-
"react/no-unstable-nested-components": "error",
|
|
125
|
+
"@eslint-react/no-nested-component-definitions": "error",
|
|
126
|
+
"@eslint-react/no-unstable-context-value": "error",
|
|
144
127
|
"react-refresh/only-export-components": [
|
|
145
128
|
"warn",
|
|
146
129
|
{ allowConstantExport: true },
|
|
@@ -148,18 +131,13 @@ function createStrictReactAppConfig(
|
|
|
148
131
|
...rules,
|
|
149
132
|
},
|
|
150
133
|
settings: {
|
|
151
|
-
"import/extensions": [".js", ".jsx", ".ts", ".tsx"],
|
|
152
|
-
"import/parsers": {
|
|
134
|
+
"import-x/extensions": [".js", ".jsx", ".ts", ".tsx"],
|
|
135
|
+
"import-x/parsers": {
|
|
153
136
|
"@typescript-eslint/parser": [".ts", ".tsx"],
|
|
154
137
|
},
|
|
155
|
-
"import/resolver":
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
},
|
|
159
|
-
},
|
|
160
|
-
react: {
|
|
161
|
-
version: "detect",
|
|
162
|
-
},
|
|
138
|
+
"import-x/resolver-next": [
|
|
139
|
+
createNodeResolver({ extensions: [".js", ".jsx", ".ts", ".tsx"] }),
|
|
140
|
+
],
|
|
163
141
|
...(tailwindCssFiles
|
|
164
142
|
? {
|
|
165
143
|
tailwindcss: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ciridae/configs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Shared ESLint, Prettier, and TypeScript configurations for Ciridae projects.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -30,19 +30,16 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@eslint/compat": "^2.1.0",
|
|
33
|
-
"@eslint/
|
|
34
|
-
"eslint
|
|
35
|
-
"eslint-plugin-
|
|
33
|
+
"@eslint-react/eslint-plugin": "^5.14.6",
|
|
34
|
+
"@eslint/js": "^10.0.1",
|
|
35
|
+
"eslint-plugin-import-x": "^4.17.1",
|
|
36
36
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
37
|
-
"eslint-plugin-react-hooks-legacy": "npm:eslint-plugin-react-hooks@^5.1.0-rc.0",
|
|
38
37
|
"eslint-plugin-react-refresh": "^0.5.3",
|
|
39
|
-
"eslint-plugin-react-refresh-legacy": "npm:eslint-plugin-react-refresh@^0.4.9",
|
|
40
38
|
"eslint-plugin-tailwindcss": "4.0.5",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"typescript-eslint": "^8.0.1"
|
|
39
|
+
"globals": "^17.7.0",
|
|
40
|
+
"typescript-eslint": "^8.63.0"
|
|
44
41
|
},
|
|
45
42
|
"peerDependencies": {
|
|
46
|
-
"eslint": "^
|
|
43
|
+
"eslint": "^10.7.0"
|
|
47
44
|
}
|
|
48
45
|
}
|