Last active
July 7, 2023 02:51
-
-
Save 0x01001/877125ff1c3a10439419c33735b46124 to your computer and use it in GitHub Desktop.
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
npm i -g eslint | |
npm i -g prettier | |
eslint --init | |
? How would you like to configure ESLint? Use a popular style guide | |
? Which style guide do you want to follow? Airbnb (https://github.com/airbnb/javascript) | |
? Do you use React? Yes | |
? What format do you want your config file to be in? JSON | |
Checking peerDependencies of eslint-config-airbnb@latest | |
? The style guide "airbnb" requires eslint@^4.19.1 || ^5.3.0. You are currently using [email protected]. | |
Do you want to downgrade? Yes | |
eslint-config-airbnb@latest eslint@^4.19.1 || ^5.3.0 eslint-plugin-import@^2.14.0 eslint-plugin-jsx-a11y@^6.1.1 eslint-plugin-react@^7.11.0 | |
? Would you like to install them now with npm? Yes | |
Update .eslintrc with following lines: | |
{ | |
"extends": "airbnb", | |
"rules": { | |
"arrow-body-style": "warn", | |
"react-native/no-unused-styles": 2, | |
"react-native/split-platform-components": 0, | |
"react-native/no-inline-styles": 0, | |
"react-native/no-color-literals": 0, | |
"semi": [2, "never"], | |
"class-methods-use-this": 0, | |
"react/jsx-filename-extension": [ | |
1, | |
{ | |
"extensions": [".js", ".jsx"] | |
} | |
], | |
"react/prefer-stateless-function": [ | |
0, | |
{ | |
"ignorePureComponents": 1 | |
} | |
], | |
"react/forbid-prop-types": 0, | |
"no-underscore-dangle": 0, | |
"no-restricted-properties": 0, | |
"no-plusplus": 0, | |
"no-alert": 0, | |
"max-len": 0, | |
"global-require": 0, | |
"react/jsx-no-bind": 0, | |
"react/prefer-es6-class": 0, | |
"react/react-in-jsx-scope": 0, | |
"space-before-function-paren": 0, | |
"linebreak-style": 0, | |
"react/jsx-quotes": 0, | |
"react/no-array-index-key": 0, | |
"react/jsx-boolean-value": 0, | |
"no-nested-ternary": 0, | |
"func-names": 0, | |
"no-bitwise": 0, | |
"no-await-in-loop": 0, | |
"jsx-quotes": [2, "prefer-double"], | |
"eqeqeq": 0, | |
"no-return-await": 0, | |
"camelcase": 0 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment