7693b49253
- Replace @robonen/oxlint with @robonen/eslint (composable ESLint flat-config presets: base, typescript, vue, vitest, imports, node, stylistic). - Plugins bundled as deps: typescript-eslint, eslint-plugin-vue, @vitest/eslint-plugin, eslint-plugin-import-x, eslint-plugin-n, eslint-plugin-unicorn, @stylistic/eslint-plugin. - @robonen/tsconfig: add base/dom/node/vue configs for composite project refs.
31 lines
690 B
Markdown
31 lines
690 B
Markdown
# 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>
|
|
```
|