1.package.json
"rules": {
semi: ['error', 'never'],
'no-trailing-spaces': 1,
'no-extra-parens': ['error', 'all', { nestedBinaryExpressions: false }],
'no-var': 'error',
indent: ['error', 4],
'comma-dangle': ['error', 'never'],
'comma-spacing': ['error', { before: false, after: true }],
'array-bracket-spacing': ['error', 'never'],
'implicit-arrow-linebreak': ['error', 'beside'],
'lines-between-class-members': ['error', 'always'],
'max-len': ['error', { code: 280 }],
quotes: ['error', 'single', { allowTemplateLiterals: true }],
'arrow-spacing': 'error',
'no-use-before-define': ['error', { functions: false, classes: false }],
'no-invalid-this': 'warn',
eqeqeq: ['error', 'always'],
curly: 'error',
'object-curly-spacing': ['error', 'always'],
'space-before-function-paren': 0,
'handle-callback-err': 0,
camelcase: 0,
'no-explicit-any': 0,
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off"
}
2.settings.json
{
"eslint.format.enable": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
},
"[typescript]": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[vue]": {
"editor.defaultFormatter": "octref.vetur"
},
"vetur.format.defaultFormatterOptions": {
"prettier": {
"wrap_attributes": "force-aligned",
"semi": false,
"trailingComma": "none",
"singleQuote": true,
"eslintIntegration": true,
},
"js-beautify-html": {
"wrap_line_length": 120,
"wrap_attributes": "auto",
"end_with_newline": false
}
},
"vetur.format.options.tabSize": 4,
"vetur.format.defaultFormatter.js": "vscode-typescript",
"vetur.format.defaultFormatter.html": "js-beautify-html",
"eslint.validate": [
"javascript",
"javascriptreact",
"html",
"vue",
"typescript",
"typescriptreact"
],
"editor.formatOnSave": true,
"editor.formatOnType": true,
"editor.formatOnPaste": true,
"prettier.arrowParens": "avoid",
"prettier.trailingComma": "none",
"prettier.vueIndentScriptAndStyle": true,
"auto-rename-tag.activationOnLanguage": [
"*"
]
}