chore: replace precommit hook with eslint --fix
by way of `lint-staged`
MODIFY
package.json
package.json
"install-fake-driver": "lerna run --scope=appium install-fake-driver",
"lint": "lerna exec --parallel gulp lint && lerna run --scope=@appium/eslint-config-appium lint",
"lint:fix": "lerna exec --parallel gulp lint -- --fix",
+ "precommit-lint": "lint-staged",
"precommit-msg": "echo 'Pre-commit checks...' && exit 0",
- "precommit-test": "REPORTER=dot gulp -f packages/appium/gulpfile.js once",
"reinstall": "npm run clean && npm install",
"start": "node ./packages/appium",
"test": "lerna exec gulp once",
},
"pre-commit": [
"precommit-msg",
- "precommit-test"
+ "precommit-lint"
],
+ "lint-staged": {
+ "*.js": "eslint --fix"
+ },
"devDependencies": {
"@appium/eslint-config-appium": "file:./packages/eslint-config-appium",
"@appium/fake-plugin": "^1.0.0",
"gulp": "^4.0.0",
"handlebars": "^4.2.0",
"lerna": "^4.0.0",
+ "lint-staged": "^11.0.0",
"mjpeg-server": "^0.3.0",
"mocha": "^8.0.1",
"pre-commit": "1.x",

MODIFY
packages/appium/gulpfile.js
packages/appium/gulpfile.js
@@ -46,8 +46,7 @@ boilerplate({
test: {
files: ['${testDir}/**/*-specs.js']
},
- testTimeout: 160000,
- preCommitTasks: ['eslint', 'once'],
+ testTimeout: 160000
});
// generates server arguments readme

MODIFY
packages/appium/package.json
packages/appium/package.json
"zip": "zip -qr appium.zip .",
"zip-and-upload": "npm run zip && npm run upload"
},
- "pre-commit": [
- "precommit-msg",
- "precommit-test"
- ],
"dependencies": {
"@appium/base-plugin": "^1.0.0",
"@babel/runtime": "^7.6.0",

MODIFY
packages/doctor/package.json
packages/doctor/package.json
"build/index.js",
"build/lib"
],
- "pre-commit": [
- "precommit-msg",
- "precommit-test"
- ],
"dependencies": {
"@appium/support": "^2.5.0",
"@babel/runtime": "^7.0.0",

MODIFY
packages/gulp-plugins/package.json
packages/gulp-plugins/package.json
},
"peerDependencies": {
"gulp": "^4.0.0"
- },
- "pre-commit": [
- "precommit-msg",
- "precommit-test"
- ]
+ }
}

MODIFY
packages/support/package.json
packages/support/package.json
"build/index.js",
"build/lib"
],
- "pre-commit": [
- "precommit-msg",
- "precommit-test"
- ],
"dependencies": {
"@babel/runtime": "^7.0.0",
"archiver": "^5.0.0",

chore: replace precommit hook with eslint --fix

- by way of `lint-staged`