Skip to content

Commit 7bdc9fb

Browse files
committed
Install lint-staged
1 parent 71e364f commit 7bdc9fb

File tree

5 files changed

+115
-16
lines changed

5 files changed

+115
-16
lines changed

.lintstagedrc

Lines changed: 0 additions & 11 deletions
This file was deleted.

package-lock.json

Lines changed: 100 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
"lint:fix": "npm run lint -- --fix",
99
"test": "jest --coverage",
1010
"coveralls": "cat ./coverage/lcov.info | ./node_modules/.bin/coveralls",
11-
"prepublishOnly": "babel src --out-dir dist",
12-
"precommit": "lint-staged"
11+
"prepublishOnly": "babel src --out-dir dist"
1312
},
1413
"files": [
1514
"dist",
@@ -57,6 +56,7 @@
5756
"eslint-plugin-promise": "^4.1.1",
5857
"eslint-plugin-standard": "^4.0.0",
5958
"eslint-plugin-vue": "^5.2.2",
59+
"husky": "^2.4.0",
6060
"jest": "^24.8.0",
6161
"jest-dom": "^3.4.0",
6262
"jest-in-case": "^1.0.2",
@@ -67,5 +67,16 @@
6767
"vue-jest": "^3.0.4",
6868
"vue-router": "^3.0.6",
6969
"vuex": "^3.1.1"
70+
},
71+
"husky": {
72+
"hooks": {
73+
"pre-commit": "lint-staged"
74+
}
75+
},
76+
"lint-staged": {
77+
"*.{js,vue}": [
78+
"eslint --fix",
79+
"git add"
80+
]
7081
}
7182
}

tests/__tests__/components/Store/VuexTest.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export default {
1616
computed: {
1717
...mapState(['count']),
1818
},
19+
1920
methods: {
2021
...mapActions(['decrement', 'increment']),
2122
},

tests/__tests__/vuex.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ function renderVuexTestComponent(customStore) {
1616
// Render the component and merge the original store and the custom one
1717
// provided as a parameter. This way, we can alter some behaviors of the
1818
// initial implementation.
19-
return render(VuexTest, {
20-
store: { ...store, ...customStore },
21-
})
19+
return render(VuexTest, { store: { ...store, ...customStore } })
2220
}
2321

2422
test('can render with vuex with defaults', async () => {

0 commit comments

Comments
 (0)