Skip to content

Commit cbe5f00

Browse files
authored
Merge pull request #21 from MichiganDaily/eslint
Add eslint pre-commit hook
2 parents 7a36819 + d6d6648 commit cbe5f00

File tree

4 files changed

+1024
-3
lines changed

4 files changed

+1024
-3
lines changed

.eslintrc.cjs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es2021: true,
5+
},
6+
extends: [
7+
"airbnb-base",
8+
"prettier",
9+
],
10+
parserOptions: {
11+
ecmaVersion: "latest",
12+
sourceType: "module",
13+
},
14+
rules: {
15+
"quotes": [
16+
"error",
17+
"double",
18+
{ "avoidEscape": true, "allowTemplateLiterals": false }
19+
]
20+
},
21+
};

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
yarn run eslint src

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"main": "src/bore.js",
77
"module": "src/bore.js",
88
"scripts": {
9+
"prepare": "husky install",
910
"build": "rollup -c"
1011
},
1112
"repository": {
@@ -26,6 +27,11 @@
2627
},
2728
"devDependencies": {
2829
"@rollup/plugin-node-resolve": "^13.2.1",
30+
"eslint": "^8.13.0",
31+
"eslint-config-airbnb-base": "^15.0.0",
32+
"eslint-config-prettier": "^8.5.0",
33+
"eslint-plugin-import": "^2.26.0",
34+
"husky": "^7.0.4",
2935
"rollup": "^2.70.2",
3036
"rollup-plugin-terser": "^7.0.2"
3137
}

0 commit comments

Comments
 (0)