Skip to content

Commit 3d0976e

Browse files
authored
Release 0.13.0 (#245)
Co-authored-by: oxc-bot <[email protected]>
1 parent 3a4a2b8 commit 3d0976e

File tree

456 files changed

+661
-461
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

456 files changed

+661
-461
lines changed

src/docs/guide/usage/linter/generated-config.md

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,35 @@ See [Oxlint Rules](https://oxc.rs/docs/guide/usage/linter/rules.html)
142142

143143
type: `object`
144144

145-
Shared settings for plugins
145+
Configure the behavior of linter plugins.
146+
147+
## Example
148+
149+
Here's an example if you're using Next.js in a monorepo:
150+
151+
```json
152+
{
153+
"settings": {
154+
"next": {
155+
"rootDir": "apps/dashboard/"
156+
},
157+
"react": {
158+
"linkComponents": [
159+
{
160+
"name": "Link",
161+
"linkAttribute": "to"
162+
}
163+
]
164+
},
165+
"jsx-a11y": {
166+
"components": {
167+
"Link": "a",
168+
"Button": "button"
169+
}
170+
}
171+
}
172+
}
173+
```
146174

147175
### settings.jsdoc
148176

@@ -214,35 +242,65 @@ default: `{}`
214242

215243
type: `object`
216244

245+
Configure JSX A11y plugin rules.
246+
247+
See [eslint-plugin-jsx-a11y](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y#configurations)'s configuration for a full reference.
248+
217249
#### settings.jsx-a11y.components
218250

219251
type: `Record<string, string>`
220252

221253
default: `{}`
222254

255+
To have your custom components be checked as DOM elements, you can provide a mapping of your component names to the DOM element name.
256+
257+
## Example
258+
259+
`json { "settings": { "jsx-a11y": { "components": { "Link": "a", "IconButton": "button" } } } } `
260+
223261
#### settings.jsx-a11y.polymorphicPropName
224262

225263
type: `[
226264
string,
227265
null
228266
]`
229267

268+
An optional setting that define the prop your code uses to create polymorphic components. This setting will be used to determine the element type in rules that require semantic context.
269+
270+
For example, if you set the `polymorphicPropName` to `as`, then this element:
271+
272+
`jsx <Box as="h3">Hello</Box> `
273+
274+
Will be treated as an `h3`. If not set, this component will be treated as a `Box`.
275+
230276
### settings.next
231277

232278
type: `object`
233279

280+
Configure Next.js plugin rules.
281+
234282
#### settings.next.rootDir
235283

236284
### settings.react
237285

238286
type: `object`
239287

288+
Configure React plugin rules.
289+
290+
Derived from [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react#configuration-legacy-eslintrc-)
291+
240292
#### settings.react.formComponents
241293

242294
type: `array`
243295

244296
default: `[]`
245297

298+
Components used as alternatives to `<form>` for forms, such as `<Formik>`.
299+
300+
## Example
301+
302+
`jsonc { "settings": { "react": { "formComponents": [ "CustomForm", // OtherForm is considered a form component and has an endpoint attribute { "name": "OtherForm", "formAttribute": "endpoint" }, // allows specifying multiple properties if necessary { "name": "Form", "formAttribute": ["registerEndpoint", "loginEndpoint"] } ] } } } `
303+
246304
##### settings.react.formComponents[n]
247305

248306
#### settings.react.linkComponents
@@ -251,4 +309,10 @@ type: `array`
251309

252310
default: `[]`
253311

312+
Components used as alternatives to `<a>` for linking, such as `<Link>`.
313+
314+
## Example
315+
316+
``jsonc { "settings": { "react": { "linkComponents": [ "HyperLink", // Use `linkAttribute` for components that use a different prop name // than `href`. { "name": "MyLink", "linkAttribute": "to" }, // allows specifying multiple properties if necessary { "name": "Link", "linkAttribute": ["to", "href"] } ] } } } ``
317+
254318
##### settings.react.linkComponents[n]

src/docs/guide/usage/linter/generated-rules.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
The progress of all rule implementations is tracked [here](https://github.com/oxc-project/oxc/issues/481).
44

5-
- Total number of rules: 453
5+
- Total number of rules: 454
66
- Rules turned on by default: 97
77

88
## Correctness (172):
@@ -183,27 +183,28 @@ Code that is outright wrong or useless.
183183
| [no-conditional-tests](/docs/guide/usage/linter/rules/vitest/no-conditional-tests.html) | vitest | | |
184184
| [require-local-test-context-for-concurrent-snapshots](/docs/guide/usage/linter/rules/vitest/require-local-test-context-for-concurrent-snapshots.html) | vitest | | 🚧 |
185185

186-
## Perf (6):
186+
## Perf (7):
187187

188188
Code that can be written to run faster.
189189
| Rule name | Source | Default | Fixable? |
190190
| --------------------------- | ---------- | ------- | -------- |
191191
| [no-await-in-loop](/docs/guide/usage/linter/rules/eslint/no-await-in-loop.html) | eslint | | |
192192
| [no-accumulating-spread](/docs/guide/usage/linter/rules/oxc/no-accumulating-spread.html) | oxc | | |
193+
| [no-array-index-key](/docs/guide/usage/linter/rules/react/no-array-index-key.html) | react | | |
193194
| [jsx-no-jsx-as-prop](/docs/guide/usage/linter/rules/react_perf/jsx-no-jsx-as-prop.html) | react_perf | | |
194195
| [jsx-no-new-array-as-prop](/docs/guide/usage/linter/rules/react_perf/jsx-no-new-array-as-prop.html) | react_perf | | |
195196
| [jsx-no-new-function-as-prop](/docs/guide/usage/linter/rules/react_perf/jsx-no-new-function-as-prop.html) | react_perf | | |
196197
| [jsx-no-new-object-as-prop](/docs/guide/usage/linter/rules/react_perf/jsx-no-new-object-as-prop.html) | react_perf | | |
197198

198-
## Restriction (60):
199+
## Restriction (61):
199200

200201
Lints which prevent the use of language and library features. Must not be enabled as a whole, should be considered on a case-by-case basis before enabling.
201202
| Rule name | Source | Default | Fixable? |
202203
| --------------------------------------- | ---------- | ------- | -------- |
203204
| [default-case](/docs/guide/usage/linter/rules/eslint/default-case.html) | eslint | | |
204205
| [no-alert](/docs/guide/usage/linter/rules/eslint/no-alert.html) | eslint | | |
205206
| [no-bitwise](/docs/guide/usage/linter/rules/eslint/no-bitwise.html) | eslint | | |
206-
| [no-console](/docs/guide/usage/linter/rules/eslint/no-console.html) | eslint | | |
207+
| [no-console](/docs/guide/usage/linter/rules/eslint/no-console.html) | eslint | | 💡 |
207208
| [no-div-regex](/docs/guide/usage/linter/rules/eslint/no-div-regex.html) | eslint | | 🛠️ |
208209
| [no-empty](/docs/guide/usage/linter/rules/eslint/no-empty.html) | eslint | | 💡 |
209210
| [no-empty-function](/docs/guide/usage/linter/rules/eslint/no-empty-function.html) | eslint | | |
@@ -247,6 +248,7 @@ Lints which prevent the use of language and library features. Must not be enable
247248
| [no-namespace](/docs/guide/usage/linter/rules/typescript/no-namespace.html) | typescript | | |
248249
| [no-non-null-asserted-nullish-coalescing](/docs/guide/usage/linter/rules/typescript/no-non-null-asserted-nullish-coalescing.html) | typescript | | |
249250
| [no-non-null-assertion](/docs/guide/usage/linter/rules/typescript/no-non-null-assertion.html) | typescript | | |
251+
| [no-require-imports](/docs/guide/usage/linter/rules/typescript/no-require-imports.html) | typescript | | 🚧 |
250252
| [no-var-requires](/docs/guide/usage/linter/rules/typescript/no-var-requires.html) | typescript | | |
251253
| [prefer-literal-enum-member](/docs/guide/usage/linter/rules/typescript/prefer-literal-enum-member.html) | typescript | | |
252254
| [no-abusive-eslint-disable](/docs/guide/usage/linter/rules/unicorn/no-abusive-eslint-disable.html) | unicorn | | |
@@ -482,11 +484,11 @@ Code that should be written in a more idiomatic way.
482484
| [prefer-to-be-object](/docs/guide/usage/linter/rules/vitest/prefer-to-be-object.html) | vitest | | 🛠️ |
483485
| [prefer-to-be-truthy](/docs/guide/usage/linter/rules/vitest/prefer-to-be-truthy.html) | vitest | | 🛠️ |
484486

485-
## Nursery (12):
487+
## Nursery (11):
486488

487489
New lints that are still under development.
488490
| Rule name | Source | Default | Fixable? |
489-
| --------------------------------- | ------------ | ------- | -------- |
491+
| ----------------------- | ---------- | ------- | -------- |
490492
| [constructor-super](/docs/guide/usage/linter/rules/eslint/constructor-super.html) | eslint | | |
491493
| [getter-return](/docs/guide/usage/linter/rules/eslint/getter-return.html) | eslint | | |
492494
| [no-undef](/docs/guide/usage/linter/rules/eslint/no-undef.html) | eslint | | |
@@ -497,5 +499,4 @@ New lints that are still under development.
497499
| [exhaustive-deps](/docs/guide/usage/linter/rules/react/exhaustive-deps.html) | react | | |
498500
| [require-render-return](/docs/guide/usage/linter/rules/react/require-render-return.html) | react | | |
499501
| [rules-of-hooks](/docs/guide/usage/linter/rules/react/rules-of-hooks.html) | react | | |
500-
| [no-side-effects-in-initialization](/docs/guide/usage/linter/rules/tree_shaking/no-side-effects-in-initialization.html) | tree_shaking | | |
501502
| [consistent-type-imports](/docs/guide/usage/linter/rules/typescript/consistent-type-imports.html) | typescript | | 🛠️ |

src/docs/guide/usage/linter/rules/eslint/array-callback-return.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ foo.map((a) => {
2727

2828
## References
2929

30-
- [Rule Source](https://github.com/oxc-project/oxc/blob/5190b7fb280dcd15c6de81717c073b06a161ced6/crates/oxc_linter/src/rules/eslint/array_callback_return/mod.rs)
30+
- [Rule Source](https://github.com/oxc-project/oxc/blob/e91c2878d8c49213790df4d192bb3136503aa08b/crates/oxc_linter/src/rules/eslint/array_callback_return/mod.rs)

src/docs/guide/usage/linter/rules/eslint/constructor-super.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ class A extends B {
2121

2222
## References
2323

24-
- [Rule Source](https://github.com/oxc-project/oxc/blob/5190b7fb280dcd15c6de81717c073b06a161ced6/crates/oxc_linter/src/rules/eslint/constructor_super.rs)
24+
- [Rule Source](https://github.com/oxc-project/oxc/blob/e91c2878d8c49213790df4d192bb3136503aa08b/crates/oxc_linter/src/rules/eslint/constructor_super.rs)

src/docs/guide/usage/linter/rules/eslint/default-case-last.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ switch (foo) {
4343

4444
## References
4545

46-
- [Rule Source](https://github.com/oxc-project/oxc/blob/5190b7fb280dcd15c6de81717c073b06a161ced6/crates/oxc_linter/src/rules/eslint/default_case_last.rs)
46+
- [Rule Source](https://github.com/oxc-project/oxc/blob/e91c2878d8c49213790df4d192bb3136503aa08b/crates/oxc_linter/src/rules/eslint/default_case_last.rs)

src/docs/guide/usage/linter/rules/eslint/default-case.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ switch (foo) {
2525

2626
## References
2727

28-
- [Rule Source](https://github.com/oxc-project/oxc/blob/5190b7fb280dcd15c6de81717c073b06a161ced6/crates/oxc_linter/src/rules/eslint/default_case.rs)
28+
- [Rule Source](https://github.com/oxc-project/oxc/blob/e91c2878d8c49213790df4d192bb3136503aa08b/crates/oxc_linter/src/rules/eslint/default_case.rs)

src/docs/guide/usage/linter/rules/eslint/default-param-last.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ createUser(undefined, "tabby");
2727

2828
## References
2929

30-
- [Rule Source](https://github.com/oxc-project/oxc/blob/5190b7fb280dcd15c6de81717c073b06a161ced6/crates/oxc_linter/src/rules/eslint/default_param_last.rs)
30+
- [Rule Source](https://github.com/oxc-project/oxc/blob/e91c2878d8c49213790df4d192bb3136503aa08b/crates/oxc_linter/src/rules/eslint/default_param_last.rs)

src/docs/guide/usage/linter/rules/eslint/eqeqeq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ a == b;
2626

2727
## References
2828

29-
- [Rule Source](https://github.com/oxc-project/oxc/blob/5190b7fb280dcd15c6de81717c073b06a161ced6/crates/oxc_linter/src/rules/eslint/eqeqeq.rs)
29+
- [Rule Source](https://github.com/oxc-project/oxc/blob/e91c2878d8c49213790df4d192bb3136503aa08b/crates/oxc_linter/src/rules/eslint/eqeqeq.rs)

src/docs/guide/usage/linter/rules/eslint/for-direction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,4 @@ for (let i = MIN; i <= MAX; i -= 0) {
6666

6767
## References
6868

69-
- [Rule Source](https://github.com/oxc-project/oxc/blob/5190b7fb280dcd15c6de81717c073b06a161ced6/crates/oxc_linter/src/rules/eslint/for_direction.rs)
69+
- [Rule Source](https://github.com/oxc-project/oxc/blob/e91c2878d8c49213790df4d192bb3136503aa08b/crates/oxc_linter/src/rules/eslint/for_direction.rs)

src/docs/guide/usage/linter/rules/eslint/func-names.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,4 @@ Foo.prototype.bar = function () {};
8080

8181
## References
8282

83-
- [Rule Source](https://github.com/oxc-project/oxc/blob/5190b7fb280dcd15c6de81717c073b06a161ced6/crates/oxc_linter/src/rules/eslint/func_names.rs)
83+
- [Rule Source](https://github.com/oxc-project/oxc/blob/e91c2878d8c49213790df4d192bb3136503aa08b/crates/oxc_linter/src/rules/eslint/func_names.rs)

0 commit comments

Comments
 (0)