Skip to content

Instantly share code, notes, and snippets.

@WillSquire
Last active June 3, 2019 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WillSquire/514685caa134f6a8acce99dcafb36420 to your computer and use it in GitHub Desktop.
Save WillSquire/514685caa134f6a8acce99dcafb36420 to your computer and use it in GitHub Desktop.
Setup linting for React Typescript projects. Install dependencies with `docker run -it --rm -v "$PWD":/usr/src/app -w /usr/src/app node:alpine yarn add --dev tslint-config-airbnb tslint-react`
{
"hooks": {
"pre-commit": "yarn lint --fix && yarn test",
"pre-push": "yarn lint --fix && yarn test"
}
}
{
"extends": ["tslint-config-airbnb", "tslint-react"],
"rules": {
"eofline": true,
"indent": [true, "spaces", 2],
"no-trailing-whitespace": true,
"object-literal-sort-keys": false,
"ordered-imports": true,
"semicolon": [true, "never"],
"trailing-comma": [true, {
"multiline": "always",
"singleline": "never"
}],
"variable-name": [true, "ban-keywords", "check-format"]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment