@yasainet/eslint 0.0.62 → 0.0.63
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 +33 -1
- package/src/next/index.mjs +2 -0
package/package.json
CHANGED
package/src/common/imports.mjs
CHANGED
|
@@ -137,6 +137,19 @@ const ROUTE_BOUNDARY_PATTERNS = [
|
|
|
137
137
|
},
|
|
138
138
|
];
|
|
139
139
|
|
|
140
|
+
const SITEMAP_BOUNDARY_PATTERNS = [
|
|
141
|
+
{
|
|
142
|
+
group: ["**/queries/*", "**/queries"],
|
|
143
|
+
message:
|
|
144
|
+
"sitemap.ts can only import entries, not queries (sitemap-boundary violation)",
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
group: ["**/services/*", "**/services"],
|
|
148
|
+
message:
|
|
149
|
+
"sitemap.ts can only import entries, not services (sitemap-boundary violation)",
|
|
150
|
+
},
|
|
151
|
+
];
|
|
152
|
+
|
|
140
153
|
const HOOKS_BOUNDARY_PATTERNS = [
|
|
141
154
|
{
|
|
142
155
|
group: ["**/queries/*", "**/queries"],
|
|
@@ -220,6 +233,26 @@ export const routeBoundaryConfigs = [
|
|
|
220
233
|
},
|
|
221
234
|
];
|
|
222
235
|
|
|
236
|
+
/** Next.js-only: restrict sitemap.ts to only import entries. */
|
|
237
|
+
export const sitemapBoundaryConfigs = [
|
|
238
|
+
{
|
|
239
|
+
name: "imports/sitemap-boundary",
|
|
240
|
+
files: ["src/app/sitemap.ts", "src/app/**/sitemap.ts"],
|
|
241
|
+
rules: {
|
|
242
|
+
"no-restricted-imports": [
|
|
243
|
+
"error",
|
|
244
|
+
{
|
|
245
|
+
patterns: [
|
|
246
|
+
...SITEMAP_BOUNDARY_PATTERNS,
|
|
247
|
+
...LIB_BOUNDARY_PATTERNS,
|
|
248
|
+
...MAPPING_PATTERNS,
|
|
249
|
+
],
|
|
250
|
+
},
|
|
251
|
+
],
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
];
|
|
255
|
+
|
|
223
256
|
/** Next.js-only: restrict hooks to only import entries (not queries or services). */
|
|
224
257
|
export const hooksBoundaryConfigs = [
|
|
225
258
|
{
|
|
@@ -271,7 +304,6 @@ export const libBoundaryConfigs = [
|
|
|
271
304
|
ignores: [
|
|
272
305
|
"src/lib/**",
|
|
273
306
|
"src/proxy.ts",
|
|
274
|
-
"src/app/sitemap.ts",
|
|
275
307
|
"src/app/**/route.ts",
|
|
276
308
|
"src/features/**",
|
|
277
309
|
],
|
package/src/next/index.mjs
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
libBoundaryConfigs,
|
|
7
7
|
pageBoundaryConfigs,
|
|
8
8
|
routeBoundaryConfigs,
|
|
9
|
+
sitemapBoundaryConfigs,
|
|
9
10
|
} from "../common/imports.mjs";
|
|
10
11
|
|
|
11
12
|
import { directivesConfigs } from "./directives.mjs";
|
|
@@ -29,6 +30,7 @@ export const eslintConfig = [
|
|
|
29
30
|
...libBoundaryConfigs,
|
|
30
31
|
...pageBoundaryConfigs,
|
|
31
32
|
...routeBoundaryConfigs,
|
|
33
|
+
...sitemapBoundaryConfigs,
|
|
32
34
|
...hooksBoundaryConfigs,
|
|
33
35
|
...componentsBoundaryConfigs,
|
|
34
36
|
...namingConfigs,
|