Skip to content

Instantly share code, notes, and snippets.

@matheusnascgomes
Forked from diego3g/.eslintrc.js
Last active November 17, 2021 22:19
Show Gist options
  • Save matheusnascgomes/626b212ef3f9dc9b8d9018f215e62866 to your computer and use it in GitHub Desktop.
Save matheusnascgomes/626b212ef3f9dc9b8d9018f215e62866 to your computer and use it in GitHub Desktop.
A basic setup on typescript linter in a React Project
module.exports = {
env: {
browser: true,
es6: true,
jest: true,
},
extends: [
'react-app',
'airbnb',
'plugin:@typescript-eslint/recommended',
'prettier/@typescript-eslint',
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: ['react', 'import', 'jsx-a11y'],
rules: {
'react/jsx-filename-extension': [
'error',
{
extensions: ['.tsx'],
},
],
'import/prefer-default-export': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off'
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {},
},
},
};
"devDependencies": {
"@types/react-redux": "^7.0.5",
"@typescript-eslint/eslint-plugin": "^1.5.0",
"@typescript-eslint/parser": "^1.5.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-config-prettier": "^4.1.0",
"eslint-import-resolver-typescript": "^1.1.1",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-prettier": "^3.0.1",
"eslint-plugin-react": "^7.12.4",
"prettier": "^1.16.4"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment