Skip to content

Commit eee6319

Browse files
committed
feat: 更新 ESLint 配置,新增 VUE_FILES 常量并在 Vue 规则中使用,同时重命名示例目录
1 parent efe4519 commit eee6319

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

pnpm-lock.yaml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/constants.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ export const JAVASCRIPT_FILES = ['**/*.{js,jsx,mjs,cjs}']
22

33
export const TYPESCRIPT_FILES = ['**/*.{ts,tsx,mts,cts}']
44

5+
export const VUE_FILES = ['**/*.{vue}']
6+
57
export const NORMAL_STYLISTIC_CUSTOMIZE_OPTIONS = {
68
indent: 2,
79
quotes: 'single',

src/eslint/preset/nuxt.mjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import tailwind from '../tailwindcss.mjs'
2+
import typescriptStrict from '../typescript-strict.mjs'
3+
import vue from '../vue.mjs'
4+
import normal from './normal.mjs'
5+
6+
export default [
7+
...normal,
8+
...tailwind,
9+
...typescriptStrict,
10+
...vue,
11+
]

src/eslint/vue.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import pluginVue from 'eslint-plugin-vue'
22

3+
import { VUE_FILES } from '../constants.mjs'
4+
35
export default [
46
...pluginVue.configs['flat/recommended'],
57

68
{
7-
files: ['**/*.vue'],
9+
files: [VUE_FILES],
810
rules: {
911
'vue/attributes-order': [
1012
1,

0 commit comments

Comments
 (0)