diff --git a/.husky/pre-commit b/.husky/pre-commit index cbbd6f5..b901636 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,7 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" -yarn lint --fix +echo '🏗️👷 Styling your project before committing👷‍♂️🏗️' +echo 'please be patient, this may take a while...' + +npx lint-staged diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..869fa46 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,12 @@ +const config = { + semi: false, + tabWidth: 2, + printWidth: 120, + singleQuote: true, + jsxSingleQuote: true, + trailingComma: 'none', + arrowParens: 'always', + endOfLine: 'auto' +} + +module.exports = config diff --git a/package.json b/package.json index d24b456..db3b95a 100644 --- a/package.json +++ b/package.json @@ -29,14 +29,13 @@ "typescript": "5.1.3" }, "devDependencies": { - "husky": "^8.0.0" + "husky": "^8.0.0", + "prettier": "^2.8.8" }, "lint-staged": { - "**/*.js?(x)": [ - "next lint --fix" - ], - "**/*.ts?(x)": [ - "next lint --fix" + "**/*.{js,jsx,ts,tsx}": [ + "eslint --fix", + "prettier --config ./.prettierrc.js --write" ] } } diff --git a/yarn.lock b/yarn.lock index d8616e1..51e0c36 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2287,6 +2287,11 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== +prettier@^2.8.8: + version "2.8.8" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" + integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== + prop-types@^15.8.1: version "15.8.1" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5"