Skip to content

Commit 3f5931e

Browse files
committed
Chore: enforce style rules with 'npm run fmt'
1 parent 1737d79 commit 3f5931e

File tree

5 files changed

+26
-15
lines changed

5 files changed

+26
-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: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,30 @@
88
"esnext": true,
99
"freeze": true,
1010
"immed": true,
11-
"indent": 2,
1211
"latedef": true,
12+
"laxbreak": true,
1313
"newcap": false,
1414
"noarg": true,
1515
"node": true,
1616
"noempty": true,
1717
"nonew": true,
18-
"quotmark": "single",
1918
"regexp": true,
20-
"smarttabs": false,
2119
"strict": true,
22-
"trailing": true,
2320
"undef": true,
2421
"unused": true,
2522
"maxparams": 5,
2623
"maxstatements": 17,
2724
"maxcomplexity": 10,
2825
"maxdepth": 3,
29-
"maxlen": 120,
30-
"multistr": true,
3126
"predef": [
32-
"after",
33-
"afterEach",
34-
"before",
35-
"beforeEach",
36-
"describe",
37-
"exports",
38-
"it",
39-
"module",
40-
"require"
27+
"after",
28+
"afterEach",
29+
"before",
30+
"beforeEach",
31+
"describe",
32+
"exports",
33+
"it",
34+
"module",
35+
"require"
4136
]
4237
}

.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)