Skip to content

Commit 2a15382

Browse files
Boshengithub-actions[bot]
authored andcommitted
Release 1.21.0
1 parent ee6e340 commit 2a15382

File tree

5 files changed

+156
-4
lines changed

5 files changed

+156
-4
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ default: `null`
151151

152152
JS plugins.
153153

154+
Note: JS plugins are experimental and not subject to semver.
155+
They are not supported in language server at present.
156+
154157
## overrides
155158

156159
type: `array`
@@ -171,6 +174,9 @@ type: `string[]`
171174

172175
JS plugins for this override.
173176

177+
Note: JS plugins are experimental and not subject to semver.
178+
They are not supported in language server at present.
179+
174180
#### overrides[n].rules
175181

176182
type: `object`

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

Lines changed: 5 additions & 3 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: 602
5+
- Total number of rules: 604
66
- Rules turned on by default: 103
77

88
**Legend for 'Fixable?' column:**
@@ -235,7 +235,7 @@ Code that can be written to run faster.
235235
| [prefer-array-flat-map](/docs/guide/usage/linter/rules/unicorn/prefer-array-flat-map.html) | unicorn | | 🛠️ |
236236
| [prefer-set-has](/docs/guide/usage/linter/rules/unicorn/prefer-set-has.html) | unicorn | | ⚠️🛠️️ |
237237

238-
## Restriction (74):
238+
## Restriction (75):
239239

240240
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.
241241

@@ -314,9 +314,10 @@ Lints which prevent the use of language and library features. Must not be enable
314314
| [prefer-node-protocol](/docs/guide/usage/linter/rules/unicorn/prefer-node-protocol.html) | unicorn | | 🛠️ |
315315
| [prefer-number-properties](/docs/guide/usage/linter/rules/unicorn/prefer-number-properties.html) | unicorn | | ⚠️🛠️️ |
316316
| [max-props](/docs/guide/usage/linter/rules/vue/max-props.html) | vue | | |
317+
| [no-import-compiler-macros](/docs/guide/usage/linter/rules/vue/no-import-compiler-macros.html) | vue | | ⚠️🛠️️ |
317318
| [no-multiple-slot-args](/docs/guide/usage/linter/rules/vue/no-multiple-slot-args.html) | vue | | 🚧 |
318319

319-
## Suspicious (46):
320+
## Suspicious (47):
320321

321322
code that is most likely wrong or useless.
322323

@@ -368,6 +369,7 @@ code that is most likely wrong or useless.
368369
| [require-module-specifiers](/docs/guide/usage/linter/rules/unicorn/require-module-specifiers.html) | unicorn | | 🛠️ |
369370
| [require-post-message-target-origin](/docs/guide/usage/linter/rules/unicorn/require-post-message-target-origin.html) | unicorn | | 💡 |
370371
| [no-required-prop-with-default](/docs/guide/usage/linter/rules/vue/no-required-prop-with-default.html) | vue | | 🚧 |
372+
| [require-default-export](/docs/guide/usage/linter/rules/vue/require-default-export.html) | vue | | |
371373

372374
## Pedantic (101):
373375

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export default {
22
load() {
3-
return "d16df93cf48e1ed143f54797842f84116484b4ba";
3+
return "493082c477cb4bb79d9f7d1901a99d2ebc319098";
44
},
55
};
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<!-- This file is auto-generated by tasks/website/src/linter/rules/doc_page.rs. Do not edit it manually. -->
2+
3+
<script setup>
4+
import { data } from '../version.data.js';
5+
const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_linter/src/rules/vue/no_import_compiler_macros.rs`;
6+
</script>
7+
8+
# vue/no-import-compiler-macros <Badge type="info" text="Restriction" />
9+
10+
<div class="rule-meta">
11+
<Alert class="fix" type="info">
12+
<span class="emoji">⚠️🛠️️</span> A dangerous auto-fix is available for this rule.
13+
</Alert>
14+
</div>
15+
16+
### What it does
17+
18+
Disallow importing Vue compiler macros.
19+
20+
### Why is this bad?
21+
22+
Compiler Macros like:
23+
24+
- `defineProps`
25+
- `defineEmits`
26+
- `defineExpose`
27+
- `withDefaults`
28+
- `defineModel`
29+
- `defineOptions`
30+
- `defineSlots`
31+
32+
are globally available in Vue 3's `<script setup>` and do not require explicit imports.
33+
34+
### Examples
35+
36+
Examples of **incorrect** code for this rule:
37+
38+
```vue
39+
<script setup>
40+
import { defineProps, withDefaults } from "vue";
41+
</script>
42+
```
43+
44+
Examples of **correct** code for this rule:
45+
46+
```vue
47+
<script setup>
48+
import { ref } from "vue";
49+
</script>
50+
```
51+
52+
## How to use
53+
54+
To **enable** this rule in the CLI or using the config file, you can use:
55+
56+
::: code-group
57+
58+
```bash [CLI]
59+
oxlint --deny vue/no-import-compiler-macros --vue-plugin
60+
```
61+
62+
```json [Config (.oxlintrc.json)]
63+
{
64+
"plugins": ["vue"],
65+
"rules": {
66+
"vue/no-import-compiler-macros": "error"
67+
}
68+
}
69+
```
70+
71+
:::
72+
73+
## References
74+
75+
- <a v-bind:href="source" target="_blank" rel="noreferrer">Rule Source</a>
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<!-- This file is auto-generated by tasks/website/src/linter/rules/doc_page.rs. Do not edit it manually. -->
2+
3+
<script setup>
4+
import { data } from '../version.data.js';
5+
const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_linter/src/rules/vue/require_default_export.rs`;
6+
</script>
7+
8+
# vue/require-default-export <Badge type="info" text="Suspicious" />
9+
10+
<div class="rule-meta">
11+
</div>
12+
13+
### What it does
14+
15+
Require components to be the default export.
16+
17+
### Why is this bad?
18+
19+
Using SFCs (Single File Components) without a default export is
20+
not supported in Vue 3. Components should be exported as the default export.
21+
22+
### Examples
23+
24+
Examples of **incorrect** code for this rule:
25+
26+
```vue
27+
<script>
28+
const foo = "foo";
29+
</script>
30+
```
31+
32+
Examples of **correct** code for this rule:
33+
34+
```vue
35+
<script>
36+
export default {
37+
data() {
38+
return {
39+
foo: "foo",
40+
};
41+
},
42+
};
43+
</script>
44+
```
45+
46+
## How to use
47+
48+
To **enable** this rule in the CLI or using the config file, you can use:
49+
50+
::: code-group
51+
52+
```bash [CLI]
53+
oxlint --deny vue/require-default-export --vue-plugin
54+
```
55+
56+
```json [Config (.oxlintrc.json)]
57+
{
58+
"plugins": ["vue"],
59+
"rules": {
60+
"vue/require-default-export": "error"
61+
}
62+
}
63+
```
64+
65+
:::
66+
67+
## References
68+
69+
- <a v-bind:href="source" target="_blank" rel="noreferrer">Rule Source</a>

0 commit comments

Comments
 (0)