@pob/eslint-config 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.
Files changed (2) hide show
  1. package/lib/index.js +145 -144
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -43,157 +43,158 @@ if (!tsFiles) {
43
43
  );
44
44
  }
45
45
 
46
- export default () => {
47
- const extensions = "{js,cjs,mjs}";
48
-
49
- const testFiles = [
50
- `**/*.{test,test-e2e,spec}.${extensions}`,
51
- `**/__tests__/**/*.${extensions}`,
52
- `**/__mocks__/**/*.${extensions}`,
53
- ];
54
-
55
- const tsTestFiles = [
56
- `**/*.test.${tsExtensions}`,
57
- `**/*.test-e2e.${tsExtensions}`,
58
- `**/__tests__/**/*.${tsExtensions}`,
59
- `**/__mocks__/**/*.${tsExtensions}`,
60
- ];
61
-
62
- const typescriptConfigs = [
63
- ...applyTs({
64
- filesOverridesIf: [tsFiles],
65
- configs: [
66
- ...tseslint.configs.strictTypeChecked,
67
- typescriptReplaceUnicornConfig,
68
- typescriptReplaceEslintConfig,
69
- typescriptPluginRulesConfig,
70
- typescriptRulesConfig,
71
- ],
72
- }),
73
- ...apply({
74
- files: tsTestFiles,
75
- configs: testOverrideConfigsWithTypescript,
76
- }),
77
- ];
78
-
79
- /** @deprecated */
80
- const nodeCommonjs = [
81
- ...baseConfigs,
82
- ...apply({
83
- mode: "keep-files-if-exists",
84
- files: ["**/*.{js,cjs,mjs,mts,ts,tsx,cts}"],
85
- configs: [
86
- baseCommonjsConfig,
87
- ...importPluginBaseConfigs,
88
- importPluginCommonjsConfig,
89
- ...nodePluginCommonjsConfigs,
90
- ],
91
- }),
92
-
93
- ...apply({
94
- extensions,
95
- mode: "directory",
96
- files: ["**/scripts/"],
97
- configs: [scriptsOverrideConfig],
98
- }),
99
-
100
- ...apply({
101
- files: ["**/*.{mjs,mts}"],
102
- mode: "keep-files-if-exists",
103
- configs: [
104
- baseModuleConfig,
105
- importPluginModuleConfig,
106
- ...nodePluginModuleConfigs,
107
- ],
108
- }),
109
-
110
- ...apply({
111
- files: testFiles,
112
- configs: testOverrideConfigsWithoutTypescript,
113
- }),
114
- ];
115
-
116
- const baseModule = [
117
- ...baseConfigs,
118
- ...apply({
119
- mode: "keep-files-if-exists",
120
- files: ["**/*.{js,mjs,cjs,mts,ts,tsx,cts}"],
121
- configs: [
122
- baseModuleConfig,
123
- ...importPluginBaseConfigs,
124
- importPluginModuleConfig,
125
- ],
126
- }),
127
-
128
- ...apply({
129
- mode: "keep-files-if-exists",
130
- files: ["**/*.{cjs,cts}"],
131
- configs: [baseCommonjsConfig, importPluginCommonjsConfig],
46
+ const extensions = "{js,cjs,mjs}";
47
+
48
+ const testFiles = [
49
+ `**/*.{test,test-e2e,spec}.${extensions}`,
50
+ `**/__tests__/**/*.${extensions}`,
51
+ `**/__mocks__/**/*.${extensions}`,
52
+ ];
53
+
54
+ const tsTestFiles = [
55
+ `**/*.test.${tsExtensions}`,
56
+ `**/*.test-e2e.${tsExtensions}`,
57
+ `**/__tests__/**/*.${tsExtensions}`,
58
+ `**/__mocks__/**/*.${tsExtensions}`,
59
+ ];
60
+
61
+ const typescriptConfigs = [
62
+ ...applyTs({
63
+ filesOverridesIf: [tsFiles],
64
+ configs: [
65
+ ...tseslint.configs.strictTypeChecked,
66
+ typescriptReplaceUnicornConfig,
67
+ typescriptReplaceEslintConfig,
68
+ typescriptPluginRulesConfig,
69
+ typescriptRulesConfig,
70
+ ],
71
+ }),
72
+ ...apply({
73
+ files: tsTestFiles,
74
+ configs: testOverrideConfigsWithTypescript,
75
+ }),
76
+ ];
77
+
78
+ /** @deprecated */
79
+ const nodeCommonjs = [
80
+ ...baseConfigs,
81
+ ...apply({
82
+ mode: "keep-files-if-exists",
83
+ files: ["**/*.{js,cjs,mjs,mts,ts,tsx,cts}"],
84
+ configs: [
85
+ baseCommonjsConfig,
86
+ ...importPluginBaseConfigs,
87
+ importPluginCommonjsConfig,
88
+ ...nodePluginCommonjsConfigs,
89
+ ],
90
+ }),
91
+
92
+ ...apply({
93
+ extensions,
94
+ mode: "directory",
95
+ files: ["**/scripts/"],
96
+ configs: [scriptsOverrideConfig],
97
+ }),
98
+
99
+ ...apply({
100
+ files: ["**/*.{mjs,mts}"],
101
+ mode: "keep-files-if-exists",
102
+ configs: [
103
+ baseModuleConfig,
104
+ importPluginModuleConfig,
105
+ ...nodePluginModuleConfigs,
106
+ ],
107
+ }),
108
+
109
+ ...apply({
110
+ files: testFiles,
111
+ configs: testOverrideConfigsWithoutTypescript,
112
+ }),
113
+ ];
114
+
115
+ const baseModule = [
116
+ ...baseConfigs,
117
+ ...apply({
118
+ mode: "keep-files-if-exists",
119
+ files: ["**/*.{js,mjs,cjs,mts,ts,tsx,cts}"],
120
+ configs: [
121
+ baseModuleConfig,
122
+ ...importPluginBaseConfigs,
123
+ importPluginModuleConfig,
124
+ ],
125
+ }),
126
+
127
+ ...apply({
128
+ mode: "keep-files-if-exists",
129
+ files: ["**/*.{cjs,cts}"],
130
+ configs: [baseCommonjsConfig, importPluginCommonjsConfig],
131
+ }),
132
+
133
+ ...typescriptConfigs,
134
+ ];
135
+
136
+ const nodeModule = [
137
+ ...baseModule,
138
+ ...apply({
139
+ mode: "keep-files-if-exists",
140
+ files: ["**/*.{js,mjs,mts,ts,tsx}"],
141
+ configs: [...nodePluginModuleConfigs],
142
+ }),
143
+
144
+ ...apply({
145
+ extensions,
146
+ mode: "directory",
147
+ files: ["**/scripts/"],
148
+ configs: [scriptsOverrideConfig],
149
+ }),
150
+
151
+ ...apply({
152
+ mode: "keep-files-if-exists",
153
+ files: ["**/*.{cjs,cts}"],
154
+ configs: [...nodePluginCommonjsConfigs],
155
+ }),
156
+
157
+ ...nodeTypescriptConfigs,
158
+ ];
159
+
160
+ /**
161
+ * @satisfies {{ configs: Record<string, import("typescript-eslint").ConfigArray> }}
162
+ */
163
+ export default {
164
+ configs: {
165
+ baseModule: [
166
+ ...baseModule,
167
+ ...apply({
168
+ extensions,
169
+ mode: "directory",
170
+ files: ["**/scripts/"],
171
+ configs: [...nodePluginModuleConfigs, scriptsOverrideConfig],
172
+ }),
173
+ ],
174
+ /** @deprecated */
175
+ nodeModule,
176
+ /** @deprecated */
177
+ nodeCommonjs,
178
+ node: nodeModule,
179
+
180
+ allowImplicitReturnType: applyTs({
181
+ configs: [allowImplicitReturnTypeConfig],
132
182
  }),
133
183
 
134
- ...typescriptConfigs,
135
- ];
136
-
137
- const nodeModule = [
138
- ...baseModule,
139
- ...apply({
140
- mode: "keep-files-if-exists",
141
- files: ["**/*.{js,mjs,mts,ts,tsx}"],
142
- configs: [...nodePluginModuleConfigs],
184
+ allowUnsafe: applyTs({
185
+ configs: [allowUnsafeConfig],
143
186
  }),
144
187
 
145
- ...apply({
146
- extensions,
147
- mode: "directory",
148
- files: ["**/scripts/"],
149
- configs: [scriptsOverrideConfig],
188
+ allowUnsafeAsWarn: applyTs({
189
+ configs: [allowUnsafeAsWarnConfig],
150
190
  }),
151
191
 
152
- ...apply({
153
- mode: "keep-files-if-exists",
154
- files: ["**/*.{cjs,cts}"],
155
- configs: [...nodePluginCommonjsConfigs],
192
+ app: applyTs({
193
+ configs: [appConfig],
156
194
  }),
157
195
 
158
- ...nodeTypescriptConfigs,
159
- ];
160
-
161
- return {
162
- configs: {
163
- baseModule: [
164
- ...baseModule,
165
- ...apply({
166
- extensions,
167
- mode: "directory",
168
- files: ["**/scripts/"],
169
- configs: [...nodePluginModuleConfigs, scriptsOverrideConfig],
170
- }),
171
- ],
172
- /** @deprecated */
173
- nodeModule,
174
- /** @deprecated */
175
- nodeCommonjs,
176
- node: nodeModule,
177
-
178
- allowImplicitReturnType: applyTs({
179
- configs: [allowImplicitReturnTypeConfig],
180
- }),
181
-
182
- allowUnsafe: applyTs({
183
- configs: [allowUnsafeConfig],
184
- }),
185
-
186
- allowUnsafeAsWarn: applyTs({
187
- configs: [allowUnsafeAsWarnConfig],
188
- }),
189
-
190
- app: applyTs({
191
- configs: [appConfig],
192
- }),
193
-
194
- monorepo: [monorepoRootConfigsConfig],
196
+ monorepo: [monorepoRootConfigsConfig],
195
197
 
196
- checkPackages: checkPackageDependenciesConfigs,
197
- },
198
- };
198
+ checkPackages: checkPackageDependenciesConfigs,
199
+ },
199
200
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pob/eslint-config",
3
- "version": "66.0.0",
3
+ "version": "67.0.0",
4
4
  "description": "eslint config files",
5
5
  "keywords": [],
6
6
  "homepage": "https://github.com/christophehurpeau/pob",