Last active
August 22, 2019 14:32
-
-
Save VanTanev/66683d8c71e44bd0b83261fc0c2262bd to your computer and use it in GitHub Desktop.
base husky + prettier + eslintconfig
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"extends": [ | |
"react-app", | |
"plugin:@typescript-eslint/recommended", | |
"plugin:jest/recommended", | |
"prettier", | |
"prettier/react", | |
"prettier/@typescript-eslint" | |
], | |
"plugins": ["jest"] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"printWidth": 80, | |
"trailingComma": "all", | |
"tabWidth": 4, | |
"semi": false, | |
"singleQuote": true | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
'*.{js,jsx,ts,tsx}': [ | |
'eslint --max-warnings=0', | |
'react-scripts test --bail --watchAll=false --findRelatedTests --passWithNoTests', | |
() => 'tsc -p tsconfig.json --noEmit', | |
], | |
'*.{js,jsx,ts,tsx,json,css,js}': ['prettier --write', 'git add'], | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"devDependencies": { | |
"eslint-config-prettier": "^4.3.0", | |
"eslint-config-react-app": "^4.0.1", | |
"eslint-plugin-jest": "^22.5.1", | |
"husky": "^2.4.1", | |
"lint-staged": "^8.1.7", | |
"prettier": "^1.17.1", | |
}, | |
"scripts": { | |
"preinstall": "git submodule update --init --recursive || exit 0", | |
"lint": "eslint --max-warnings=0 src/**/*.{ts,tsx,js,jsx} && prettier --check src/**/*.{js,jsx,ts,tsx,json,css}", | |
"lint:fix": "eslint --fix src/**/*.{ts,tsx,js,jsx}; prettier --write src/**/*.{js,jsx,ts,tsx,json,css}" | |
}, | |
"eslintConfig": { | |
"extends": "react-app" | |
}, | |
"husky": { | |
"hooks": { | |
"post-checkout": "if echo \"$HUSKY_GIT_PARAMS\" | grep -q \"1$\"; then yarn install --frozen-lockfile; fi", | |
"post-merge": "yarn install --frozen-lockfile", | |
"post-rebase": "yarn install", | |
"pre-commit": "lint-staged --config lint-staged.js" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment