[js] Set up pre-commit hook for prettier

This commit is contained in:
Chris Bianca 2018-01-25 18:36:13 +00:00
parent fba6380729
commit 24d16e4853
2 changed files with 19 additions and 0 deletions

View File

@ -13,6 +13,7 @@
"flow": "flow", "flow": "flow",
"format": "eslint --fix ./lib ./tests/src ./tests/lib", "format": "eslint --fix ./lib ./tests/src ./tests/lib",
"lint": "eslint ./lib ./tests/src ./tests/lib", "lint": "eslint ./lib ./tests/src ./tests/lib",
"precommit": "lint-staged",
"prepublish": "npm run clean && npm run build", "prepublish": "npm run clean && npm run build",
"postinstall": "postinstall-build dist && opencollective postinstall || exit 0", "postinstall": "postinstall-build dist && opencollective postinstall || exit 0",
"test-cli": "node ./bin/test.js", "test-cli": "node ./bin/test.js",
@ -122,5 +123,19 @@
"type": "opencollective", "type": "opencollective",
"url": "https://opencollective.com/react-native-firebase", "url": "https://opencollective.com/react-native-firebase",
"logo": "https://opencollective.com/opencollective/logo.txt" "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"
]
} }
} }

4
prettier.config.js Normal file
View File

@ -0,0 +1,4 @@
module.exports = {
trailingComma: 'es5',
singleQuote: true,
};