diff --git a/package.json b/package.json index 9284e312..ef880bd8 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "flow": "flow", "format": "eslint --fix ./lib ./tests/src ./tests/lib", "lint": "eslint ./lib ./tests/src ./tests/lib", + "precommit": "lint-staged", "prepublish": "npm run clean && npm run build", "postinstall": "postinstall-build dist && opencollective postinstall || exit 0", "test-cli": "node ./bin/test.js", @@ -122,5 +123,19 @@ "type": "opencollective", "url": "https://opencollective.com/react-native-firebase", "logo": "https://opencollective.com/opencollective/logo.txt" + }, + "lint-staged": { + "lib/**/*.js": [ + "eslint --fix", + "git add" + ], + "tests/src/**/*.js": [ + "eslint --fix", + "git add" + ], + "tests/lib/**/*.js": [ + "eslint --fix", + "git add" + ] } } diff --git a/prettier.config.js b/prettier.config.js new file mode 100644 index 00000000..87d39087 --- /dev/null +++ b/prettier.config.js @@ -0,0 +1,4 @@ +module.exports = { + trailingComma: 'es5', + singleQuote: true, +};