Last active
May 15, 2019 04:54
-
-
Save vdelacou/6576c04a3478dcb5be7de4871fa6e47f to your computer and use it in GitHub Desktop.
TSLint config file for React or React-native project
This file contains 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
{ | |
"extends": [ | |
"tslint:recommended", | |
"tslint-config-standard", | |
"tslint-etc", | |
"tslint-react", | |
"tslint-react-hooks", | |
"tslint-config-prettier" | |
], | |
"rules": { | |
// types related rules | |
"no-inferrable-types": true, | |
"no-namespace": { | |
"options": ["allow-declarations"] | |
}, | |
"interface-name": { | |
"options": "never-prefix" | |
}, | |
"no-unsafe-any": true, | |
// core lint rules | |
"ban": { | |
"options": [ | |
{ | |
"name": "parseInt", | |
"message": "use #type-coercion -> Number(val)" | |
}, | |
{ | |
"name": "parseFloat", | |
"message": "use #type-coercion -> Number(val)" | |
}, | |
{ | |
"name": "Array", | |
"message": "use #array-constructor" | |
}, | |
{ | |
"name": ["describe", "only"], | |
"message": "don't focus spec blocks" | |
}, | |
{ | |
"name": ["it", "only"], | |
"message": "don't focus tests" | |
} | |
] | |
}, | |
"no-require-imports": true, | |
"no-boolean-literal-compare": true, | |
"no-invalid-this": { | |
"options": "check-function-in-method" | |
}, | |
"no-invalid-template-strings": true, | |
"ordered-imports": true, | |
"prefer-template": true, | |
"newline-before-return": true, | |
"match-default-export-name": true, | |
"no-parameter-reassignment": true, | |
"file-name-casing": [true, "kebab-case"], | |
"switch-default": true, | |
// tslint:recommended overrides | |
"no-any": true, | |
"member-access": { | |
"options": ["no-public"] | |
}, | |
"object-literal-sort-keys": false, | |
"interface-over-type-literal": false, | |
// tslint:tslint-config-standard overrides | |
// | |
// tslint-etc rules | |
"no-unused-declaration": true, | |
"no-missing-dollar-expect": true, | |
"no-assign-mutated-array": true, | |
// tslint-react rules | |
"jsx-boolean-value": { | |
"options": "never" | |
} | |
}, | |
// apply the same rules for any JS if allowJS is gonna be used | |
"jsRules": true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment