Skip to content

Commit 3f0df34

Browse files
committed
Chore: enforce style rules with 'npm run fmt'
1 parent dfbe76e commit 3f0df34

File tree

5 files changed

+25
-15
lines changed

5 files changed

+25
-15
lines changed

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
end_of_line = lf

.github/workflows/test_and_release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ jobs:
3939
- name: Run jshint
4040
run: npm run jshint
4141

42+
- name: Run fmt
43+
run: npm run fmt
44+
4245
- name: Run tests
4346
run: npm run test
4447

.jshintrc

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,29 @@
88
"esnext": true,
99
"freeze": true,
1010
"immed": true,
11-
"indent": 2,
1211
"latedef": true,
1312
"newcap": false,
1413
"noarg": true,
1514
"node": true,
1615
"noempty": true,
1716
"nonew": true,
18-
"quotmark": "single",
1917
"regexp": true,
20-
"smarttabs": false,
2118
"strict": true,
22-
"trailing": true,
2319
"undef": true,
2420
"unused": true,
2521
"maxparams": 5,
2622
"maxstatements": 17,
2723
"maxcomplexity": 10,
2824
"maxdepth": 3,
29-
"maxlen": 120,
30-
"multistr": true,
3125
"predef": [
32-
"after",
33-
"afterEach",
34-
"before",
35-
"beforeEach",
36-
"describe",
37-
"exports",
38-
"it",
39-
"module",
40-
"require"
26+
"after",
27+
"afterEach",
28+
"before",
29+
"beforeEach",
30+
"describe",
31+
"exports",
32+
"it",
33+
"module",
34+
"require"
4135
]
4236
}

.prettierrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"printWidth": 120
3+
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
},
3232
"scripts": {
3333
"test": "mocha -R spec --recursive",
34+
"fmt": "npx -p prettier@2.x -- prettier -w '**/*.{js,md}'",
3435
"regtest": "./regtest/regtest",
3536
"jshint": "jshint --reporter=node_modules/jshint-stylish ./lib",
3637
"coverage": "istanbul cover _mocha -- --recursive",

0 commit comments

Comments
 (0)