oxlint-config-presets 0.1.5 → 0.1.7
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/README.md +92 -0
- package/oxlint-config.d.ts +3 -0
- package/package.json +16 -2
- package/react/all.json +56 -0
- package/react/jsx-runtime.json +6 -0
- package/react/recommended.json +23 -0
package/README.md
CHANGED
|
@@ -45,6 +45,23 @@ You can also compose multiple presets. Later entries override earlier ones:
|
|
|
45
45
|
> Oxlint currently expects `extends` values to be **JSON file paths** relative to your config file.
|
|
46
46
|
> For presets in this package, use `./node_modules/oxlint-config-presets/<config>.json`.
|
|
47
47
|
|
|
48
|
+
### Usage with `oxlint.config.ts`
|
|
49
|
+
|
|
50
|
+
If you use a [TypeScript config file](https://oxc.rs/docs/guide/usage/linter/config) (`oxlint.config.ts`), you can import presets directly. TypeScript type definitions are included for all presets:
|
|
51
|
+
|
|
52
|
+
```typescript
|
|
53
|
+
import airbnb from 'oxlint-config-presets/airbnb.json' with { type: 'json' };
|
|
54
|
+
import tsStrict from 'oxlint-config-presets/@typescript-eslint/strict-type-checked.json' with { type: 'json' };
|
|
55
|
+
import { defineConfig } from 'oxlint';
|
|
56
|
+
|
|
57
|
+
export default defineConfig({
|
|
58
|
+
extends: [airbnb, tsStrict],
|
|
59
|
+
});
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
> [!NOTE]
|
|
63
|
+
> Requires Node.js v22.18+ or v24+ for `with { type: "json" }` (import attributes) support.
|
|
64
|
+
|
|
48
65
|
<!-- GENERATED CONFIGS START -->
|
|
49
66
|
|
|
50
67
|
## Available configs
|
|
@@ -96,6 +113,10 @@ You can also compose multiple presets. Later entries override earlier ones:
|
|
|
96
113
|
- **eslint-config-next**
|
|
97
114
|
- recommended `next/recommended.json`
|
|
98
115
|
- core-web-vitals `next/core-web-vitals.json`
|
|
116
|
+
- **eslint-plugin-react**
|
|
117
|
+
- recommended `react/recommended.json`
|
|
118
|
+
- all `react/all.json`
|
|
119
|
+
- jsx-runtime `react/jsx-runtime.json`
|
|
99
120
|
- **eslint-plugin-react-perf**
|
|
100
121
|
- recommended `react-perf/recommended.json`
|
|
101
122
|
- all `react-perf/all.json`
|
|
@@ -1167,6 +1188,77 @@ Extracted from `eslint-config-next@16.2.1`.
|
|
|
1167
1188
|
|
|
1168
1189
|
</details>
|
|
1169
1190
|
|
|
1191
|
+
### `react/recommended.json`
|
|
1192
|
+
|
|
1193
|
+
```json
|
|
1194
|
+
"./node_modules/oxlint-config-presets/react/recommended.json"
|
|
1195
|
+
```
|
|
1196
|
+
|
|
1197
|
+
Extracted from `eslint-plugin-react@7.37.5`.
|
|
1198
|
+
|
|
1199
|
+
<details>
|
|
1200
|
+
<summary>18 rules successfully migrated</summary>
|
|
1201
|
+
|
|
1202
|
+
`react/display-name`, `react/jsx-key`, `react/jsx-no-comment-textnodes`, `react/jsx-no-duplicate-props`, `react/jsx-no-target-blank`, `react/jsx-no-undef`, `react/no-children-prop`, `react/no-danger-with-children`, `react/no-direct-mutation-state`, `react/no-find-dom-node`, `react/no-is-mounted`, `react/no-render-return-value`, `react/no-string-refs`, `react/no-unescaped-entities`, `react/no-unknown-property`, `react/no-unsafe`, `react/react-in-jsx-scope`, `react/require-render-return`
|
|
1203
|
+
|
|
1204
|
+
</details>
|
|
1205
|
+
|
|
1206
|
+
<details>
|
|
1207
|
+
<summary>4 rules have no oxlint equivalent</summary>
|
|
1208
|
+
|
|
1209
|
+
**Not yet implemented in oxlint**
|
|
1210
|
+
|
|
1211
|
+
`react/no-deprecated`, `react/prop-types`
|
|
1212
|
+
|
|
1213
|
+
**Not portable to oxlint**
|
|
1214
|
+
|
|
1215
|
+
`react/jsx-uses-react`, `react/jsx-uses-vars`
|
|
1216
|
+
|
|
1217
|
+
</details>
|
|
1218
|
+
|
|
1219
|
+
### `react/all.json`
|
|
1220
|
+
|
|
1221
|
+
```json
|
|
1222
|
+
"./node_modules/oxlint-config-presets/react/all.json"
|
|
1223
|
+
```
|
|
1224
|
+
|
|
1225
|
+
Extracted from `eslint-plugin-react@7.37.5`.
|
|
1226
|
+
|
|
1227
|
+
<details>
|
|
1228
|
+
<summary>51 rules successfully migrated</summary>
|
|
1229
|
+
|
|
1230
|
+
`react/button-has-type`, `react/checked-requires-onchange-or-readonly`, `react/display-name`, `react/forbid-dom-props`, `react/forbid-elements`, `react/forward-ref-uses-ref`, `react/hook-use-state`, `react/iframe-missing-sandbox`, `react/jsx-boolean-value`, `react/jsx-filename-extension`, `react/jsx-handler-names`, `react/jsx-key`, `react/jsx-max-depth`, `react/jsx-no-comment-textnodes`, `react/jsx-no-constructed-context-values`, `react/jsx-no-duplicate-props`, `react/jsx-no-script-url`, `react/jsx-no-target-blank`, `react/jsx-no-useless-fragment`, `react/jsx-no-undef`, `react/jsx-curly-brace-presence`, `react/jsx-pascal-case`, `react/jsx-fragments`, `react/jsx-props-no-spreading`, `react/jsx-props-no-spread-multi`, `react/no-array-index-key`, `react/no-children-prop`, `react/no-danger`, `react/no-danger-with-children`, `react/no-did-mount-set-state`, `react/no-direct-mutation-state`, `react/no-find-dom-node`, `react/no-is-mounted`, `react/no-multi-comp`, `react/no-namespace`, `react/no-set-state`, `react/no-string-refs`, `react/no-redundant-should-component-update`, `react/no-render-return-value`, `react/no-this-in-sfc`, `react/no-unescaped-entities`, `react/no-unknown-property`, `react/no-unsafe`, `react/no-will-update-set-state`, `react/prefer-es6-class`, `react/react-in-jsx-scope`, `react/require-render-return`, `react/self-closing-comp`, `react/state-in-constructor`, `react/style-prop-object`, `react/void-dom-elements-no-children`
|
|
1231
|
+
|
|
1232
|
+
</details>
|
|
1233
|
+
|
|
1234
|
+
<details>
|
|
1235
|
+
<summary>50 rules have no oxlint equivalent</summary>
|
|
1236
|
+
|
|
1237
|
+
**Not yet implemented in oxlint**
|
|
1238
|
+
|
|
1239
|
+
`react/boolean-prop-naming`, `react/destructuring-assignment`, `react/forbid-component-props`, `react/function-component-definition`, `react/jsx-no-bind`, `react/jsx-no-leaked-render`, `react/jsx-no-literals`, `react/no-invalid-html-attribute`, `react/no-arrow-function-lifecycle`, `react/no-deprecated`, `react/no-did-update-set-state`, `react/no-typos`, `react/no-unstable-nested-components`, `react/no-object-type-as-default-prop`, `react/prefer-stateless-function`, `react/prop-types`, `react/require-default-props`
|
|
1240
|
+
|
|
1241
|
+
**Not portable to oxlint**
|
|
1242
|
+
|
|
1243
|
+
`react/default-props-match-prop-types`, `react/forbid-foreign-prop-types`, `react/forbid-prop-types`, `react/jsx-child-element-spacing`, `react/jsx-closing-bracket-location`, `react/jsx-closing-tag-location`, `react/jsx-curly-spacing`, `react/jsx-curly-newline`, `react/jsx-equals-spacing`, `react/jsx-first-prop-new-line`, `react/jsx-indent`, `react/jsx-indent-props`, `react/jsx-max-props-per-line`, `react/jsx-newline`, `react/jsx-one-expression-per-line`, `react/jsx-props-no-multi-spaces`, `react/jsx-sort-props`, `react/jsx-tag-spacing`, `react/jsx-uses-react`, `react/jsx-uses-vars`, `react/jsx-wrap-multilines`, `react/no-access-state-in-setstate`, `react/no-adjacent-inline-elements`, `react/no-unused-class-component-methods`, `react/no-unused-prop-types`, `react/no-unused-state`, `react/prefer-exact-props`, `react/prefer-read-only-props`, `react/require-optimization`, `react/sort-comp`, `react/sort-default-props`, `react/sort-prop-types`, `react/static-property-placement`
|
|
1244
|
+
|
|
1245
|
+
</details>
|
|
1246
|
+
|
|
1247
|
+
### `react/jsx-runtime.json`
|
|
1248
|
+
|
|
1249
|
+
```json
|
|
1250
|
+
"./node_modules/oxlint-config-presets/react/jsx-runtime.json"
|
|
1251
|
+
```
|
|
1252
|
+
|
|
1253
|
+
Extracted from `eslint-plugin-react@7.37.5`.
|
|
1254
|
+
|
|
1255
|
+
<details>
|
|
1256
|
+
<summary>1 rules successfully migrated</summary>
|
|
1257
|
+
|
|
1258
|
+
`react/react-in-jsx-scope`
|
|
1259
|
+
|
|
1260
|
+
</details>
|
|
1261
|
+
|
|
1170
1262
|
### `react-perf/recommended.json`
|
|
1171
1263
|
|
|
1172
1264
|
```json
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oxlint-config-presets",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Oxlint configurations ported from popular ESLint styleguides",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"config",
|
|
@@ -18,5 +18,19 @@
|
|
|
18
18
|
"type": "git",
|
|
19
19
|
"url": "git+https://github.com/popup-plus/oxlint-config-presets.git"
|
|
20
20
|
},
|
|
21
|
-
"type": "module"
|
|
21
|
+
"type": "module",
|
|
22
|
+
"exports": {
|
|
23
|
+
"./*.json": {
|
|
24
|
+
"types": "./oxlint-config.d.ts",
|
|
25
|
+
"default": "./*.json"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"oxlint": ">=0.15.0"
|
|
30
|
+
},
|
|
31
|
+
"peerDependenciesMeta": {
|
|
32
|
+
"oxlint": {
|
|
33
|
+
"optional": true
|
|
34
|
+
}
|
|
35
|
+
}
|
|
22
36
|
}
|
package/react/all.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"plugins": ["react"],
|
|
3
|
+
"rules": {
|
|
4
|
+
"react/button-has-type": "error",
|
|
5
|
+
"react/checked-requires-onchange-or-readonly": "error",
|
|
6
|
+
"react/display-name": "error",
|
|
7
|
+
"react/forbid-dom-props": "error",
|
|
8
|
+
"react/forbid-elements": "error",
|
|
9
|
+
"react/forward-ref-uses-ref": "error",
|
|
10
|
+
"react/hook-use-state": "error",
|
|
11
|
+
"react/iframe-missing-sandbox": "error",
|
|
12
|
+
"react/jsx-boolean-value": "error",
|
|
13
|
+
"react/jsx-filename-extension": "error",
|
|
14
|
+
"react/jsx-handler-names": "error",
|
|
15
|
+
"react/jsx-key": "error",
|
|
16
|
+
"react/jsx-max-depth": "error",
|
|
17
|
+
"react/jsx-no-comment-textnodes": "error",
|
|
18
|
+
"react/jsx-no-constructed-context-values": "error",
|
|
19
|
+
"react/jsx-no-duplicate-props": "error",
|
|
20
|
+
"react/jsx-no-script-url": "error",
|
|
21
|
+
"react/jsx-no-target-blank": "error",
|
|
22
|
+
"react/jsx-no-useless-fragment": "error",
|
|
23
|
+
"react/jsx-no-undef": "error",
|
|
24
|
+
"react/jsx-curly-brace-presence": "error",
|
|
25
|
+
"react/jsx-pascal-case": "error",
|
|
26
|
+
"react/jsx-fragments": "error",
|
|
27
|
+
"react/jsx-props-no-spreading": "error",
|
|
28
|
+
"react/jsx-props-no-spread-multi": "error",
|
|
29
|
+
"react/no-array-index-key": "error",
|
|
30
|
+
"react/no-children-prop": "error",
|
|
31
|
+
"react/no-danger": "error",
|
|
32
|
+
"react/no-danger-with-children": "error",
|
|
33
|
+
"react/no-did-mount-set-state": "error",
|
|
34
|
+
"react/no-direct-mutation-state": "error",
|
|
35
|
+
"react/no-find-dom-node": "error",
|
|
36
|
+
"react/no-is-mounted": "error",
|
|
37
|
+
"react/no-multi-comp": "error",
|
|
38
|
+
"react/no-namespace": "error",
|
|
39
|
+
"react/no-set-state": "error",
|
|
40
|
+
"react/no-string-refs": "error",
|
|
41
|
+
"react/no-redundant-should-component-update": "error",
|
|
42
|
+
"react/no-render-return-value": "error",
|
|
43
|
+
"react/no-this-in-sfc": "error",
|
|
44
|
+
"react/no-unescaped-entities": "error",
|
|
45
|
+
"react/no-unknown-property": "error",
|
|
46
|
+
"react/no-unsafe": "error",
|
|
47
|
+
"react/no-will-update-set-state": "error",
|
|
48
|
+
"react/prefer-es6-class": "error",
|
|
49
|
+
"react/react-in-jsx-scope": "error",
|
|
50
|
+
"react/require-render-return": "error",
|
|
51
|
+
"react/self-closing-comp": "error",
|
|
52
|
+
"react/state-in-constructor": "error",
|
|
53
|
+
"react/style-prop-object": "error",
|
|
54
|
+
"react/void-dom-elements-no-children": "error"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"plugins": ["react"],
|
|
3
|
+
"rules": {
|
|
4
|
+
"react/display-name": "error",
|
|
5
|
+
"react/jsx-key": "error",
|
|
6
|
+
"react/jsx-no-comment-textnodes": "error",
|
|
7
|
+
"react/jsx-no-duplicate-props": "error",
|
|
8
|
+
"react/jsx-no-target-blank": "error",
|
|
9
|
+
"react/jsx-no-undef": "error",
|
|
10
|
+
"react/no-children-prop": "error",
|
|
11
|
+
"react/no-danger-with-children": "error",
|
|
12
|
+
"react/no-direct-mutation-state": "error",
|
|
13
|
+
"react/no-find-dom-node": "error",
|
|
14
|
+
"react/no-is-mounted": "error",
|
|
15
|
+
"react/no-render-return-value": "error",
|
|
16
|
+
"react/no-string-refs": "error",
|
|
17
|
+
"react/no-unescaped-entities": "error",
|
|
18
|
+
"react/no-unknown-property": "error",
|
|
19
|
+
"react/no-unsafe": "off",
|
|
20
|
+
"react/react-in-jsx-scope": "error",
|
|
21
|
+
"react/require-render-return": "error"
|
|
22
|
+
}
|
|
23
|
+
}
|