mirror of
https://github.com/chansee97/nova-admin.git
synced 2025-04-06 03:57:54 +08:00
chore(all): 添加并配置prettier
This commit is contained in:
parent
d12ef03342
commit
139e4c65ee
10
.eslintrc.js
10
.eslintrc.js
@ -1,4 +1,4 @@
|
|||||||
module.exports = {
|
module.exports = { //https://eslint.org/docs/latest/
|
||||||
root: true,
|
root: true,
|
||||||
// 环境变量 https://eslint.org/docs/latest/user-guide/configuring/language-options#specifying-environments
|
// 环境变量 https://eslint.org/docs/latest/user-guide/configuring/language-options#specifying-environments
|
||||||
env: {
|
env: {
|
||||||
@ -27,10 +27,8 @@ module.exports = {
|
|||||||
'@vue/typescript/recommended'
|
'@vue/typescript/recommended'
|
||||||
],
|
],
|
||||||
rules: {
|
rules: {
|
||||||
'no-var': 'error',
|
'no-var': 'error', // 禁止使用var
|
||||||
// 禁止出现console
|
'no-console': 'warn', // 禁止出现console
|
||||||
'no-console': 'warn',
|
"no-debugger": "off", // 关闭debugger警告
|
||||||
// 关闭debugger警告
|
|
||||||
"no-debugger": "off",
|
|
||||||
}
|
}
|
||||||
};
|
};
|
40
.prettierignore
Normal file
40
.prettierignore
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
.DS_Store
|
||||||
|
node_modules
|
||||||
|
node_modules/**/*
|
||||||
|
node_modules/**/*.*
|
||||||
|
/dist
|
||||||
|
|
||||||
|
|
||||||
|
# local env files
|
||||||
|
.env.local
|
||||||
|
.env.*.local
|
||||||
|
|
||||||
|
# Log files
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
pnpm-debug.log*
|
||||||
|
|
||||||
|
# Editor directories and files
|
||||||
|
.idea
|
||||||
|
.vscode
|
||||||
|
*.suo
|
||||||
|
*.ntvs*
|
||||||
|
*.njsproj
|
||||||
|
*.sln
|
||||||
|
*.sw?
|
||||||
|
|
||||||
|
|
||||||
|
# 重要的环境依赖文件
|
||||||
|
package.json
|
||||||
|
package.lock.json
|
||||||
|
|
||||||
|
# 代码格式化插件的配置文件
|
||||||
|
.prettierrc
|
||||||
|
.prettierignore
|
||||||
|
|
||||||
|
# git忽略文件
|
||||||
|
.gitignore
|
||||||
|
|
||||||
|
# 不对markdown进行格式化, 容易打乱自己编排的样式
|
||||||
|
*.md
|
27
.prettierrc.js
Normal file
27
.prettierrc.js
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
module.exports = { // https://prettier.io/docs/en/options.html
|
||||||
|
arrowParens: 'avoid',
|
||||||
|
// bracketSameLine: false,
|
||||||
|
// bracketSpacing: true,
|
||||||
|
// embeddedLanguageFormatting: 'auto',
|
||||||
|
// htmlWhitespaceSensitivity: 'css',
|
||||||
|
// insertPragma: false,
|
||||||
|
// jsxSingleQuote: false,
|
||||||
|
printWidth: 120,
|
||||||
|
// proseWrap: 'preserve',
|
||||||
|
// quoteProps: 'as-needed',
|
||||||
|
// requirePragma: false,
|
||||||
|
// semi: true,
|
||||||
|
singleQuote: true,
|
||||||
|
tabWidth: 2,
|
||||||
|
trailingComma: 'none',
|
||||||
|
// useTabs: false,
|
||||||
|
// vueIndentScriptAndStyle: false,
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
files: '*.html',
|
||||||
|
options: {
|
||||||
|
parser: 'html',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
@ -18,10 +18,12 @@
|
|||||||
"@vue/eslint-config-prettier": "^7.0.0",
|
"@vue/eslint-config-prettier": "^7.0.0",
|
||||||
"@vue/eslint-config-typescript": "^11.0.0",
|
"@vue/eslint-config-typescript": "^11.0.0",
|
||||||
"eslint": "^8.21.0",
|
"eslint": "^8.21.0",
|
||||||
|
"eslint-config-prettier": "^8.5.0",
|
||||||
"eslint-import-resolver-alias": "^1.1.2",
|
"eslint-import-resolver-alias": "^1.1.2",
|
||||||
"eslint-plugin-import": "^2.26.0",
|
"eslint-plugin-import": "^2.26.0",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^4.2.1",
|
||||||
"eslint-plugin-vue": "^9.3.0",
|
"eslint-plugin-vue": "^9.3.0",
|
||||||
|
"prettier": "^2.7.1",
|
||||||
"typescript": "^4.6.4",
|
"typescript": "^4.6.4",
|
||||||
"vite": "^3.0.0",
|
"vite": "^3.0.0",
|
||||||
"vue-tsc": "^0.38.4"
|
"vue-tsc": "^0.38.4"
|
||||||
|
@ -14,5 +14,4 @@
|
|||||||
"skipLibCheck": true
|
"skipLibCheck": true
|
||||||
},
|
},
|
||||||
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
|
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
|
||||||
"references": [{ "path": "./tsconfig.node.json" }]
|
|
||||||
}
|
}
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"composite": true,
|
|
||||||
"module": "ESNext",
|
|
||||||
"moduleResolution": "Node",
|
|
||||||
"allowSyntheticDefaultImports": true
|
|
||||||
},
|
|
||||||
"include": ["vite.config.ts"]
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user