Last active
October 21, 2020 04:19
-
-
Save thetminko/d652f68abcd29bc63944be52109de2b3 to your computer and use it in GitHub Desktop.
ESLint for React Typescript
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
Show hidden characters
{ | |
"parser": "@typescript-eslint/parser", | |
"parserOptions": { | |
"ecmaVersion": 2018, | |
"sourceType": "module" | |
}, | |
"settings": { | |
"react": { | |
"version": "detect" | |
} | |
}, | |
"extends": [ | |
"plugin:@typescript-eslint/recommended", | |
"plugin:react/recommended", | |
"plugin:import/errors", | |
"plugin:import/warnings", | |
"plugin:import/typescript", | |
"plugin:security/recommended" | |
], | |
"rules": { | |
"react/prop-types": "off", | |
"@typescript-eslint/no-var-requires": "off", | |
"@typescript-eslint/no-explicit-any": "off", | |
"@typescript-eslint/explicit-function-return-type": "off", | |
"@typescript-eslint/explicit-module-boundary-types": "off", | |
"@typescript-eslint/no-unused-vars": "error", | |
"@typescript-eslint/prefer-for-of": "error", | |
"@typescript-eslint/indent": [ | |
"error", | |
2 | |
], | |
"@typescript-eslint/member-delimiter-style": [ | |
"error", | |
{ | |
"singleline": { | |
"delimiter": "semi", | |
"requireLast": false | |
} | |
} | |
], | |
"@typescript-eslint/explicit-member-accessibility": [ | |
"error", | |
{ | |
"accessibility": "no-public" | |
} | |
], | |
"@typescript-eslint/naming-convention": [ | |
"error", | |
{ | |
"selector": "variableLike", | |
"format": [ | |
"strictCamelCase", | |
"UPPER_CASE", | |
"StrictPascalCase" | |
], | |
"leadingUnderscore": "allow" | |
}, | |
{ | |
"selector": "enumMember", | |
"format": [ | |
"UPPER_CASE" | |
] | |
}, | |
{ | |
"selector": "typeLike", | |
"format": [ | |
"StrictPascalCase" | |
] | |
} | |
], | |
"indent": "off", | |
"no-unused-vars": "off", | |
"no-throw-literal": "error", | |
"prefer-const": "error", | |
"no-multi-spaces": "error", | |
"no-return-await": "error", | |
"curly": "error", | |
"prefer-template": "error", | |
"block-spacing": "error", | |
"eol-last": "error", | |
"arrow-spacing": "error", | |
"keyword-spacing": "error", | |
"space-before-blocks": "error", | |
"space-in-parens": "error", | |
"space-unary-ops": "error", | |
"space-infix-ops": "error", | |
"default-param-last": "error", | |
"guard-for-in": "error", | |
"no-eval": "error", | |
"no-implied-eval": "error", | |
"no-extra-label": "error", | |
"no-new-wrappers": "error", | |
"no-return-assign": "error", | |
"no-useless-return": "error", | |
"radix": "error", | |
"no-lonely-if": "error", | |
"no-mixed-operators": "error", | |
"no-whitespace-before-property": "error", | |
"no-unneeded-ternary": "error", | |
"operator-assignment": "error", | |
"no-useless-constructor": "error", | |
"no-sync": "error", | |
"quotes": [ | |
"error", | |
"single", | |
{ | |
"avoidEscape": true | |
} | |
], | |
"max-len": [ | |
"error", | |
{ | |
"code": 150, | |
"ignoreStrings": true | |
} | |
], | |
"semi": [ | |
"error", | |
"always" | |
], | |
"comma-dangle": [ | |
"error", | |
"never" | |
], | |
"arrow-parens": [ | |
"error", | |
"as-needed" | |
], | |
"arrow-body-style": [ | |
"error", | |
"as-needed" | |
], | |
"padded-blocks": [ | |
"error", | |
{ | |
"classes": "always", | |
"switches": "never" | |
} | |
], | |
"no-multiple-empty-lines": [ | |
"error", | |
{ | |
"max": 1 | |
} | |
], | |
"eqeqeq": [ | |
"error", | |
"smart" | |
], | |
"no-trailing-spaces": [ | |
"error", | |
{ | |
"ignoreComments": true | |
} | |
], | |
"no-else-return": [ | |
"error", | |
{ | |
"allowElseIf": false | |
} | |
], | |
"object-curly-spacing": [ | |
"error", | |
"always" | |
], | |
"array-bracket-spacing": [ | |
"error", | |
"never" | |
], | |
"space-before-function-paren": [ | |
"error", | |
{ | |
"anonymous": "never", | |
"asyncArrow": "always", | |
"named": "never" | |
} | |
], | |
"max-classes-per-file": [ | |
"error", | |
1 | |
], | |
"array-bracket-newline": [ | |
"error", | |
"consistent" | |
], | |
"brace-style": [ | |
"error", | |
"1tbs", | |
{ | |
"allowSingleLine": true | |
} | |
], | |
"max-lines": [ | |
"error", | |
1000 | |
], | |
"max-lines-per-function": [ | |
"error", | |
80 | |
], | |
"max-params": [ | |
"error", | |
5 | |
], | |
"operator-linebreak": [ | |
"error", | |
"after" | |
], | |
"no-duplicate-imports": [ | |
"error", | |
{ | |
"includeExports": true | |
} | |
], | |
"import/order": [ | |
"error", | |
{ | |
"alphabetize": { | |
"order": "asc", | |
"caseInsensitive": true | |
}, | |
"newlines-between": "never" | |
} | |
], | |
"security/detect-object-injection": "off", | |
"security/detect-non-literal-fs-filename": "off", | |
"security/detect-non-literal-require": "off", | |
"security/detect-new-buffer": "off" | |
} | |
} |
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
{ | |
"eslint-plugin-import": "^2.22.1", | |
"eslint-plugin-react": "^7.21.3", | |
"eslint-plugin-security": "^1.4.0" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment