Skip to content

Instantly share code, notes, and snippets.

@luizwhite
Created November 2, 2021 17:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luizwhite/44e85a9fb5e977d38a3fac22fcec895f to your computer and use it in GitHub Desktop.
Save luizwhite/44e85a9fb5e977d38a3fac22fcec895f to your computer and use it in GitHub Desktop.
React Vite Eslint Config
{
"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