Skip to content

Instantly share code, notes, and snippets.

@yuritoledo
Created October 9, 2019 15:16
Show Gist options
  • Save yuritoledo/742f465bee07022355f195d4fd539c76 to your computer and use it in GitHub Desktop.
Save yuritoledo/742f465bee07022355f195d4fd539c76 to your computer and use it in GitHub Desktop.
eslint react para typescript
{
"env": {
"browser": true,
"es6": true,
"jest": true
},
"settings": {
"react": {
"version": "detect"
}
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/eslint-recommended"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": [
"react",
"@typescript-eslint"
],
"rules": {
"max-len": [
"warn",
{
"code": 85,
"ignoreStrings": true,
"ignoreComments": true
}
],
"no-var": "warn",
"prefer-const": "warn",
"prefer-destructuring": [
"error",
{
"object": true,
"array": false
}
],
"no-implicit-coercion": "warn",
"no-useless-return": "warn",
"yoda": "warn",
"@typescript-eslint/no-unused-vars": "warn",
"no-unused-vars": "off",
"no-multiple-empty-lines": [
"warn",
{
"max": 3,
"maxEOF": 1
}
],
"vars-on-top": "warn",
"no-console": [
"warn",
{
"allow": [
"warn",
"error"
]
}
],
"@typescript-eslint/indent": [
"warn",
2,
{
"SwitchCase": 1
}
],
"space-infix-ops": "warn",
"no-trailing-spaces": "warn",
"no-unreachable": "warn",
"template-curly-spacing": "warn",
"prefer-template": "warn",
"no-debugger": "warn",
"no-extra-boolean-cast": "warn",
"no-irregular-whitespace": "warn",
"no-multi-spaces": "warn",
"no-template-curly-in-string": "warn",
"no-unneeded-ternary": "warn",
"no-case-declarations": "off",
"no-unused-expressions": "off",
"no-else-return": "warn",
"no-restricted-globals": "off",
"no-use-before-define": "off",
"no-mixed-spaces-and-tabs": "warn",
"no-extra-parens": "off",
"object-shorthand": "warn",
"prefer-arrow-callback": "warn",
"no-duplicate-imports": "warn",
"arrow-spacing": "warn",
"no-sequences": "off",
"no-lonely-if": "warn",
"eqeqeq": "warn",
"quotes": [
"warn",
"single"
],
"object-curly-spacing": [
"warn",
"always"
],
"key-spacing": "warn",
"semi": [
"warn",
"never"
],
"arrow-parens": [
"warn",
"as-needed"
],
"react/self-closing-comp": [
"warn",
{
"component": true
}
],
"react/jsx-closing-bracket-location": [
1,
"tag-aligned"
],
"react/jsx-max-props-per-line": [
1,
{
"when": "multiline"
}
],
"react/jsx-first-prop-new-line": [
1,
"multiline"
],
"react/jsx-tag-spacing": [
1,
{
"closingSlash": "never",
"beforeSelfClosing": "always",
"afterOpening": "never",
"beforeClosing": "never"
}
],
"react/prop-types": "off",
"react/prefer-stateless-function": [
1
],
"comma-spacing": "warn",
"comma-dangle": "off",
"react/display-name": "off",
"no-whitespace-before-property": "off",
"@typescript-eslint/type-annotation-spacing": "warn",
"no-prototype-builtins": "off"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment