@yasainet/eslint 0.0.55 → 0.0.56
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/package.json +1 -1
- package/src/common/imports.mjs +32 -3
package/package.json
CHANGED
package/src/common/imports.mjs
CHANGED
|
@@ -162,13 +162,27 @@ function makeConfig(name, files, ...patternArrays) {
|
|
|
162
162
|
};
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
+
// In ESLint flat config, when multiple matching configs set the same rule
|
|
166
|
+
// (`no-restricted-imports`), the later config's options REPLACE the earlier
|
|
167
|
+
// ones — patterns are not merged. Page / hooks / components boundary configs
|
|
168
|
+
// run after libBoundaryConfigs and would silently drop lib + mapping bans
|
|
169
|
+
// unless we re-include those patterns explicitly.
|
|
165
170
|
/** Next.js-only: restrict page.tsx to only import interactors. */
|
|
166
171
|
export const pageBoundaryConfigs = [
|
|
167
172
|
{
|
|
168
173
|
name: "imports/page-boundary",
|
|
169
174
|
files: ["src/app/**/page.tsx"],
|
|
170
175
|
rules: {
|
|
171
|
-
"no-restricted-imports": [
|
|
176
|
+
"no-restricted-imports": [
|
|
177
|
+
"error",
|
|
178
|
+
{
|
|
179
|
+
patterns: [
|
|
180
|
+
...PAGE_BOUNDARY_PATTERNS,
|
|
181
|
+
...LIB_BOUNDARY_PATTERNS,
|
|
182
|
+
...MAPPING_PATTERNS,
|
|
183
|
+
],
|
|
184
|
+
},
|
|
185
|
+
],
|
|
172
186
|
},
|
|
173
187
|
},
|
|
174
188
|
];
|
|
@@ -179,7 +193,16 @@ export const hooksBoundaryConfigs = [
|
|
|
179
193
|
name: "imports/hooks-boundary",
|
|
180
194
|
files: ["src/features/**/hooks/*.ts"],
|
|
181
195
|
rules: {
|
|
182
|
-
"no-restricted-imports": [
|
|
196
|
+
"no-restricted-imports": [
|
|
197
|
+
"error",
|
|
198
|
+
{
|
|
199
|
+
patterns: [
|
|
200
|
+
...HOOKS_BOUNDARY_PATTERNS,
|
|
201
|
+
...LIB_BOUNDARY_PATTERNS,
|
|
202
|
+
...MAPPING_PATTERNS,
|
|
203
|
+
],
|
|
204
|
+
},
|
|
205
|
+
],
|
|
183
206
|
},
|
|
184
207
|
},
|
|
185
208
|
];
|
|
@@ -192,7 +215,13 @@ export const componentsBoundaryConfigs = [
|
|
|
192
215
|
rules: {
|
|
193
216
|
"no-restricted-imports": [
|
|
194
217
|
"error",
|
|
195
|
-
{
|
|
218
|
+
{
|
|
219
|
+
patterns: [
|
|
220
|
+
...COMPONENTS_BOUNDARY_PATTERNS,
|
|
221
|
+
...LIB_BOUNDARY_PATTERNS,
|
|
222
|
+
...MAPPING_PATTERNS,
|
|
223
|
+
],
|
|
224
|
+
},
|
|
196
225
|
],
|
|
197
226
|
},
|
|
198
227
|
},
|