feat: add prettier to format

This commit is contained in:
yuqing521 2021-06-26 10:31:58 +08:00
parent a7266b7817
commit efd3d74196
5 changed files with 25 additions and 1 deletions

View File

@ -7,8 +7,10 @@
"jsx": true
}
},
"plugins": ["prettier"],
"rules": {
"semi": [1, "never"],
"indent": ["error", 2]
"indent": ["error", 2],
"prettier/prettier": "error"
}
}

1
.gitignore vendored
View File

@ -6,6 +6,7 @@ node_modules
/coverage
package-lock.json
/test/ts/**/*.js
yarn.lock
# Editor and IDE configuration
.vscode/

2
.prettierignore Normal file
View File

@ -0,0 +1,2 @@
dist
node_modules

9
.prettierrc.js Normal file
View File

@ -0,0 +1,9 @@
module.exports = {
printWidth: 80,
tabWidth: 2,
useTabs: false,
singleQuote: false,
semi: true,
trailingComma: "none",
bracketSpacing: true
};

10
package.json Normal file
View File

@ -0,0 +1,10 @@
{
"devDependencies": {
"eslint-config-prettier": "^8.3.0",
"prettier": "2.3.1"
},
"scripts": {
"prettier:check": "prettier --check **/*.{js,jsx,ts,tsx} ",
"prettier:write": "prettier --write **/*.{js,jsx,ts,tsx}"
}
}