Skip to content

Commit

Permalink
Merge pull request #43 from nik72619c/add-husky-and-lint-staged
Browse files Browse the repository at this point in the history
added husky, lint-staged, prettier and eslint config
  • Loading branch information
nodece authored Aug 30, 2020
2 parents ab818ef + 2f53a8e commit 6a0b240
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
8 changes: 8 additions & 0 deletions web/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

module.exports = {
extends: ["eslint:recommended",
"plugin:react/recommended"],
rules: {
'react/jsx-filename-extension': 'off',
},
};
6 changes: 6 additions & 0 deletions web/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
bracketSpacing: true,
jsxBracketSameLine: true,
singleQuote: true,
trailingComma: 'all',
};
21 changes: 20 additions & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"start": "set PORT=3030 && react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
"eject": "react-scripts eject",
"lint": "eslint src/**/*.js src/**/*.jsx"
},
"eslintConfig": {
"extends": "react-app"
Expand All @@ -35,5 +36,23 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"eslint": "^6.8.0",
"eslint-plugin-react": "^7.18.3",
"husky": "^4.2.3",
"lint-staged": "^10.0.8",
"prettier": "^1.19.1"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"./src/*.{js,jsx,ts,tsx}": [
"npx prettier --write",
"eslint src/*.js --fix-dry-run"
]
}
}

0 comments on commit 6a0b240

Please sign in to comment.