@pob/eslint-config-typescript-react 66.0.0 → 67.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/lib/index.js +125 -119
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -8,28 +8,96 @@ import reactConfigs from "./plugins/react.js";
|
|
|
8
8
|
|
|
9
9
|
export { apply, applyTs } from "@pob/eslint-config";
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
const { configs } = basePobConfig();
|
|
11
|
+
const { configs } = basePobConfig;
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
/**
|
|
14
|
+
* @param {import("typescript-eslint").ConfigArray} base
|
|
15
|
+
* @returns {import("typescript-eslint").ConfigArray}
|
|
16
|
+
*/
|
|
17
|
+
const createConfig = (base) => [
|
|
18
|
+
...base,
|
|
19
|
+
importPluginOverrideConfig,
|
|
17
20
|
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
...[
|
|
22
|
+
pobPlugin.configs.react,
|
|
23
|
+
{
|
|
24
|
+
settings: {
|
|
25
|
+
"import-x/resolver-next": [
|
|
26
|
+
createNodeResolver({
|
|
27
|
+
extensions: [
|
|
28
|
+
".mjs",
|
|
29
|
+
".js",
|
|
30
|
+
".json",
|
|
31
|
+
".ts",
|
|
32
|
+
".tsx",
|
|
33
|
+
".d.ts",
|
|
34
|
+
".d.tsx",
|
|
35
|
+
],
|
|
36
|
+
}),
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
rules: {
|
|
40
|
+
"import-x/extensions": [
|
|
41
|
+
"error",
|
|
42
|
+
"always",
|
|
43
|
+
{
|
|
44
|
+
ignorePackages: true,
|
|
45
|
+
pattern: {
|
|
46
|
+
js: "always",
|
|
47
|
+
cjs: "always",
|
|
48
|
+
mjs: "always",
|
|
49
|
+
cts: "always",
|
|
50
|
+
mts: "always",
|
|
51
|
+
ts: "never",
|
|
52
|
+
tsx: "never",
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
// "react/jsx-filename-extension": ["error", { extensions: ["tsx"] }],
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
...reactConfigs,
|
|
60
|
+
...reactHooksConfigs,
|
|
61
|
+
...jsxA11yConfigs,
|
|
62
|
+
].map((config) => ({
|
|
63
|
+
...config,
|
|
64
|
+
files: [`**/*.${tsExtensions}`],
|
|
65
|
+
})),
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* @satisfies {{ configs: Record<string, import("typescript-eslint").ConfigArray> }}
|
|
70
|
+
*/
|
|
71
|
+
export default {
|
|
72
|
+
configs: {
|
|
73
|
+
base: createConfig(configs.baseModule),
|
|
74
|
+
node: createConfig(configs.node),
|
|
75
|
+
|
|
76
|
+
allowUnsafe: configs.allowUnsafe,
|
|
77
|
+
allowUnsafeAsWarn: configs.allowUnsafeAsWarn,
|
|
78
|
+
allowImplicitReturnType: configs.allowImplicitReturnType,
|
|
79
|
+
app: configs.app,
|
|
80
|
+
|
|
81
|
+
monorepo: configs.monorepo,
|
|
82
|
+
checkPackages: configs.checkPackages,
|
|
83
|
+
|
|
84
|
+
"react-native": [
|
|
20
85
|
{
|
|
21
86
|
settings: {
|
|
22
87
|
"import-x/resolver-next": [
|
|
23
88
|
createNodeResolver({
|
|
24
89
|
extensions: [
|
|
90
|
+
".js", // needed to resolve js files from node_modules
|
|
91
|
+
".cjs",
|
|
25
92
|
".mjs",
|
|
26
|
-
".js",
|
|
27
|
-
".json",
|
|
28
93
|
".ts",
|
|
29
94
|
".tsx",
|
|
30
|
-
".
|
|
31
|
-
".
|
|
95
|
+
".ios.ts",
|
|
96
|
+
".ios.tsx",
|
|
97
|
+
".android.ts",
|
|
98
|
+
".android.tsx",
|
|
32
99
|
],
|
|
100
|
+
conditionNames: ["import", "react-native"],
|
|
33
101
|
}),
|
|
34
102
|
],
|
|
35
103
|
},
|
|
@@ -50,118 +118,56 @@ export default () => {
|
|
|
50
118
|
},
|
|
51
119
|
},
|
|
52
120
|
],
|
|
53
|
-
// "react/jsx-filename-extension": ["error", { extensions: ["tsx"] }],
|
|
54
121
|
},
|
|
55
122
|
},
|
|
56
|
-
|
|
57
|
-
...reactHooksConfigs,
|
|
58
|
-
...jsxA11yConfigs,
|
|
59
|
-
].map((config) => ({
|
|
60
|
-
...config,
|
|
61
|
-
files: [`**/*.${tsExtensions}`],
|
|
62
|
-
})),
|
|
63
|
-
];
|
|
64
|
-
return {
|
|
65
|
-
configs: {
|
|
66
|
-
base: createConfig(configs.baseModule),
|
|
67
|
-
node: createConfig(configs.node),
|
|
68
|
-
|
|
69
|
-
allowUnsafe: configs.allowUnsafe,
|
|
70
|
-
allowUnsafeAsWarn: configs.allowUnsafeAsWarn,
|
|
71
|
-
allowImplicitReturnType: configs.allowImplicitReturnType,
|
|
72
|
-
app: configs.app,
|
|
73
|
-
|
|
74
|
-
monorepo: configs.monorepo,
|
|
75
|
-
checkPackages: configs.checkPackages,
|
|
123
|
+
],
|
|
76
124
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}),
|
|
95
|
-
],
|
|
96
|
-
},
|
|
97
|
-
rules: {
|
|
98
|
-
"import-x/extensions": [
|
|
99
|
-
"error",
|
|
100
|
-
"always",
|
|
101
|
-
{
|
|
102
|
-
ignorePackages: true,
|
|
103
|
-
pattern: {
|
|
104
|
-
js: "always",
|
|
105
|
-
cjs: "always",
|
|
106
|
-
mjs: "always",
|
|
107
|
-
cts: "always",
|
|
108
|
-
mts: "always",
|
|
109
|
-
ts: "never",
|
|
110
|
-
tsx: "never",
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
],
|
|
114
|
-
},
|
|
125
|
+
"react-native-web": [
|
|
126
|
+
{
|
|
127
|
+
settings: {
|
|
128
|
+
"import-x/resolver-next": [
|
|
129
|
+
createNodeResolver({
|
|
130
|
+
extensions: [
|
|
131
|
+
".js", // needed to resolve js files from node_modules
|
|
132
|
+
".cjs",
|
|
133
|
+
".mjs",
|
|
134
|
+
".ts",
|
|
135
|
+
".tsx",
|
|
136
|
+
".web.ts",
|
|
137
|
+
".web.tsx",
|
|
138
|
+
],
|
|
139
|
+
conditionNames: ["import", "browser"],
|
|
140
|
+
}),
|
|
141
|
+
],
|
|
115
142
|
},
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
".web.tsx",
|
|
131
|
-
],
|
|
132
|
-
conditionNames: ["import", "browser"],
|
|
133
|
-
}),
|
|
134
|
-
],
|
|
135
|
-
},
|
|
136
|
-
rules: {
|
|
137
|
-
"import-x/extensions": [
|
|
138
|
-
"error",
|
|
139
|
-
"always",
|
|
140
|
-
{
|
|
141
|
-
ignorePackages: true,
|
|
142
|
-
pattern: {
|
|
143
|
-
js: "always",
|
|
144
|
-
cjs: "always",
|
|
145
|
-
mjs: "always",
|
|
146
|
-
cts: "always",
|
|
147
|
-
mts: "never",
|
|
148
|
-
ts: "never",
|
|
149
|
-
tsx: "never",
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
|
-
],
|
|
153
|
-
"import-x/no-unresolved": [
|
|
154
|
-
"error",
|
|
155
|
-
{
|
|
156
|
-
ignore: [
|
|
157
|
-
// allow react-native as it is replaced by react-native-web and typed by @types/react-native. react-native lib does not need to be installed in that case
|
|
158
|
-
"react-native",
|
|
159
|
-
],
|
|
143
|
+
rules: {
|
|
144
|
+
"import-x/extensions": [
|
|
145
|
+
"error",
|
|
146
|
+
"always",
|
|
147
|
+
{
|
|
148
|
+
ignorePackages: true,
|
|
149
|
+
pattern: {
|
|
150
|
+
js: "always",
|
|
151
|
+
cjs: "always",
|
|
152
|
+
mjs: "always",
|
|
153
|
+
cts: "always",
|
|
154
|
+
mts: "never",
|
|
155
|
+
ts: "never",
|
|
156
|
+
tsx: "never",
|
|
160
157
|
},
|
|
161
|
-
|
|
162
|
-
|
|
158
|
+
},
|
|
159
|
+
],
|
|
160
|
+
"import-x/no-unresolved": [
|
|
161
|
+
"error",
|
|
162
|
+
{
|
|
163
|
+
ignore: [
|
|
164
|
+
// allow react-native as it is replaced by react-native-web and typed by @types/react-native. react-native lib does not need to be installed in that case
|
|
165
|
+
"react-native",
|
|
166
|
+
],
|
|
167
|
+
},
|
|
168
|
+
],
|
|
163
169
|
},
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
170
|
+
},
|
|
171
|
+
],
|
|
172
|
+
},
|
|
167
173
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pob/eslint-config-typescript-react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "67.0.0",
|
|
4
4
|
"description": "eslint config files",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"homepage": "https://github.com/christophehurpeau/pob",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"eslint-plugin-jsx-a11y": "6.10.2",
|
|
33
33
|
"eslint-plugin-react": "7.37.5",
|
|
34
34
|
"eslint-plugin-react-hooks": "5.2.0",
|
|
35
|
-
"@pob/eslint-config": "
|
|
35
|
+
"@pob/eslint-config": "67.0.0",
|
|
36
36
|
"@pob/eslint-plugin": "66.0.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|