oxlint-plugin-react-doctor 0.5.6-dev.937a7ca → 0.5.6-dev.b317164
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 +9 -14
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -20190,20 +20190,15 @@ const noInlineExhaustiveStyle = defineRule({
|
|
|
20190
20190
|
severity: "warn",
|
|
20191
20191
|
tags: ["test-noise", "react-jsx-only"],
|
|
20192
20192
|
recommendation: "Move the styles to a CSS class, CSS module, Tailwind utilities, or a styled component. Big inline objects are hard to read and rebuild on every update.",
|
|
20193
|
-
create: (context) => {
|
|
20194
|
-
|
|
20195
|
-
|
|
20196
|
-
|
|
20197
|
-
|
|
20198
|
-
|
|
20199
|
-
|
|
20200
|
-
|
|
20201
|
-
|
|
20202
|
-
node: expression,
|
|
20203
|
-
message: `This inline style has ${propertyCount} properties, which is hard to read & rebuilds every render. Move it to a CSS class, CSS module, or styled component.`
|
|
20204
|
-
});
|
|
20205
|
-
} };
|
|
20206
|
-
}
|
|
20193
|
+
create: (context) => ({ JSXAttribute(node) {
|
|
20194
|
+
const expression = getInlineStyleExpression(node);
|
|
20195
|
+
if (!expression) return;
|
|
20196
|
+
const propertyCount = expression.properties?.filter((property) => isNodeOfType(property, "Property")).length ?? 0;
|
|
20197
|
+
if (propertyCount >= 8) context.report({
|
|
20198
|
+
node: expression,
|
|
20199
|
+
message: `This inline style has ${propertyCount} properties, which is hard to read & rebuilds every render. Move it to a CSS class, CSS module, or styled component.`
|
|
20200
|
+
});
|
|
20201
|
+
} })
|
|
20207
20202
|
});
|
|
20208
20203
|
//#endregion
|
|
20209
20204
|
//#region src/plugin/rules/performance/no-inline-prop-on-memo-component.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oxlint-plugin-react-doctor",
|
|
3
|
-
"version": "0.5.6-dev.
|
|
3
|
+
"version": "0.5.6-dev.b317164",
|
|
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",
|