Skip to content

Commit

Permalink
Chore: enforce style rules with 'npm run fmt'
Browse files Browse the repository at this point in the history
  • Loading branch information
coolaj86 committed Jun 20, 2023
1 parent 3374cde commit 8b3d4e5
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 15 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf
3 changes: 3 additions & 0 deletions .github/workflows/test_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ jobs:
- name: Run jshint
run: npm run jshint

- name: Run fmt
run: npm run fmt

- name: Run tests
run: npm run test

Expand Down
25 changes: 10 additions & 15 deletions .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,30 @@
"eqeqeq": true,
"freeze": true,
"immed": true,
"indent": 2,
"latedef": "nofunc",
"laxbreak": true,
"newcap": false,
"noarg": true,
"node": true,
"noempty": true,
"nonew": true,
"quotmark": "single",
"regexp": true,
"smarttabs": false,
"strict": true,
"trailing": true,
"undef": true,
"unused": true,
"maxparams": 5,
"maxstatements": 17,
"maxcomplexity": 10,
"maxdepth": 3,
"maxlen": 120,
"multistr": true,
"predef": [
"after",
"afterEach",
"before",
"beforeEach",
"describe",
"exports",
"it",
"module",
"require"
"after",
"afterEach",
"before",
"beforeEach",
"describe",
"exports",
"it",
"module",
"require"
]
}
3 changes: 3 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"printWidth": 120
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
},
"scripts": {
"test": "mocha -R spec --recursive",
"fmt": "npx -p [email protected] -- prettier -w '**/*.{js,md}'",
"regtest": "./regtest/regtest",
"jshint": "jshint --reporter=node_modules/jshint-stylish ./lib",
"coverage": "istanbul cover _mocha -- --recursive",
Expand Down

0 comments on commit 8b3d4e5

Please sign in to comment.