Created
October 30, 2019 10:54
-
-
Save savaryna/eb34ed95ff1111f18fa7634598a60fcc to your computer and use it in GitHub Desktop.
This file contains 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
1. npm install --save-dev eslint prettier eslint-plugin-prettier eslint-config-prettier | |
2. ./node_modules/.bin/eslint --init | |
// Prettier | |
{ | |
"arrowParens": "avoid", | |
"bracketSpacing": true, | |
"htmlWhitespaceSensitivity": "css", | |
"insertPragma": false, | |
"jsxBracketSameLine": false, | |
"jsxSingleQuote": false, | |
"printWidth": 80, | |
"proseWrap": "preserve", | |
"quoteProps": "as-needed", | |
"requirePragma": false, | |
"semi": false, | |
"singleQuote": true, | |
"tabWidth": 2, | |
"trailingComma": "all", | |
"useTabs": false | |
} | |
// ESlint | |
{ | |
"env": { | |
"browser": true, | |
"es6": true | |
}, | |
"extends": [ | |
"airbnb", | |
"plugin:prettier/recommended" | |
], | |
"globals": { | |
"Atomics": "readonly", | |
"SharedArrayBuffer": "readonly" | |
}, | |
"parserOptions": { | |
"ecmaFeatures": { | |
"jsx": true | |
}, | |
"ecmaVersion": 2018, | |
"sourceType": "module" | |
}, | |
"plugins": [ | |
"react" | |
], | |
"rules": { | |
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }] | |
} | |
} | |
// package.json | |
"devDependencies": { | |
"eslint": "^6.6.0", | |
"eslint-config-airbnb": "^18.0.1", | |
"eslint-config-prettier": "^6.5.0", | |
"eslint-plugin-import": "^2.18.2", | |
"eslint-plugin-jsx-a11y": "^6.2.3", | |
"eslint-plugin-prettier": "^3.1.1", | |
"eslint-plugin-react": "^7.16.0", | |
"eslint-plugin-react-hooks": "^1.7.0", | |
"prettier": "^1.18.2" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment