Created
November 2, 2021 17:23
-
-
Save luizwhite/44e85a9fb5e977d38a3fac22fcec895f to your computer and use it in GitHub Desktop.
React Vite Eslint Config
This file contains hidden or 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
{ | |
"env": { | |
"browser": true, | |
"es2021": true | |
}, | |
"extends": [ | |
"plugin:react-hooks/recommended", | |
"plugin:react/recommended", | |
"airbnb", | |
"plugin:@typescript-eslint/recommended", | |
"plugin:prettier/recommended" | |
], | |
"parser": "@typescript-eslint/parser", | |
"parserOptions": { | |
"ecmaFeatures": { | |
"jsx": true | |
}, | |
"ecmaVersion": 13, | |
"sourceType": "module" | |
}, | |
"ignorePatterns": ["node_modules", "dist"], | |
"plugins": ["react", "import-helpers"], | |
"rules": { | |
"react/prop-types": "off", | |
"react/react-in-jsx-scope": "off", | |
"react/jsx-props-no-spreading": "off", | |
"react/jsx-filename-extension": [ | |
"error", | |
{ "extensions": [".jsx", "tsx"] } | |
], | |
"jsx-a11y/label-has-associated-control": [ | |
"error", | |
{ | |
"assert": "htmlFor" | |
} | |
], | |
"no-use-before-define": "off", | |
"@typescript-eslint/no-use-before-define": ["error"], | |
"no-shadow": "off", | |
"@typescript-eslint/no-shadow": ["error"], | |
"@typescript-eslint/no-unused-vars": [ | |
"error", | |
{ | |
"argsIgnorePattern": "^_.+[^_]$" | |
} | |
], | |
"@typescript-eslint/naming-convention": [ | |
"error", | |
{ | |
"selector": "interface", | |
"format": ["PascalCase"], | |
"custom": { | |
"regex": "^I[A-Z]", | |
"match": true | |
} | |
} | |
], | |
"import/prefer-default-export": "off", | |
"import/extensions": [ | |
"error", | |
"ignorePackages", | |
{ | |
"ts": "never", | |
"tsx": "never", | |
"js": "never", | |
"jsx": "never" | |
} | |
], | |
"import-helpers/order-imports": [ | |
"warn", | |
{ | |
"newlinesBetween": "always", | |
"groups": [ | |
"module", | |
"absolute", | |
"/^@/(?!.*assets).*/", | |
"/^@/assets/", | |
["parent", "sibling", "index"] | |
], | |
"alphabetize": { "order": "asc", "ignoreCase": true } | |
} | |
] | |
}, | |
"settings": { | |
"import/resolver": "typescript" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment