Skip to content

Commit

Permalink
build: 配置代码格式化
Browse files Browse the repository at this point in the history
  • Loading branch information
kailong502431556 committed Dec 7, 2021
1 parent ced99de commit ffdb556
Show file tree
Hide file tree
Showing 7 changed files with 4,885 additions and 1,189 deletions.
82 changes: 77 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,79 @@
module.exports = {
extends: ['@antfu'],
// @ts-check
const { defineConfig } = require('eslint-define-config')
module.exports = defineConfig({
root: true,
env: {
browser: true,
node: true,
es6: true
},
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
ecmaVersion: 2020,
sourceType: 'module',
jsxPragma: 'React',
ecmaFeatures: {
jsx: true
}
},
extends: [
'plugin:vue/vue3-recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
'plugin:prettier/recommended'
],
rules: {
'comma-dangle': [2, 'never'],
curly: [2, 'multi-line']
'vue/script-setup-uses-vars': 'error',
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-empty-function': 'off',
'vue/custom-event-name-casing': 'off',
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_'
}
],
'no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_'
}
],
'space-before-function-paren': 'off',

'vue/attributes-order': 'off',
'vue/one-component-per-file': 'off',
'vue/html-closing-bracket-newline': 'off',
'vue/max-attributes-per-line': 'off',
'vue/multiline-html-element-content-newline': 'off',
'vue/singleline-html-element-content-newline': 'off',
'vue/attribute-hyphenation': 'off',
'vue/require-default-prop': 'off',
'vue/require-explicit-emits': 'off',
'vue/html-self-closing': [
'error',
{
html: {
void: 'always',
normal: 'never',
component: 'always'
},
svg: 'always',
math: 'always'
}
],
'vue/multi-word-component-names': 'off'
}
}
})
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"vue-router": "^4.0.12"
},
"devDependencies": {
"@antfu/eslint-config": "^0.12.1",
"@commitlint/cli": "^15.0.0",
"@commitlint/config-conventional": "^15.0.0",
"@typescript-eslint/eslint-plugin": "^5.6.0",
Expand All @@ -38,17 +37,19 @@
"eslint": "^8.4.1",
"eslint-config-prettier": "^8.3.0",
"eslint-define-config": "^1.2.0",
"eslint-plugin-jest": "^25.3.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-vue": "^8.2.0",
"husky": "^7.0.4",
"less": "^4.1.2",
"lint-staged": "^12.1.2",
"postcss": "^8.4.4",
"postcss-html": "^1.3.0",
"postcss-less": "^5.0.0",
"prettier": "^2.5.1",
"pretty-quick": "^3.1.2",
"rimraf": "^3.0.2",
"stylelint": "^14.1.0",
"stylelint-config-html": "^1.0.0",
"stylelint-config-prettier": "^9.0.3",
"stylelint-config-standard": "^24.0.0",
"stylelint-order": "^5.0.0",
Expand All @@ -59,8 +60,7 @@
"vite-plugin-eslint": "^1.3.0",
"vite-plugin-vue-setup-extend": "^0.1.0",
"vite-plugin-windicss": "^1.5.4",
"vue-eslint-parser": "^8.0.1",
"vue-tsc": "^0.3.0",
"windicss": "^3.2.1"
}
}
}
Loading

0 comments on commit ffdb556

Please sign in to comment.