Last active
March 6, 2021 15:54
-
-
Save tomasflopes/83b07febb34640aad261d92a6af1aa2c to your computer and use it in GitHub Desktop.
ESLINT/PRETTIER COMPLETE 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
yarn add prettier eslint-plugin-prettier eslint-config-prettier @typescript-eslint/eslint-plugin@latest eslint-config-airbnb-base@latest @typescript-eslint/parser@latest -D | |
--------------------------------------------------------------------- | |
.eslintrc.json | |
{ | |
"parser": "@typescript-eslint/parser", | |
"parserOptions": { | |
"ecmaVersion": 2018, | |
"sourceType": "module" | |
}, | |
"settings": { | |
"react": { | |
"version": "detect" // Tells eslint-plugin-react to automatically detect the version of React to use | |
} | |
}, | |
"plugins": [ | |
"react", | |
"@typescript-eslint", | |
"react-hooks", | |
"prettier" | |
], | |
"extends": [ | |
"plugin:react/recommended", | |
"plugin:prettier/recommended", | |
"airbnb", | |
"eslint:recommended", | |
"plugin:@typescript-eslint/recommended" | |
], | |
"env": { | |
"es6": true, | |
"browser": true, | |
"jest": true, | |
"node": true | |
}, | |
"rules": { | |
"react/jsx-filename-extension": [ | |
2, | |
{ | |
"extensions": [ | |
".js", | |
".jsx", | |
".ts", | |
".tsx" | |
] | |
} | |
], | |
"react/jsx-one-expression-per-line": "off", | |
"no-alert": "off", | |
"comma-dangle": "off", | |
"react/react-in-jsx-scope": 0, | |
"react/display-name": 0, | |
"@typescript-eslint/explicit-module-boundary-types": 0, | |
"@typescript-eslint/explicit-member-accessibility": 0, | |
"@typescript-eslint/indent": 0, | |
"@typescript-eslint/member-delimiter-style": 0, | |
"@typescript-eslint/no-explicit-any": "off", | |
"@typescript-eslint/no-var-requires": 0, | |
"no-use-before-define": 0, | |
"@typescript-eslint/no-use-before-define": 0, | |
"react-hooks/rules-of-hooks": "error", | |
"react-hooks/exhaustive-deps": "warn", | |
"object-curly-newline": 0, | |
"import/extensions": 0, | |
"react/jsx-props-no-spreading": 0, | |
"react/prop-types": "off", | |
"space-before-function-paren": "off", | |
"arrow-parens": "off", | |
"import/no-unresolved": 0, | |
"@typescript-eslint/ban-ts-ignore": [ | |
"off" | |
], | |
"react/no-unescaped-entities": 0, | |
"quotes": [ | |
"error", | |
"single", | |
{ | |
"allowTemplateLiterals": true | |
} | |
], | |
"object-curly-spacing": [ | |
"error", | |
"always" | |
], | |
"no-empty-pattern": [ | |
"off" | |
], | |
"no-undef": [ | |
"error" | |
], | |
"no-var": [ | |
"error" | |
], | |
"@typescript-eslint/no-unused-vars": [ | |
2, | |
{ | |
"argsIgnorePattern": "^_" | |
} | |
], | |
"no-console": [ | |
1, | |
{ | |
"allow": [ | |
"warn", | |
"error" | |
] | |
} | |
] | |
} | |
} | |
-------------------------------------------- | |
.eslintignore | |
node_modules | |
.next | |
/*.js | |
------------------------------------------ | |
prettier.config.js | |
module.exports = { | |
semi: true, | |
singleQuote: true, | |
arrowParens: 'avoid', | |
trailingComma: 'none', | |
enfOfLine: 'auto', | |
tabWidth: 2 | |
}; | |
------------------------------------------ | |
tsconfig.json | |
{ | |
"compilerOptions": { | |
"baseUrl": "./", | |
"paths": { | |
"@components/*": [ | |
"./components/*" | |
], | |
"@contexts/*": [ | |
"./contexts/*" | |
] | |
}, | |
"target": "es5", | |
"lib": [ | |
"dom", | |
"dom.iterable", | |
"esnext" | |
], | |
"allowJs": true, | |
"skipLibCheck": true, | |
"strict": true, | |
"noImplicitReturns": false, | |
"noUnusedLocals": true, | |
"suppressImplicitAnyIndexErrors": true, | |
"strictNullChecks": true, | |
"forceConsistentCasingInFileNames": true, | |
"noEmit": true, | |
"esModuleInterop": true, | |
"module": "esnext", | |
"moduleResolution": "node", | |
"resolveJsonModule": true, | |
"isolatedModules": true, | |
"jsx": "preserve" | |
}, | |
"include": [ | |
"next-env.d.ts", | |
"**/*.ts", | |
"**/*.tsx" | |
], | |
"exclude": [ | |
"node_modules" | |
] | |
} | |
--------------------------------------- | |
.editorconfig | |
root = true | |
[*] | |
indent_style = space | |
indent_size = 2 | |
end_of_line = lf | |
charset = utf-8 | |
trim_trailing_whitespace = false | |
insert_final_newline = true | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment