Skip to content

Commit b05400a

Browse files
authored
Merge pull request #2733 from jasongrout/prettier
Update the prettier configuration
2 parents e18f154 + ab04c17 commit b05400a

File tree

4 files changed

+468
-33
lines changed

4 files changed

+468
-33
lines changed

.eslintrc.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
"extends": [
44
"eslint:recommended",
55
"plugin:@typescript-eslint/eslint-recommended",
6-
"plugin:@typescript-eslint/recommended"
6+
"plugin:@typescript-eslint/recommended",
7+
"prettier"
78
],
89
"rules": {
910
"@typescript-eslint/interface-name-prefix": [
10-
"error", { "prefixWithI": "always" }
11-
],
12-
"@typescript-eslint/no-unused-vars": [
13-
"warn", { "args": "none" }
11+
"error",
12+
{ "prefixWithI": "always" }
1413
],
14+
"@typescript-eslint/no-unused-vars": ["warn", { "args": "none" }],
1515
"@typescript-eslint/no-use-before-define": "off",
1616
"@typescript-eslint/camelcase": "off",
1717
"@typescript-eslint/no-explicit-any": "off",

.lintstagedrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"**/*{.ts,.tsx,.js,.jsx,.css,.json}": [
3+
"prettier --write",
4+
"git add"
5+
]
6+
}

package.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
"integrity2": "node buildutils/lib/integrity.js",
2222
"lint": "yarn && yarn run prettier && yarn run eslint",
2323
"lint:check": "yarn run prettier:check && yarn run eslint:check",
24-
"prettier": "prettier --ignore-path .gitignore --write '**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}'",
25-
"prettier:check": "prettier --ignore-path .gitignore --check '**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}'",
24+
"prettier": "prettier --ignore-path .gitignore --write '**/*{.ts,.tsx,.js,.jsx,.css,.json}'",
25+
"prettier:check": "prettier --ignore-path .gitignore --check '**/*{.ts,.tsx,.js,.jsx,.css,.json}'",
2626
"sort-package-json": "lerna exec --parallel sort-package-json && sort-package-json",
2727
"publish": "yarn run clean && yarn run build && lerna publish -m \"Publish npm packages\"",
2828
"update-dependency": "update-dependency --lerna",
@@ -33,9 +33,17 @@
3333
"@typescript-eslint/eslint-plugin": "^2.14.0",
3434
"@typescript-eslint/parser": "^2.14.0",
3535
"eslint": "^6.5.0",
36-
"eslint-plugin-prettier": "^3.1.2",
36+
"eslint-config-prettier": "^6.9.0",
37+
"husky": "^2.3.0",
3738
"lerna": "^3.20.2",
39+
"lint-staged": "^9.5.0",
3840
"prettier": "^1.19.1",
3941
"sort-package-json": "~1.35"
42+
},
43+
"husky": {
44+
"hooks": {
45+
"pre-commit": "lint-staged",
46+
"pre-push": "yarn run integrity"
47+
}
4048
}
4149
}

0 commit comments

Comments
 (0)