Skip to content

Instantly share code, notes, and snippets.

@kmylo
Created January 9, 2022 07:24
Show Gist options
  • Save kmylo/64194d9c3f0ffa552a8fbf08c2128a5d to your computer and use it in GitHub Desktop.
Save kmylo/64194d9c3f0ffa552a8fbf08c2128a5d to your computer and use it in GitHub Desktop.
react eslintrc
{
"env": {
"node": true,
"browser": true,
"es6": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true // permite a eslint analizar los archivos jsx o tsx
}
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint",
"plugin:prettier/recommended",
"plugin:react-hooks/recommended"
],
"plugins": ["react", "@typescript-eslint", "prettier", "import"],
"rules": {
"no-console": "warn",
"no-unused-vars": [
"warn",
{
"args": "after-used",
"ignoreRestSiblings": false,
"argsIgnorePattern": "^_$"
}
],
"prettier/prettier": [
"error",
{
"printWidth": 100,
"trailingComma": "all",
"tabWidth": 2,
"semi": true,
"singleQuote": false,
"bracketSpacing": false,
"arrowParens": "always"
}
],
"import/order": ["warn", {"newlines-between": "always"}],
"react/prop-types": "off",
"react/self-closing-comp": "warn",
"react-hooks/rules-of-hooks": "warn",
"react-hooks/exhaustive-deps": "warn",
"react/jsx-sort-props": ["warn", {
"callbacksLast": true,
"shorthandFirst": true,
"noSortAlphabetically": false,
"reservedFirst": true
}],
"padding-line-between-statements": [
"error",
{ "blankLine": "always", "prev": "*", "next": "return" },
{ "blankLine": "always", "prev": ["const", "let", "var"], "next": "*"},
{ "blankLine": "any", "prev": ["const", "let", "var"], "next": ["const", "let", "var"]}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment