Install husky and prettier to format staged files
This commit is contained in:
+3
-20
@@ -1,9 +1,6 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
root: true,
|
root: true,
|
||||||
extends: [
|
extends: ['eslint:recommended', 'plugin:react/recommended'],
|
||||||
'eslint:recommended',
|
|
||||||
'plugin:react/recommended',
|
|
||||||
],
|
|
||||||
env: {
|
env: {
|
||||||
node: true,
|
node: true,
|
||||||
mocha: true,
|
mocha: true,
|
||||||
@@ -24,23 +21,9 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
indent: ['error', 2],
|
'no-console': ['error', { allow: ['warn', 'error'] }],
|
||||||
'no-console': ['error', { 'allow': ['warn', 'error'] }],
|
|
||||||
'space-before-function-paren': 0,
|
|
||||||
semi: ['warn', 'never'],
|
|
||||||
'space-infix-ops': ['warn'],
|
|
||||||
'no-var': 'error',
|
'no-var': 'error',
|
||||||
'prefer-const': 'error',
|
'prefer-const': 'error',
|
||||||
'no-trailing-spaces': 'error',
|
|
||||||
'react/prop-types': 2,
|
'react/prop-types': 2,
|
||||||
'max-len': [
|
|
||||||
1,
|
|
||||||
{
|
|
||||||
'ignoreStrings': true,
|
|
||||||
'ignoreComments': true,
|
|
||||||
'ignoreTemplateLiterals': true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
'no-multi-spaces': 2,
|
|
||||||
},
|
},
|
||||||
};
|
}
|
||||||
|
|||||||
Executable
+4
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
. "$(dirname "$0")/_/husky.sh"
|
||||||
|
|
||||||
|
npx pretty-quick --staged
|
||||||
+2
-4
@@ -1,6 +1,4 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
bracketSpacing: false,
|
|
||||||
jsxBracketSameLine: true,
|
|
||||||
singleQuote: true,
|
singleQuote: true,
|
||||||
trailingComma: 'all',
|
semi: false,
|
||||||
};
|
}
|
||||||
|
|||||||
+5
-1
@@ -25,7 +25,8 @@
|
|||||||
"update-changelog": "node ./tools/bin/update-changelog.js",
|
"update-changelog": "node ./tools/bin/update-changelog.js",
|
||||||
"release": "node ./tools/release-wizard.js",
|
"release": "node ./tools/release-wizard.js",
|
||||||
"clear": ". scripts/clear.sh",
|
"clear": ". scripts/clear.sh",
|
||||||
"postinstall": "npx jetify"
|
"postinstall": "npx jetify",
|
||||||
|
"prepare": "husky install"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ptomasroos/react-native-multi-slider": "^2.2.0",
|
"@ptomasroos/react-native-multi-slider": "^2.2.0",
|
||||||
@@ -72,12 +73,15 @@
|
|||||||
"dirty-chai": "^2.0.1",
|
"dirty-chai": "^2.0.1",
|
||||||
"eslint": "^6.4.0",
|
"eslint": "^6.4.0",
|
||||||
"eslint-plugin-react": "^7.8.2",
|
"eslint-plugin-react": "^7.8.2",
|
||||||
|
"husky": "^6.0.0",
|
||||||
"jase": "^1.2.0",
|
"jase": "^1.2.0",
|
||||||
"jest": "^24.9.0",
|
"jest": "^24.9.0",
|
||||||
"jetifier": "^1.6.6",
|
"jetifier": "^1.6.6",
|
||||||
"left-pad": "^1.3.0",
|
"left-pad": "^1.3.0",
|
||||||
"metro-react-native-babel-preset": "^0.56.0",
|
"metro-react-native-babel-preset": "^0.56.0",
|
||||||
"mocha": "^5.2.0",
|
"mocha": "^5.2.0",
|
||||||
|
"prettier": "2.4.0",
|
||||||
|
"pretty-quick": "^3.1.1",
|
||||||
"react-native-version": "^3.1.0",
|
"react-native-version": "^3.1.0",
|
||||||
"react-test-renderer": "16.9.0",
|
"react-test-renderer": "16.9.0",
|
||||||
"readline": "^1.3.0"
|
"readline": "^1.3.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user