mirror of
https://github.com/robonen/tools.git
synced 2026-03-20 02:44:45 +00:00
feat(monorepo): migrate vue packages and apply oxlint refactors
This commit is contained in:
30
configs/oxlint/rules/vue.md
Normal file
30
configs/oxlint/rules/vue.md
Normal file
@@ -0,0 +1,30 @@
|
||||
# vue preset
|
||||
|
||||
## Purpose
|
||||
|
||||
Правила для Vue 3 с упором на Composition API и `<script setup>`.
|
||||
|
||||
## Key Rules
|
||||
|
||||
- `vue/no-export-in-script-setup`.
|
||||
- `vue/no-import-compiler-macros`.
|
||||
- `vue/define-props-declaration`: type-based.
|
||||
- `vue/define-emits-declaration`: type-based.
|
||||
- `vue/valid-define-props`, `vue/valid-define-emits`.
|
||||
- `vue/no-lifecycle-after-await`.
|
||||
|
||||
## Examples
|
||||
|
||||
```vue
|
||||
<script setup lang="ts">
|
||||
const props = defineProps<{ id: string }>();
|
||||
const emit = defineEmits<{ change: [value: string] }>();
|
||||
</script>
|
||||
|
||||
<!-- ❌ Bad -->
|
||||
<script setup lang="ts">
|
||||
import { defineProps } from 'vue';
|
||||
export const x = 1;
|
||||
const props = defineProps({ id: String });
|
||||
</script>
|
||||
```
|
||||
Reference in New Issue
Block a user