chore: 去掉eslint prettier warning

This commit is contained in:
roymondchen 2022-12-08 17:17:13 +08:00
parent a40db172bb
commit d051aeb155
14 changed files with 271 additions and 43 deletions

View File

@ -14,7 +14,7 @@ module.exports = {
'eslint-config-tencent',
'eslint-config-tencent/ts',
'plugin:vue/vue3-essential',
'eslint-config-tencent/prettier',
'./prettier',
],
parser: 'vue-eslint-parser',
parserOptions: {

View File

@ -14,7 +14,7 @@ module.exports = {
extends: [
'eslint-config-tencent',
'eslint-config-tencent/ts',
'eslint-config-tencent/prettier',
'./prettier',
],
plugins: [
'@typescript-eslint',

View File

@ -0,0 +1,76 @@
module.exports = {
plugins: ['prettier'],
rules: {
'wrap-iife': 'off',
'template-curly-spacing': 'off',
'space-infix-ops': 'off',
'space-in-parens': 'off',
'space-before-blocks': 'off',
'quote-props': 'off',
'padded-blocks': 'off',
'operator-linebreak': 'off',
'object-curly-spacing': 'off',
'nonblock-statement-body-position': 'off',
'no-whitespace-before-property': 'off',
'no-trailing-spaces': 'off',
'no-multiple-empty-lines': 'off',
'no-mixed-operators': 'off',
'no-confusing-arrow': 'off',
'newline-per-chained-call': 'off',
'max-len': 'off',
'linebreak-style': 'off',
'key-spacing': 'off',
'implicit-arrow-linebreak': 'off',
'generator-star-spacing': 'off',
'function-paren-newline': 'off',
'eol-last': 'off',
'computed-property-spacing': 'off',
'comma-style': 'off',
'comma-dangle': 'off',
'block-spacing': 'off',
'arrow-spacing': 'off',
'arrow-parens': 'off',
'array-bracket-spacing': 'off',
'@typescript-eslint/type-annotation-spacing': 'off',
'@typescript-eslint/space-before-function-paren': 'off',
'@typescript-eslint/semi': 'off',
'@typescript-eslint/quotes': 'off',
'@typescript-eslint/keyword-spacing': 'off',
'@typescript-eslint/indent': 'off',
'@typescript-eslint/func-call-spacing': 'off',
'@typescript-eslint/comma-spacing': 'off',
'@typescript-eslint/brace-style': 'off',
/**
* prettier 格式错误
*/
'prettier/prettier': [
'warn',
{
printWidth: 120,
tabWidth: 2,
useTabs: false,
semi: true,
singleQuote: true,
quoteProps: 'as-needed',
jsxSingleQuote: false,
trailingComma: 'all',
bracketSpacing: true,
jsxBracketSameLine: false,
arrowParens: 'always',
rangeStart: 0,
rangeEnd: null,
requirePragma: false,
insertPragma: false,
proseWrap: 'preserve',
htmlWhitespaceSensitivity: 'css',
vueIndentScriptAndStyle: false,
endOfLine: 'lf',
embeddedLanguageFormatting: 'auto',
},
{
usePrettierrc: false,
},
],
},
};

View File

@ -14,7 +14,7 @@ module.exports = {
extends: [
'eslint-config-tencent',
'eslint-config-tencent/ts',
'eslint-config-tencent/prettier',
'./prettier',
'plugin:vue/vue3-essential',
],
parser: 'vue-eslint-parser',

View File

@ -0,0 +1,76 @@
module.exports = {
plugins: ['prettier'],
rules: {
'wrap-iife': 'off',
'template-curly-spacing': 'off',
'space-infix-ops': 'off',
'space-in-parens': 'off',
'space-before-blocks': 'off',
'quote-props': 'off',
'padded-blocks': 'off',
'operator-linebreak': 'off',
'object-curly-spacing': 'off',
'nonblock-statement-body-position': 'off',
'no-whitespace-before-property': 'off',
'no-trailing-spaces': 'off',
'no-multiple-empty-lines': 'off',
'no-mixed-operators': 'off',
'no-confusing-arrow': 'off',
'newline-per-chained-call': 'off',
'max-len': 'off',
'linebreak-style': 'off',
'key-spacing': 'off',
'implicit-arrow-linebreak': 'off',
'generator-star-spacing': 'off',
'function-paren-newline': 'off',
'eol-last': 'off',
'computed-property-spacing': 'off',
'comma-style': 'off',
'comma-dangle': 'off',
'block-spacing': 'off',
'arrow-spacing': 'off',
'arrow-parens': 'off',
'array-bracket-spacing': 'off',
'@typescript-eslint/type-annotation-spacing': 'off',
'@typescript-eslint/space-before-function-paren': 'off',
'@typescript-eslint/semi': 'off',
'@typescript-eslint/quotes': 'off',
'@typescript-eslint/keyword-spacing': 'off',
'@typescript-eslint/indent': 'off',
'@typescript-eslint/func-call-spacing': 'off',
'@typescript-eslint/comma-spacing': 'off',
'@typescript-eslint/brace-style': 'off',
/**
* prettier 格式错误
*/
'prettier/prettier': [
'warn',
{
printWidth: 120,
tabWidth: 2,
useTabs: false,
semi: true,
singleQuote: true,
quoteProps: 'as-needed',
jsxSingleQuote: false,
trailingComma: 'all',
bracketSpacing: true,
jsxBracketSameLine: false,
arrowParens: 'always',
rangeStart: 0,
rangeEnd: null,
requirePragma: false,
insertPragma: false,
proseWrap: 'preserve',
htmlWhitespaceSensitivity: 'css',
vueIndentScriptAndStyle: false,
endOfLine: 'lf',
embeddedLanguageFormatting: 'auto',
},
{
usePrettierrc: false,
},
],
},
};

View File

@ -62,7 +62,7 @@
"element-plus": "^2.2.19",
"enquirer": "^2.3.6",
"eslint": "^7.29.0",
"eslint-config-tencent": "^1.0.1",
"eslint-config-tencent": "^1.0.4",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-simple-import-sort": "^7.0.0",

View File

@ -50,6 +50,6 @@
"typescript": "^4.7.4",
"vite": "^3.1.3",
"vite-plugin-vue-setup-extend": "^0.4.0",
"vue-tsc": "^1.0.10"
"vue-tsc": "^1.0.11"
}
}

View File

@ -81,6 +81,6 @@
"typescript": "^4.7.4",
"vite": "^3.1.3",
"vite-plugin-vue-setup-extend": "^0.4.0",
"vue-tsc": "^1.0.10"
"vue-tsc": "^1.0.11"
}
}

View File

@ -58,6 +58,6 @@
"typescript": "^4.7.4",
"vite": "^3.1.3",
"vite-plugin-vue-setup-extend": "^0.4.0",
"vue-tsc": "^1.0.10"
"vue-tsc": "^1.0.11"
}
}

View File

@ -55,6 +55,6 @@
"typescript": "^4.7.4",
"vite": "^3.1.3",
"vite-plugin-vue-setup-extend": "^0.4.0",
"vue-tsc": "^1.0.10"
"vue-tsc": "^1.0.11"
}
}

View File

@ -37,6 +37,6 @@
"sass": "^1.35.1",
"typescript": "^4.7.4",
"vite": "^3.1.3",
"vue-tsc": "^1.0.10"
"vue-tsc": "^1.0.11"
}
}

66
pnpm-lock.yaml generated
View File

@ -21,7 +21,7 @@ importers:
element-plus: ^2.2.19
enquirer: ^2.3.6
eslint: ^7.29.0
eslint-config-tencent: ^1.0.1
eslint-config-tencent: ^1.0.4
eslint-plugin-import: ^2.23.4
eslint-plugin-prettier: ^3.4.0
eslint-plugin-simple-import-sort: ^7.0.0
@ -139,7 +139,7 @@ importers:
vite: ^3.1.3
vite-plugin-vue-setup-extend: ^0.4.0
vue: ^3.2.37
vue-tsc: ^1.0.10
vue-tsc: ^1.0.11
dependencies:
vue: 3.2.37
devDependencies:
@ -151,7 +151,7 @@ importers:
typescript: 4.7.4
vite: 3.1.3
vite-plugin-vue-setup-extend: 0.4.0_vite@3.1.3
vue-tsc: 1.0.10_typescript@4.7.4
vue-tsc: 1.0.11_typescript@4.7.4
packages/editor:
specifiers:
@ -184,7 +184,7 @@ importers:
vite: ^3.1.3
vite-plugin-vue-setup-extend: ^0.4.0
vue: ^3.2.37
vue-tsc: ^1.0.10
vue-tsc: ^1.0.11
dependencies:
'@babel/core': 7.18.2
'@element-plus/icons-vue': 2.0.9_vue@3.2.37
@ -216,7 +216,7 @@ importers:
typescript: 4.7.4
vite: 3.1.3_sass@1.52.2
vite-plugin-vue-setup-extend: 0.4.0_vite@3.1.3
vue-tsc: 1.0.10_typescript@4.7.4
vue-tsc: 1.0.11_typescript@4.7.4
packages/element-plus-adapter:
specifiers:
@ -255,7 +255,7 @@ importers:
vite: ^3.1.3
vite-plugin-vue-setup-extend: ^0.4.0
vue: ^3.2.37
vue-tsc: ^1.0.10
vue-tsc: ^1.0.11
dependencies:
'@element-plus/icons-vue': 2.0.9_vue@3.2.37
'@tmagic/design': link:../design
@ -276,7 +276,7 @@ importers:
typescript: 4.7.4
vite: 3.1.3_sass@1.52.2
vite-plugin-vue-setup-extend: 0.4.0_vite@3.1.3
vue-tsc: 1.0.10_typescript@4.7.4
vue-tsc: 1.0.11_typescript@4.7.4
packages/schema:
specifiers:
@ -345,7 +345,7 @@ importers:
vite: ^3.1.3
vite-plugin-vue-setup-extend: ^0.4.0
vue: ^3.2.37
vue-tsc: ^1.0.10
vue-tsc: ^1.0.11
dependencies:
'@tmagic/design': link:../design
'@tmagic/form': link:../form
@ -364,7 +364,7 @@ importers:
typescript: 4.7.4
vite: 3.1.3_sass@1.52.2
vite-plugin-vue-setup-extend: 0.4.0_vite@3.1.3
vue-tsc: 1.0.10_typescript@4.7.4
vue-tsc: 1.0.11_typescript@4.7.4
packages/ui:
specifiers:
@ -475,7 +475,7 @@ importers:
vite: ^3.1.3
vue: ^3.2.37
vue-router: ^4.0.10
vue-tsc: ^1.0.10
vue-tsc: ^1.0.11
dependencies:
'@element-plus/icons-vue': 2.0.9_vue@3.2.37
'@tmagic/design': link:../packages/design
@ -501,7 +501,7 @@ importers:
sass: 1.52.2
typescript: 4.7.4
vite: 3.1.3_sass@1.52.2+terser@5.14.2
vue-tsc: 1.0.10_typescript@4.7.4
vue-tsc: 1.0.11_typescript@4.7.4
runtime/react:
specifiers:
@ -606,7 +606,7 @@ importers:
typescript: ^4.3.4
vite: ^3.1.3
vue: ^3.2.37
vue-tsc: ^1.0.10
vue-tsc: ^1.0.11
dependencies:
'@tmagic/cli': link:../../packages/cli
'@tmagic/core': link:../../packages/core
@ -630,7 +630,7 @@ importers:
sass: 1.52.2
typescript: 4.7.4
vite: 3.1.3_sass@1.52.2+terser@5.14.2
vue-tsc: 1.0.10_typescript@4.7.4
vue-tsc: 1.0.11_typescript@4.7.4
packages:
@ -1945,31 +1945,31 @@ packages:
- terser
dev: true
/@volar/language-core/1.0.10:
resolution: {integrity: sha512-7WNzjvdUXjggEZvYu9EInABl4mvXtyiiaJDOJM+plHJT7xW5voLja0BrYYji6TUn8Q4HakLvTPpQddPLq134mg==}
/@volar/language-core/1.0.11:
resolution: {integrity: sha512-YwUYKxIyDc+Fq3kQ6BGGfkrKCG5JzE2Yr6vMxrxEXW2rg/gsq3JgMk/4sI8ybRsaTirhCB4V8+AIVYsvcRxgig==}
dependencies:
'@volar/source-map': 1.0.10
'@volar/source-map': 1.0.11
'@vue/reactivity': 3.2.45
muggle-string: 0.1.0
dev: true
/@volar/source-map/1.0.10:
resolution: {integrity: sha512-jSZW1tfsvAOHlpoRy14zH9sdCYR4g8QcnCXRli8juFC2UHoVzVRKB6VdnXcx5wRAlIRXoiBpsU+pKminryKEBw==}
/@volar/source-map/1.0.11:
resolution: {integrity: sha512-tkuV9MD+OuiZfHA0qZXrPdW6F7TvnpnuTan6Qe7UGUs9+sflezlMJdjaYdGgQObfP+06pcT1E3xdkOoi08ZyyQ==}
dependencies:
muggle-string: 0.1.0
dev: true
/@volar/typescript/1.0.10:
resolution: {integrity: sha512-Nd+u2Z2P1V+KiNBMLLK6wV4sswOOYBsjEHmgK29eENXtos1+gF2GWB908vvwmT75dmCtlYZ8No14lvCqXUAVdg==}
/@volar/typescript/1.0.11:
resolution: {integrity: sha512-mq7wDDAs0Eb43jev2FxbowuiwWqvL3kb+tar1we8VQbdabpyQ5dmbWPwo/IglevMmW3SKo1Et+6rqAeZpXNnPQ==}
dependencies:
'@volar/language-core': 1.0.10
'@volar/language-core': 1.0.11
dev: true
/@volar/vue-language-core/1.0.10:
resolution: {integrity: sha512-m7pYXGwkpF9Bmuud73kGlAX31QUTwifYbgCenaqm3hGNh+SJebSkxzk4NJvabiGbA6ON3b5ayQZ/rbOEtdoghw==}
/@volar/vue-language-core/1.0.11:
resolution: {integrity: sha512-A3ODs0/ua7BcpSSnE7KtO8bzWsYsbOJRyW2Q/2uktxlfHj8srln3JdgK/mNlIgfnWtACbE5K+EfMJOgJKv864A==}
dependencies:
'@volar/language-core': 1.0.10
'@volar/source-map': 1.0.10
'@volar/language-core': 1.0.11
'@volar/source-map': 1.0.11
'@vue/compiler-dom': 3.2.45
'@vue/compiler-sfc': 3.2.45
'@vue/reactivity': 3.2.45
@ -1978,11 +1978,11 @@ packages:
vue-template-compiler: 2.7.14
dev: true
/@volar/vue-typescript/1.0.10:
resolution: {integrity: sha512-GjQ+mfIUljXGfkTmNrfNT8YYQY48mcOE5SJ190o6ENArzH9cqjmvPLo1nrdurbZOFwztwEDNye5N1/5aL9sZ1g==}
/@volar/vue-typescript/1.0.11:
resolution: {integrity: sha512-jlnFPvBcTyPiAbGlgjhKK7fp3Q+Z7Z5eU1NTbTSS0lQC8Gog3sh2UxLAFG5Voe1gHIxasoOEPXzMR0CWF4bKbA==}
dependencies:
'@volar/typescript': 1.0.10
'@volar/vue-language-core': 1.0.10
'@volar/typescript': 1.0.11
'@volar/vue-language-core': 1.0.11
dev: true
/@vue/babel-helper-vue-transform-on/1.0.2:
@ -7431,14 +7431,14 @@ packages:
he: 1.2.0
dev: true
/vue-tsc/1.0.10_typescript@4.7.4:
resolution: {integrity: sha512-o6ek6ZSDwpVWn7/ZXlIILfCZ18o7ypEYKMDynsyPj9m10/ALXkCLKIj9yVfx00QAX5Z/hKrdhYcA2ZaQ0+U7Kg==}
/vue-tsc/1.0.11_typescript@4.7.4:
resolution: {integrity: sha512-lj+6dEroPsE4wmQOPtjCzAf8x363Km5/tuEvMEoQaoRnzs9myBM46FNvCGIIPStYUGuaqF1W1bORmP2KDQEORA==}
hasBin: true
peerDependencies:
typescript: '*'
dependencies:
'@volar/vue-language-core': 1.0.10
'@volar/vue-typescript': 1.0.10
'@volar/vue-language-core': 1.0.11
'@volar/vue-typescript': 1.0.11
typescript: 4.7.4
dev: true

76
prettier.js Normal file
View File

@ -0,0 +1,76 @@
module.exports = {
plugins: ['prettier'],
rules: {
'wrap-iife': 'off',
'template-curly-spacing': 'off',
'space-infix-ops': 'off',
'space-in-parens': 'off',
'space-before-blocks': 'off',
'quote-props': 'off',
'padded-blocks': 'off',
'operator-linebreak': 'off',
'object-curly-spacing': 'off',
'nonblock-statement-body-position': 'off',
'no-whitespace-before-property': 'off',
'no-trailing-spaces': 'off',
'no-multiple-empty-lines': 'off',
'no-mixed-operators': 'off',
'no-confusing-arrow': 'off',
'newline-per-chained-call': 'off',
'max-len': 'off',
'linebreak-style': 'off',
'key-spacing': 'off',
'implicit-arrow-linebreak': 'off',
'generator-star-spacing': 'off',
'function-paren-newline': 'off',
'eol-last': 'off',
'computed-property-spacing': 'off',
'comma-style': 'off',
'comma-dangle': 'off',
'block-spacing': 'off',
'arrow-spacing': 'off',
'arrow-parens': 'off',
'array-bracket-spacing': 'off',
'@typescript-eslint/type-annotation-spacing': 'off',
'@typescript-eslint/space-before-function-paren': 'off',
'@typescript-eslint/semi': 'off',
'@typescript-eslint/quotes': 'off',
'@typescript-eslint/keyword-spacing': 'off',
'@typescript-eslint/indent': 'off',
'@typescript-eslint/func-call-spacing': 'off',
'@typescript-eslint/comma-spacing': 'off',
'@typescript-eslint/brace-style': 'off',
/**
* prettier 格式错误
*/
'prettier/prettier': [
'warn',
{
printWidth: 120,
tabWidth: 2,
useTabs: false,
semi: true,
singleQuote: true,
quoteProps: 'as-needed',
jsxSingleQuote: false,
trailingComma: 'all',
bracketSpacing: true,
jsxBracketSameLine: false,
arrowParens: 'always',
rangeStart: 0,
rangeEnd: null,
requirePragma: false,
insertPragma: false,
proseWrap: 'preserve',
htmlWhitespaceSensitivity: 'css',
vueIndentScriptAndStyle: false,
endOfLine: 'lf',
embeddedLanguageFormatting: 'auto',
},
{
usePrettierrc: false,
},
],
},
};

View File

@ -44,6 +44,6 @@
"sass": "^1.35.1",
"typescript": "^4.3.4",
"vite": "^3.1.3",
"vue-tsc": "^1.0.10"
"vue-tsc": "^1.0.11"
}
}