add pre commit hook for auto js linting
This commit is contained in:
parent
3aa081131f
commit
02b0bf3aef
3
.babelrc
3
.babelrc
@ -1,3 +1,4 @@
|
||||
{
|
||||
"presets": ["@babel/preset-env"]
|
||||
"presets": ["@babel/preset-env"],
|
||||
"plugins": ["@babel/plugin-proposal-class-properties"]
|
||||
}
|
||||
|
||||
27
.eslintrc.json
Normal file
27
.eslintrc.json
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es6": true
|
||||
},
|
||||
"extends": "eslint:recommended",
|
||||
"globals": {
|
||||
"Atomics": "readonly",
|
||||
"SharedArrayBuffer": "readonly",
|
||||
"HttpClient": "readonly",
|
||||
"UtilRegistry": "readonly",
|
||||
"HtmlHelpers": "readonly",
|
||||
"I18n": "readonly",
|
||||
"flatpickr": "readonly",
|
||||
"$": "readonly"
|
||||
},
|
||||
"parser": "babel-eslint",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2018
|
||||
},
|
||||
"rules": {
|
||||
"no-console": "off",
|
||||
"no-extra-semi": "off",
|
||||
"semi": ["error", "always"],
|
||||
"comma-dangle": ["error", "always-multiline"]
|
||||
}
|
||||
}
|
||||
1836
package-lock.json
generated
1836
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
29
package.json
29
package.json
@ -2,17 +2,34 @@
|
||||
"name": "uni2work",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"scripts": {
|
||||
"watch": "watch babel static/es",
|
||||
"babel": "babel static/es -d static/js"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"scripts": {
|
||||
"babel": "babel static/es -d static/js",
|
||||
"babel:watch": "watch 'npm run babel' static/es",
|
||||
"lint": "eslint static/es"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"static/es/**/*.js": [
|
||||
"eslint",
|
||||
"git add"
|
||||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.4.4",
|
||||
"@babel/core": "^7.4.5",
|
||||
"watch": "^1.0.2",
|
||||
"@babel/preset-env": "^7.4.5"
|
||||
"@babel/plugin-proposal-class-properties": "^7.4.4",
|
||||
"@babel/preset-env": "^7.4.5",
|
||||
"babel-eslint": "^10.0.1",
|
||||
"eslint": "^5.16.0",
|
||||
"husky": "^2.3.0",
|
||||
"lint-staged": "^8.1.7",
|
||||
"watch": "^1.0.2"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user