Skip to content

Commit 866329d

Browse files
committed
Run style check with prettier on CI
1 parent 2b5a84e commit 866329d

4 files changed

Lines changed: 10 additions & 5 deletions

File tree

.github/workflows/browser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v2
1616
- run: npm ci
17-
- run: npm run test-browser
17+
- run: npm run test:browser
1818
env:
1919
CI: true

.github/workflows/nodejs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
with:
2323
node-version: ${{ matrix.node-version }}
2424
- run: npm ci
25+
- run: npm run format
2526
- run: npm run build --if-present
2627
- run: npm test
2728
env:

lib/binary_parser.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,11 @@ export class Parser {
897897
return this.compiled!(buffer, this.constructorFn);
898898
}
899899

900-
private setNextParser(type: Types, varName: string, options: ParserOptions): this {
900+
private setNextParser(
901+
type: Types,
902+
varName: string,
903+
options: ParserOptions
904+
): this {
901905
const parser = new Parser();
902906

903907
parser.type = type;

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
"build": "npm run build:cjs && npm run build:esm",
2828
"build:cjs": "tsc --module commonjs --outDir dist",
2929
"build:esm": "tsc --module esnext --outDir dist/esm && mv dist/esm/binary_parser.js dist/esm/binary_parser.mjs",
30-
"fmt": "prettier --write \"{lib,example,test,benchmark}/**/*.{ts,js}\"",
31-
"check-fmt": "prettier --list-different \"{lib,example,test,benchmark}/**/*.{ts,js}\"",
30+
"format": "prettier --list-different \"{lib,example,test,benchmark}/**/*.{ts,js}\"",
31+
"format:fix": "prettier --write \"{lib,example,test,benchmark}/**/*.{ts,js}\"",
3232
"test": "mocha --require ts-node/register test/*.ts",
33-
"test-browser": "karma start --single-run --browsers ChromeHeadless karma.conf.js",
33+
"test:browser": "karma start --single-run --browsers ChromeHeadless karma.conf.js",
3434
"prepare": "npm run build"
3535
},
3636
"files": [

0 commit comments

Comments
 (0)