-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: 修改 package.json,项目默认为 ES Module
- 升级 eslint,并使用 @antfu/eslint-config - 移除 prettier - 升级 stylelint 及相关依赖 - 修改 .mjs 文件为 .js
- Loading branch information
Showing
37 changed files
with
9,661 additions
and
7,236 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
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
This file was deleted.
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
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,6 @@ | ||
{ | ||
"words": [ | ||
"unref", | ||
"cascader" | ||
] | ||
} |
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,7 +1,6 @@ | ||
{ | ||
"recommendations": [ | ||
"esbenp.prettier-vscode", | ||
"stylelint.vscode-stylelint", | ||
"dbaeumer.vscode-eslint", | ||
] | ||
} | ||
"recommendations": [ | ||
"dbaeumer.vscode-eslint", | ||
"stylelint.vscode-stylelint" | ||
] | ||
} |
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,24 +1,29 @@ | ||
{ | ||
// 防止编辑器内置linter与插件冲突设置 | ||
"css.validate": false, | ||
"less.validate": false, | ||
"stylelint.validate": ["less"], | ||
// 每次保存的时候将代码按 eslint 格式进行修复 | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": "explicit", | ||
"source.fixAll.stylelint": "explicit" | ||
}, | ||
// json 文件按 prettier 规范格式化 | ||
"[json]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
// md 文件按 prettier 规范格式化 | ||
"[md]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[typescriptreact]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"prettier.printWidth": 180, | ||
"cSpell.words": ["unref"] | ||
// Enable the ESlint flat config support | ||
"eslint.experimental.useFlatConfig": true, | ||
// Disable the default formatter, use eslint instead | ||
"prettier.enable": false, | ||
"editor.formatOnSave": false, | ||
// Auto fix | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": "explicit", | ||
"source.fixAll.stylelint": "explicit", // stylelint | ||
"source.organizeImports": "never" | ||
}, | ||
// Enable eslint for all supported languages | ||
"eslint.validate": [ | ||
"javascript", | ||
"javascriptreact", | ||
"typescript", | ||
"typescriptreact", | ||
"vue", | ||
"html", | ||
"markdown", | ||
"json", | ||
"jsonc", | ||
"yaml", | ||
"toml", | ||
"gql", | ||
"graphql" | ||
] | ||
} |
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,5 +1,5 @@ | ||
// for jest | ||
module.exports = { | ||
export default { | ||
presets: [['@babel/preset-env', { targets: { node: 'current' } }]], | ||
plugins: ['@vue/babel-plugin-jsx'], | ||
}; |
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 @@ | ||
module.exports = { extends: ['@commitlint/config-conventional'] }; | ||
export default { extends: ['@commitlint/config-conventional'] }; |
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
This file was deleted.
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,61 @@ | ||
import config from '@antfu/eslint-config'; | ||
|
||
export default config({ | ||
stylistic: { | ||
indent: 4, | ||
quotes: 'single', | ||
semi: true, | ||
}, | ||
ignores: [ | ||
'!docs/.vitepress', | ||
'!docs/.vitepress/**', | ||
'es', | ||
'**/es/**', | ||
'lib', | ||
'**/lib/**', | ||
'dist', | ||
'**/dist/**', | ||
'empty.ts', | ||
'**/empty.ts/**', | ||
'docs/.vitepress/vueTheme', | ||
'docs/.vitepress/vueTheme/**', | ||
], | ||
vue: true, | ||
typescript: { | ||
// parserOptions: { | ||
// // https://typescript-eslint.io/linting/troubleshooting/#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file | ||
// project: './tsconfig.eslint.json', | ||
// // https://typescript-eslint.io/linting/troubleshooting/#i-use-a-framework-like-vue-that-requires-custom-file-extensions-and-i-get-errors-like-you-should-add-parseroptionsextrafileextensions-to-your-config | ||
// extraFileExtensions: ['.vue'], | ||
// }, | ||
tsconfigPath: './tsconfig.eslint.json', | ||
}, | ||
rules: { | ||
'curly': ['error', 'all'], | ||
'antfu/top-level-function': ['off'], | ||
'style/brace-style': ['error', '1tbs'], | ||
'style/arrow-parens': ['error', 'always'], | ||
'vue/block-order': ['error', { | ||
order: [['script', 'template'], 'style'], | ||
}], | ||
'ts/consistent-type-definitions': ['off'], | ||
'ts/consistent-type-imports': ['error', { | ||
prefer: 'type-imports', | ||
fixStyle: 'separate-type-imports', | ||
}], | ||
|
||
// TODO: need discuss | ||
'vue/attribute-hyphenation': ['off'], | ||
'vue/v-on-event-hyphenation': ['off'], | ||
}, | ||
}, { | ||
files: ['**/*.json'], | ||
rules: { | ||
'jsonc/indent': ['error', 2], | ||
}, | ||
}, { | ||
files: ['**/*.yml'], | ||
rules: { | ||
'yaml/indent': ['error', 2], | ||
}, | ||
}); |
File renamed without changes.
Oops, something went wrong.