oxlint-plugin-react-doctor 0.5.1-dev.b819e5f → 0.5.1-dev.c4f0e60
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/dist/index.js +16 -26
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -24344,6 +24344,21 @@ const noZIndex9999 = defineRule({
|
|
|
24344
24344
|
})
|
|
24345
24345
|
});
|
|
24346
24346
|
//#endregion
|
|
24347
|
+
//#region src/plugin/utils/is-framework-route-or-special-filename.ts
|
|
24348
|
+
const sourceFileExtensionGroup = NEXTJS_SOURCE_FILE_EXTENSION_GROUP;
|
|
24349
|
+
const FRAMEWORK_ROUTE_FILE_PATTERNS = [
|
|
24350
|
+
new RegExp(`^(page|layout|loading|error|not-found|template|default|global-error|route|_app|_document|_error)\\.${sourceFileExtensionGroup}$`),
|
|
24351
|
+
new RegExp(`^(_layout|\\+html|\\+not-found|\\+native-intent)\\.${sourceFileExtensionGroup}$`),
|
|
24352
|
+
new RegExp(`(?:^__root|\\.lazy)\\.${sourceFileExtensionGroup}$`),
|
|
24353
|
+
new RegExp(`^(root|entry\\.client|entry\\.server)\\.${sourceFileExtensionGroup}$`)
|
|
24354
|
+
];
|
|
24355
|
+
const isFrameworkRouteOrSpecialFilename = (rawFilename) => {
|
|
24356
|
+
if (!rawFilename) return false;
|
|
24357
|
+
if (isNextjsMetadataImageRouteFilename(rawFilename)) return true;
|
|
24358
|
+
const basename = path.basename(rawFilename);
|
|
24359
|
+
return FRAMEWORK_ROUTE_FILE_PATTERNS.some((pattern) => pattern.test(basename));
|
|
24360
|
+
};
|
|
24361
|
+
//#endregion
|
|
24347
24362
|
//#region src/plugin/rules/react-builtins/only-export-components-tables.ts
|
|
24348
24363
|
const NOT_REACT_COMPONENT_EXPRESSION_TYPES = new Set([
|
|
24349
24364
|
"ArrayExpression",
|
|
@@ -24395,32 +24410,6 @@ const ENTRY_POINT_BASENAMES = new Set([
|
|
|
24395
24410
|
"client.jsx",
|
|
24396
24411
|
"server.tsx",
|
|
24397
24412
|
"server.jsx",
|
|
24398
|
-
"page.tsx",
|
|
24399
|
-
"page.jsx",
|
|
24400
|
-
"layout.tsx",
|
|
24401
|
-
"layout.jsx",
|
|
24402
|
-
"loading.tsx",
|
|
24403
|
-
"loading.jsx",
|
|
24404
|
-
"error.tsx",
|
|
24405
|
-
"error.jsx",
|
|
24406
|
-
"not-found.tsx",
|
|
24407
|
-
"not-found.jsx",
|
|
24408
|
-
"template.tsx",
|
|
24409
|
-
"template.jsx",
|
|
24410
|
-
"default.tsx",
|
|
24411
|
-
"default.jsx",
|
|
24412
|
-
"global-error.tsx",
|
|
24413
|
-
"global-error.jsx",
|
|
24414
|
-
"route.tsx",
|
|
24415
|
-
"route.jsx",
|
|
24416
|
-
"_layout.tsx",
|
|
24417
|
-
"_layout.jsx",
|
|
24418
|
-
"_app.tsx",
|
|
24419
|
-
"_app.jsx",
|
|
24420
|
-
"_document.tsx",
|
|
24421
|
-
"_document.jsx",
|
|
24422
|
-
"_error.tsx",
|
|
24423
|
-
"_error.jsx",
|
|
24424
24413
|
"app.tsx",
|
|
24425
24414
|
"app.jsx",
|
|
24426
24415
|
"App.tsx",
|
|
@@ -24713,6 +24702,7 @@ const isFileNameAllowed = (filename, checkJS) => {
|
|
|
24713
24702
|
if (filename.includes(".test.") || filename.includes(".spec.") || filename.includes(".cy.") || filename.includes(".stories.")) return false;
|
|
24714
24703
|
for (const segment of NON_FAST_REFRESH_PATH_SEGMENTS) if (filename.includes(segment)) return false;
|
|
24715
24704
|
if (isEntryPointFile(filename)) return false;
|
|
24705
|
+
if (isFrameworkRouteOrSpecialFilename(filename)) return false;
|
|
24716
24706
|
if (isAssetOrUtilityFile(filename)) return false;
|
|
24717
24707
|
if (filename.endsWith(".tsx") || filename.endsWith(".jsx")) return true;
|
|
24718
24708
|
if (checkJS && filename.endsWith(".js")) return true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oxlint-plugin-react-doctor",
|
|
3
|
-
"version": "0.5.1-dev.
|
|
3
|
+
"version": "0.5.1-dev.c4f0e60",
|
|
4
4
|
"description": "oxlint plugin for React Doctor: diagnose React codebases for security, performance, correctness, accessibility, bundle-size, and architecture issues",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"accessibility",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@types/node": "^25.6.0"
|
|
51
51
|
},
|
|
52
52
|
"engines": {
|
|
53
|
-
"node": "^20.19.0 || >=22.
|
|
53
|
+
"node": "^20.19.0 || >=22.13.0"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"dev": "vp pack --watch",
|