Skip to content

Commit

Permalink
build(eslint): 修改 eslint 配置
Browse files Browse the repository at this point in the history
  • Loading branch information
FuckDoctors committed Sep 4, 2024
1 parent 657a1b4 commit 90ec71c
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 48 deletions.
10 changes: 5 additions & 5 deletions docs/.vuepress/theme/components/hanzi/Hanzi.vue
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ function handleRead() {
<div class="hanzi-main-container">
<div class="hanzi-main">
<div class="hanzi-main__left">
<div ref="printRef" class="print hanzi" />
<div ref="printRef" class="hanzi print" />
<div ref="aniRef" class="hanzi animation" />
<div ref="writingRef" class="hanzi writing" />
<div class="hanzi-controls">
Expand Down Expand Up @@ -276,20 +276,20 @@ function handleRead() {
</div>
</div>
<div ref="detailExtraRef" class="hanzi-extra">
<div ref="strokesRef" class="hanzi-detail__strokes span" />
<div class="zitie-print span">
<div ref="strokesRef" class="span hanzi-detail__strokes" />
<div class="span zitie-print">
<Zitie
:zi="props.zi"
:hei="TIAN_HEI"
:hui="TIAN_HUI"
:kong="TIAN_KONG"
/>
</div>
<div class="info words-container span">
<div class="info span words-container">
<span class="tag">组词</span>
<span class="content">{{ zuciRet.join(' ') }}</span>
</div>
<div class="info chengyu span">
<div class="info span chengyu">
<span class="tag">成语</span>
<span class="content">{{ chengyuRef.join(' ') }}</span>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/.vuepress/theme/components/hanzi/Hanzi2.vue
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ function handleRead() {
:height="32"
/>
<div class="hanzi-container">
<div ref="printRef" class="hanzi-card print" />
<div ref="printRef" class="print hanzi-card" />
<div ref="aniRef" class="hanzi-card animation" />
<div class="hanzi-controls">
<button class="btn-voice btn" title="发音" @click="handleVoice" />
Expand Down
85 changes: 44 additions & 41 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,47 +1,50 @@
// @ts-check
import antfu from '@antfu/eslint-config'

export default antfu({
unocss: true,
formatters: true,
export default antfu(
{
unocss: true,
formatters: true,

ignores: [
'dist/',
'public/',
'docs/.vuepress/.cache/',
'docs/.vuepress/.temp/',
'docs/.vuepress/public/',
'docs/.vuepress/public/assets/js/',
'docs/.vuepress/public/zhaobc.site/',
'**/*.d.ts',
],

rules: {
// override default options for rules from base configurations
'quote-props': ['warn', 'as-needed'],
'style/quote-props': ['warn', 'as-needed'],
// 'comma-dangle': ['warn', 'only-multiline'],
'comma-dangle': [
'error',
{
arrays: 'only-multiline',
objects: 'only-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'only-multiline',
},
ignores: [
'dist/',
'public/',
'docs/.vuepress/.cache/',
'docs/.vuepress/.temp/',
'docs/.vuepress/public/',
'docs/.vuepress/public/assets/js/',
'docs/.vuepress/public/zhaobc.site/',
'**/*.d.ts',
],
'@typescript-eslint/comma-dangle': 'off',
'@typescript-eslint/brace-style': 'off',
'style/brace-style': ['warn', '1tbs'],
'arrow-parens': ['warn', 'as-needed'],
'style/arrow-parens': ['warn', 'as-needed'],
curly: ['warn', 'all'],
'no-unused-vars': ['warn'],
'vue/no-unused-refs': ['warn'],
'eslint-comments/no-unlimited-disable': ['warn'],
'style/max-statements-per-line': ['warn'],
'vue/no-irregular-whitespace': ['warn'],
'no-irregular-whitespace': ['warn'],
},
})
{
rules: {
// override default options for rules from base configurations
'quote-props': ['warn', 'as-needed'],
'style/quote-props': ['warn', 'as-needed'],
// 'comma-dangle': ['warn', 'only-multiline'],
'comma-dangle': [
'error',
{
arrays: 'only-multiline',
objects: 'only-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'only-multiline',
},
],
'@typescript-eslint/comma-dangle': 'off',
'@typescript-eslint/brace-style': 'off',
'style/brace-style': ['warn', '1tbs'],
'arrow-parens': ['warn', 'as-needed'],
'style/arrow-parens': ['warn', 'as-needed'],
curly: ['warn', 'all'],
'no-unused-vars': ['warn'],
'vue/no-unused-refs': ['warn'],
'eslint-comments/no-unlimited-disable': ['warn'],
'style/max-statements-per-line': ['warn'],
'vue/no-irregular-whitespace': ['warn'],
'no-irregular-whitespace': ['warn'],
},
}
)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"lint:antfu": "eslint .",
"lint:antfu-fix": "eslint . --fix",
"lint:types": "vue-tsc --noEmit --skipLibCheck",
"lint:css": "stylelint --fix \"**/*.{css,scss,vue}\"",
"lint:css": "stylelint --fix \"**/*.{css,scss,vue}\" --allow-empty-input",
"lint:js": "eslint --fix \"**/*.{js,ts,vue,jsx,tsx}\"",
"lint:md": "markdownlint --fix \"**/*.md\"",
"lint:remark": "remark .",
Expand Down

0 comments on commit 90ec71c

Please sign in to comment.