Skip to content

Commit 5cca093

Browse files
editor/code: Break down CI steps to know what is failing easily
To do this change, we reorganize npm-script. | previous | after | |--------------------|----------------------------------------| | `npm run lint` | `npm run lint && npm run format:check` | | `npm run fix` | `npm run lint:fix && npm run format` | The previous `npm run fix` sometimes does not complete fix automatically because ESLint's autofix doees not follow prettier's formatting. So we need to run `npm run lint:fix && npm run format` by this order.
1 parent c7ce8ad commit 5cca093

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

.github/workflows/ci.yaml

+11-4
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,21 @@ jobs:
161161
# if: runner.os == 'Linux'
162162
# working-directory: ./editors/code
163163

164+
# If this steps fails, your code's type integrity might be wrong at some places at TypeScript level.
165+
- run: npm run typecheck
166+
working-directory: ./editors/code
167+
if: needs.changes.outputs.typescript == 'true'
168+
169+
# You may fix the code automatically by running `npm run lint:fix` if this steps fails.
164170
- run: npm run lint
165171
working-directory: ./editors/code
166172
if: needs.changes.outputs.typescript == 'true'
167173

174+
# To fix this steps, please run `npm run format`.
175+
- run: npm run format:check
176+
working-directory: ./editors/code
177+
if: needs.changes.outputs.typescript == 'true'
178+
168179
- name: Run VS Code tests (Linux)
169180
if: matrix.os == 'ubuntu-latest' && needs.changes.outputs.typescript == 'true'
170181
env:
@@ -179,10 +190,6 @@ jobs:
179190
run: npm test
180191
working-directory: ./editors/code
181192

182-
- run: npm run pretest
183-
working-directory: ./editors/code
184-
if: needs.changes.outputs.typescript == 'true'
185-
186193
- run: npm run package --scripts-prepend-node-path
187194
working-directory: ./editors/code
188195
if: needs.changes.outputs.typescript == 'true'

editors/code/package.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,12 @@
3535
"build-base": "esbuild ./src/main.ts --bundle --outfile=out/main.js --external:vscode --format=cjs --platform=node --target=node16",
3636
"build": "npm run build-base -- --sourcemap",
3737
"watch": "npm run build-base -- --sourcemap --watch",
38-
"lint": "prettier --check . && eslint -c .eslintrc.js --ext ts ./src ./tests",
39-
"fix": "prettier --write . && eslint -c .eslintrc.js --ext ts ./src ./tests --fix",
40-
"pretest": "tsc && npm run build",
38+
"format": "prettier --write .",
39+
"format:check": "prettier --check .",
40+
"lint": "eslint -c .eslintrc.js --ext ts ./src ./tests",
41+
"lint:fix": "npm run lint -- --fix",
42+
"typecheck": "tsc",
43+
"pretest": "npm run typecheck && npm run build",
4144
"test": "node ./out/tests/runTests.js"
4245
},
4346
"dependencies": {

0 commit comments

Comments
 (0)