Skip to content

Commit

Permalink
feat: 添加prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
申远 committed Sep 1, 2021
1 parent daf5afe commit 15e6c93
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 7 deletions.
10 changes: 5 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
module.exports = {
extends: ["alloy", "alloy/typescript", "plugin:jest/recommended"],
extends: ['alloy', 'alloy/typescript', 'plugin:jest/recommended'],
env: {
// 你的环境变量(包含多个预定义的全局变量)
//
// browser: true,
// node: true,
browser: true,
node: true,
// mocha: true,
// jest: true,
jest: true,
// jquery: true
},
plugins: ["jest"],
plugins: ['jest'],
globals: {
// 你的全局变量(设置为 false 表示它不允许被重新赋值)
//
Expand Down
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"arrowParens": "always"
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"eslint-plugin-jest": "^24.4.0",
"husky": "^7.0.2",
"jest": "^27.1.0",
"prettier": "^2.3.2",
"rollup": "^2.56.2",
"rollup-plugin-terser": "^7.0.2",
"standard-version": "^9.3.1",
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export function FirstFunc(test: string): string {
return "test:" + test;
return 'test:' + test;
}
2 changes: 1 addition & 1 deletion src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export class Test {
this.a = a;
}
public test() {
console.log("b" + this.a);
console.log('b' + this.a);
}
}
interface Foo {
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4280,6 +4280,11 @@ prelude-ls@~1.1.2:
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=

prettier@^2.3.2:
version "2.3.2"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.2.tgz#ef280a05ec253712e486233db5c6f23441e7342d"
integrity sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==

pretty-format@^27.0.0, pretty-format@^27.1.0:
version "27.1.0"
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.1.0.tgz#022f3fdb19121e0a2612f3cff8d724431461b9ca"
Expand Down

0 comments on commit 15e6c93

Please sign in to comment.