Skip to content

Commit 24ba71f

Browse files
committed
ci(lint): lint tests before commits
1 parent b1b01ae commit 24ba71f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

__mocks__/react-native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// this is here to avoid duplicate react entries in the examples
22
// (one from the example's node_modules and one from the root's node_modules)
3-
module.exports = require('react-native')
3+
module.exports = require('react-native');

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
"test-builds": "node ./scripts/testBuilds.js",
1818
"lint": "eslint --max-warnings 0 --ext js,jsx src scripts",
1919
"lint-fix": "eslint --max-warnings 0 --ext js,jsx src scripts --fix",
20+
"lint-tests": "eslint --max-warnings 0 --ext js,jsx __tests__ __mocks__",
21+
"lint-tests-fix": "eslint --max-warnings 0 --ext js,jsx __tests__ __mocks__ --fix",
2022
"install-examples": "node ./scripts/installExamples.js",
2123
"build-examples": "node ./scripts/buildExamples.js",
2224
"link-examples": "node ./scripts/linkExamples.js",
@@ -105,7 +107,7 @@
105107
},
106108
"husky": {
107109
"hooks": {
108-
"pre-commit": "npm run lint",
110+
"pre-commit": "npm run lint && npm run lint-tests",
109111
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
110112
}
111113
},

0 commit comments

Comments
 (0)