Skip to content

Commit

Permalink
feat(dev-tools): add precommit hooks for linting
Browse files Browse the repository at this point in the history
add prettier for formatting control
add eslint for linting js
add husky to run hooks at precommit stage

closes: #36
  • Loading branch information
AaronCGoidel committed Oct 1, 2020
1 parent f8bb0fa commit fd7a855
Show file tree
Hide file tree
Showing 4 changed files with 840 additions and 13 deletions.
24 changes: 24 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"extends": ["eslint:recommended", "prettier"],
"env": {
"browser": true,
"node": true,
"es6": true,
"commonjs": true,
"es2021": true
},
"parserOptions": {
"ecmaVersion": 12
},
"rules": {
"no-unused-vars": [
"error",
{
"vars": "local",
"args": "none"
}
],
"no-plusplus": "off",
"no-underscore-dangle": "off"
}
}
11 changes: 11 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": false,
"jsxBracketSameLine": false,
"proseWrap": "always"
}
23 changes: 22 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,31 @@
"author": "Grey Software",
"license": "MIT",
"devDependencies": {
"vuepress": "^1.5.2"
"vuepress": "^1.5.2",
"eslint": "^7.9.0",
"eslint-config-prettier": "^6.11.0",
"husky": "^4.3.0",
"lint-staged": "^10.3.0",
"prettier": "^2.1.1"
},
"dependencies": {
"vue-svg-loader": "^0.16.0",
"vue-typed-js": "^0.1.2"
},
"husky": {
"hooks": {
"pre-commit": "npx lint-staged"
}
},
"lint-staged": {
"*.{json,yml}": [
"prettier --write",
"git add"
],
"**/*.+(js|md|ts|css|sass|less|graphql|vue)": [
"prettier --write",
"eslint --fix",
"git add"
]
}
}
Loading

0 comments on commit fd7a855

Please sign in to comment.