Skip to content

Commit 28587b9

Browse files
authored
chore: use the same linter settings as the monorepo (coder#214)
Use the same script names (e.g. yarn format:write) and extension settings as we do in the monorepo, so that it's easier to switch between projects
1 parent 598f128 commit 28587b9

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

.github/workflows/ci.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ jobs:
3131
node-version: 12.x
3232

3333
- name: Install Node Modules
34-
run: yarn
34+
run: yarn install
3535

3636
- name: Lint
37-
run: |
38-
yarn lint
39-
yarn fmt
37+
run: yarn lint
38+
39+
- name: Formatting
40+
if: always()
41+
run: yarn format:check

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"scripts": {
3-
"fmt": "prettier --check '**/*.{json,md,ts,yaml,yml}'",
4-
"fmt:fix": "prettier --write '**/*.{json,md,ts,yaml,yml}'",
3+
"prepare": "husky install",
4+
"format:check": "prettier --check '**/*.{css,html,js,json,jsx,ts,tsx,yaml,yml}'",
5+
"format:write": "prettier --write '**/*.{css,html,js,json,jsx,ts,tsx,yaml,yml}'",
56
"lint": "markdownlint '**/*.md'",
6-
"lint:fix": "markdownlint --fix '**/*.md'",
7-
"prepare": "husky install"
7+
"lint:fix": "markdownlint --fix '**/*.md'"
88
},
99
"devDependencies": {
1010
"@types/minimist": "^1.2.1",
@@ -21,7 +21,9 @@
2121
"typescript": "^4.2.3"
2222
},
2323
"lint-staged": {
24-
"*.{json,ts,yaml,yml}": "prettier --write",
24+
"*.{css,html,js,json,jsx,ts,tsx,yaml,yml}": [
25+
"prettier --write"
26+
],
2527
"*.md": [
2628
"markdownlint --fix",
2729
"prettier --write"

0 commit comments

Comments
 (0)