-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
186 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import type { ConfigItem } from '@antfu/eslint-config' | ||
|
||
export const all: ConfigItem[] = [ | ||
{ | ||
name: 'dxhuii:all', | ||
rules: { | ||
'antfu/no-cjs-exports': 'off', // 允许使用 commonjs 的 exports | ||
'antfu/consistent-list-newline': 'off', // 允许在数组元素之间换行 | ||
'arrow-parens': ['error', 'as-needed'], // 箭头函数参数只有一个时不需要括号 | ||
|
||
'import/prefer-default-export': 'off', // 允许使用 export | ||
'import/extensions': 'off', // 允许不写文件后缀 | ||
|
||
'no-multi-str': 'off', // 允许多行字符串 | ||
'no-restricted-globals': 'off', // 允许使用全局变量 | ||
'no-console': 'off', // 允许使用 console | ||
|
||
'node/prefer-global/process': 'off', // 允许使用 process | ||
|
||
// 删除未尾逗号 | ||
'jsonc/comma-dangle': ['error', 'never'], | ||
'style/comma-dangle': ['error', 'never'], | ||
'style/jsx-quotes': ['error', 'prefer-single'], // jsx 使用单引号 | ||
'style/jsx-closing-bracket-location': ['error', 'after-props'], | ||
'style/jsx-wrap-multilines': ['error', { | ||
declaration: 'parens-new-line', | ||
assignment: 'parens-new-line', | ||
return: 'parens-new-line', | ||
arrow: 'parens-new-line', | ||
condition: 'parens-new-line', | ||
logical: 'parens-new-line', | ||
prop: 'parens-new-line' | ||
}], | ||
// 删除未使用的依赖 | ||
'unused-imports/no-unused-imports': 'error', | ||
'unused-imports/no-unused-vars': [ | ||
'warn', | ||
{ | ||
vars: 'all', | ||
varsIgnorePattern: '^_', | ||
args: 'after-used', | ||
argsIgnorePattern: '^_' | ||
} | ||
] | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
export * from './react' | ||
export * from './vue' | ||
export * from './all' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import type { ConfigItem } from '@antfu/eslint-config' | ||
import { GLOB_VUE } from '../globs' | ||
|
||
export const vue: ConfigItem[] = [ | ||
{ | ||
files: [GLOB_VUE], | ||
name: 'dxhuii:vue', | ||
rules: { | ||
'vue/v-on-event-hyphenation': ['error', 'never'], // 事件名不允许使用连字符 | ||
'vue/valid-attribute-name': 'off', // 属性名不允许使用连字符 | ||
// 关闭组件命名规则 | ||
'vue/multi-word-component-names': 'off', // 组件名不允许使用连字符 | ||
'vue/custom-event-name-casing': ['error', 'camelCase', { // 事件名不允许使用连字符 | ||
ignores: [ | ||
'/^(click):[a-z]+[a-zA-Z]+$/' | ||
] | ||
}] | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
export const GLOB_JSX = '**/*.?([cm])jsx' | ||
export const GLOB_TSX = '**/*.?([cm])tsx' | ||
|
||
export const GLOB_VUE = '**/*.vue' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters