diff --git a/.eslintrc.js b/.eslintrc.js index ae061a952c..6c81a92b9f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -10,6 +10,7 @@ module.exports = { 'prettier', 'prettier/@typescript-eslint', 'plugin:prettier/recommended', + 'eslint-config-prettier' ], globals: { Atomics: 'readonly', @@ -31,6 +32,7 @@ module.exports = { }, plugins: ['react', '@typescript-eslint', 'prettier', 'jest'], rules: { + "prettier/prettier": "error", '@typescript-eslint/member-delimiter-style': 'off', '@typescript-eslint/explicit-function-return-type': 'off', '@typescript-eslint/no-explicit-any': 'off', diff --git a/.prettierrc b/.prettierrc index 3ecb496f43..8231751c8b 100644 --- a/.prettierrc +++ b/.prettierrc @@ -6,5 +6,6 @@ "trailingComma": "all", "bracketSpacing": true, "jsxBracketSameLine": false, - "arrowParens": "always" -} \ No newline at end of file + "arrowParens": "always", + "endOfLine": "lf" +} diff --git a/package.json b/package.json index 925dda3d02..d81448f055 100644 --- a/package.json +++ b/package.json @@ -103,7 +103,8 @@ "prepublishOnly": "npm run build", "test": "react-scripts test --detectOpenHandles", "test:ci": "cross-env CI=true react-scripts test", - "lint": "eslint \"src/**/*.{js,jsx,ts,tsx}\" --fix", + "lint": "eslint \"src/**/*.{js,jsx,ts,tsx}\"", + "lint:fix": "eslint \"src/**/*.{js,jsx,ts,tsx}\" --fix", "coveralls": "npm run test:ci -- --coverage --watchAll=false && cat ./coverage/lcov.info | coveralls", "semantic-release": "semantic-release" }, @@ -121,6 +122,7 @@ }, "husky": { "hooks": { + "pre-commit": "lint-staged", "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" } }, @@ -131,7 +133,7 @@ }, "lint-staged": { "**/*.{js,jsx,ts,tsx}": [ - "npm run lint", + "npm run lint:fix", "npm run test:ci", "git add ." ] diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index 6c2cdc7363..ebb8c1b682 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -6,7 +6,6 @@ import { useTranslation } from 'react-i18next' const Navbar = () => { const { t } = useTranslation() const history = useHistory() - return ( { /> ) } - export default Navbar