Configure pre-commit hook with husky and lint-staged

This commit is contained in:
Baldi
2019-07-29 22:53:00 -03:00
parent b04e7fc0d9
commit b7ef97308b
3 changed files with 1080 additions and 259 deletions

View File

@@ -1,7 +1,23 @@
module.exports = {
"env": {
"browser": true,
"es6": true
},
"extends": "airbnb"
};
extends: "airbnb",
parser: "babel-eslint",
env: {
browser: true,
es6: true,
jest: true
},
rules: {
"import/no-extraneous-dependencies": ["error", { devDependencies: true }],
"react/jsx-filename-extension": [1, { extensions: [".js", ".jsx"] }],
"jsx-a11y/label-has-associated-control": [ "error", {
"required": {
"some": [ "nesting", "id" ]
}
}],
"jsx-a11y/label-has-for": [ "error", {
"required": {
"some": [ "nesting", "id" ]
}
}]
}
}

1289
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -32,7 +32,8 @@
"test": "jest",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage",
"lint": "eslint src"
"lint": "eslint src",
"lint:fix": "npm run lint -- --fix"
},
"peerDependencies": {
"react": "^16.8.2",
@@ -55,16 +56,20 @@
"@testing-library/jest-dom": "^4.0.0",
"@testing-library/react": "^8.0.4",
"@types/jest": "^24.0.15",
"babel-eslint": "^10.0.2",
"babel-loader": "^8.0.5",
"babel-plugin-styled-components": "^1.10.0",
"classnames": "^2.2.6",
"cross-env": "^5.2.0",
"eslint": "^5.3.0",
"eslint": "^5.16.0",
"eslint-config-airbnb": "^17.1.1",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.14.3",
"husky": "^3.0.1",
"jest": "^24.8.0",
"jest-styled-components": "^6.3.3",
"lint-staged": "^9.2.1",
"prop-types": "^15.7.2",
"react": "^16.8.2",
"react-dom": "^16.8.2",
@@ -77,5 +82,16 @@
"storybook-addon-styled-component-theme": "^1.2.0",
"styled-components": "^4.1.3"
},
"dependencies": {}
"dependencies": {},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.js": [
"eslint --fix",
"git add"
]
}
}