Skip to content

Commit 0a45183

Browse files
committed
fix: move 'react-x/no-string-style-prop' to 'react-dom/no-string-style-prop'
1 parent 13da4ec commit 0a45183

File tree

12 files changed

+12
-14
lines changed

12 files changed

+12
-14
lines changed

apps/website/content/docs/rules/meta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
"no-set-state-in-component-did-update",
4848
"no-set-state-in-component-will-update",
4949
"no-string-refs",
50-
"no-string-style-prop",
5150
"no-unnecessary-use-callback",
5251
"no-unnecessary-use-memo",
5352
"no-unnecessary-use-prefix",
@@ -77,6 +76,7 @@
7776
"dom-no-render",
7877
"dom-no-render-return-value",
7978
"dom-no-script-url",
79+
"dom-no-string-style-prop",
8080
"dom-no-unknown-property",
8181
"dom-no-unsafe-iframe-sandbox",
8282
"dom-no-unsafe-target-blank",

apps/website/content/docs/rules/overview.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ The `jsx-*` rules check for issues exclusive to JSX syntax, which are absent fro
7474
| [`no-set-state-in-component-did-update`](./no-set-state-in-component-did-update) | 1️⃣ | | Disallow calling `this.setState` in `componentDidUpdate` outside of functions, such as callbacks | |
7575
| [`no-set-state-in-component-will-update`](./no-set-state-in-component-will-update) | 1️⃣ | | Disallow calling `this.setState` in `componentWillUpdate` outside of functions, such as callbacks | |
7676
| [`no-string-refs`](./no-string-refs) | 2️⃣ | `🔄` | Replaces string refs with callback refs | >=16.3.0 |
77-
| [`no-string-style-prop`](./no-string-style-prop) | 2️⃣ | | Disallow string values for the `style` prop | |
7877
| [`no-unnecessary-use-callback`](./no-unnecessary-use-callback) | 0️⃣ | `🧪` | Disallow unnecessary usage of `useCallback` | |
7978
| [`no-unnecessary-use-memo`](./no-unnecessary-use-memo) | 0️⃣ | `🧪` | Disallow unnecessary usage of `useMemo` | |
8079
| [`no-unnecessary-use-prefix`](./no-unnecessary-use-prefix) | 0️⃣ | | Enforces that a function with the `use` prefix should use at least one Hook inside of it | |
@@ -109,6 +108,7 @@ The `jsx-*` rules check for issues exclusive to JSX syntax, which are absent fro
109108
| [`no-render`](./dom-no-render) | 2️⃣ | `🔄` | Replaces usages of `ReactDom.render()` with `createRoot(node).render()` | >=18.0.0 |
110109
| [`no-render-return-value`](./dom-no-render-return-value) | 2️⃣ | | Disallow the return value of `ReactDOM.render` | |
111110
| [`no-script-url`](./dom-no-script-url) | 1️⃣ | | Disallow `javascript:` URLs as attribute values | |
111+
| [`no-string-style-prop`](./dom-no-string-style-prop) | 2️⃣ | | Disallow string values for the `style` prop | |
112112
| [`no-unknown-property`](./dom-no-unknown-property) | 0️⃣ | `🔧` `⚙️` | Disallow unknown `DOM` property | |
113113
| [`no-unsafe-iframe-sandbox`](./dom-no-unsafe-iframe-sandbox) | 1️⃣ | | Enforces `sandbox` attribute for `iframe` elements is not set to unsafe combinations | |
114114
| [`no-unsafe-target-blank`](./dom-no-unsafe-target-blank) | 1️⃣ | `🔧` | Disallow `target="_blank"` without `rel="noreferrer noopener"` | |

packages/plugins/eslint-plugin-react-dom/src/configs/recommended.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export const rules = {
1515
"react-dom/no-render": "error",
1616
"react-dom/no-render-return-value": "error",
1717
"react-dom/no-script-url": "warn",
18+
"react-dom/no-string-style-prop": "error",
1819
"react-dom/no-unsafe-iframe-sandbox": "warn",
1920
"react-dom/no-unsafe-target-blank": "warn",
2021
"react-dom/no-use-form-state": "error",

packages/plugins/eslint-plugin-react-dom/src/plugin.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import noNamespace from "./rules/no-namespace";
1010
import noRender from "./rules/no-render";
1111
import noRenderReturnValue from "./rules/no-render-return-value";
1212
import noScriptUrl from "./rules/no-script-url";
13+
import noStringStyleProp from "./rules/no-string-style-prop";
1314
import noUnknownProperty from "./rules/no-unknown-property";
1415
import noUnsafeIframeSandbox from "./rules/no-unsafe-iframe-sandbox";
1516
import noUnsafeTargetBlank from "./rules/no-unsafe-target-blank";
@@ -33,6 +34,7 @@ export const plugin = {
3334
"no-render": noRender,
3435
"no-render-return-value": noRenderReturnValue,
3536
"no-script-url": noScriptUrl,
37+
"no-string-style-prop": noStringStyleProp,
3638
"no-unknown-property": noUnknownProperty,
3739
"no-unsafe-iframe-sandbox": noUnsafeIframeSandbox,
3840
"no-unsafe-target-blank": noUnsafeTargetBlank,

packages/plugins/eslint-plugin-react-x/src/rules/no-string-style-prop.md renamed to packages/plugins/eslint-plugin-react-dom/src/rules/no-string-style-prop.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22
title: no-string-style-prop
33
---
44

5-
**Full Name in `eslint-plugin-react-x`**
5+
**Full Name in `eslint-plugin-react-dom`**
66

77
```sh copy
8-
react-x/no-string-style-prop
8+
react-dom/no-string-style-prop
99
```
1010

1111
**Full Name in `@eslint-react/eslint-plugin`**
1212

1313
```sh copy
14-
@eslint-react/no-string-style-prop
14+
@eslint-react/dom/no-string-style-prop
1515
```
1616

1717
**Presets**
1818

19-
- `x`
19+
- `dom`
2020
- `recommended`
2121

2222
## Description
@@ -47,5 +47,5 @@ function MyComponent() {
4747

4848
## Implementation
4949

50-
- [Rule source](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x/src/rules/no-string-style-prop.ts)
51-
- [Test source](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x/src/rules/no-string-style-prop.spec.ts)
50+
- [Rule source](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom/src/rules/no-string-style-prop.ts)
51+
- [Test source](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom/src/rules/no-string-style-prop.spec.ts)

packages/plugins/eslint-plugin-react-x/src/configs/recommended-typescript.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ export const rules = {
1010
"react-x/jsx-no-undef": "off",
1111
"react-x/jsx-uses-react": "off",
1212
"react-x/jsx-uses-vars": "off",
13-
"react-x/no-string-style-prop": "off",
1413
} as const satisfies RulePreset;
1514

1615
export const settings = {

packages/plugins/eslint-plugin-react-x/src/configs/recommended.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ export const rules = {
4747
"react-x/no-set-state-in-component-did-update": "warn",
4848
"react-x/no-set-state-in-component-will-update": "warn",
4949
"react-x/no-string-refs": "error",
50-
"react-x/no-string-style-prop": "error",
5150
// "react-x/no-unnecessary-use-callback": "warn",
5251
// "react-x/no-unnecessary-use-memo": "warn",
5352
"react-x/no-unnecessary-use-prefix": "warn",

packages/plugins/eslint-plugin-react-x/src/plugin.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ import noSetStateInComponentDidMount from "./rules/no-set-state-in-component-did
4343
import noSetStateInComponentDidUpdate from "./rules/no-set-state-in-component-did-update";
4444
import noSetStateInComponentWillUpdate from "./rules/no-set-state-in-component-will-update";
4545
import noStringRefs from "./rules/no-string-refs";
46-
import noStringStyleProp from "./rules/no-string-style-prop";
4746
import noUnnecessaryUseCallback from "./rules/no-unnecessary-use-callback";
4847
import noUnnecessaryUseMemo from "./rules/no-unnecessary-use-memo";
4948
import noUnnecessaryUsePrefix from "./rules/no-unnecessary-use-prefix";
@@ -122,7 +121,6 @@ export const plugin = {
122121
"no-set-state-in-component-did-update": noSetStateInComponentDidUpdate,
123122
"no-set-state-in-component-will-update": noSetStateInComponentWillUpdate,
124123
"no-string-refs": noStringRefs,
125-
"no-string-style-prop": noStringStyleProp,
126124
"no-unnecessary-use-callback": noUnnecessaryUseCallback,
127125
"no-unnecessary-use-memo": noUnnecessaryUseMemo,
128126
"no-unnecessary-use-prefix": noUnnecessaryUsePrefix,

0 commit comments

Comments
 (0)