Created
November 18, 2019 23:35
-
-
Save haykerman/caadc955b04cd166e986fb3428fedb17 to your computer and use it in GitHub Desktop.
A config file for ESLint.
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
module.exports = { | |
env: { | |
browser: true, | |
es6: true, | |
}, | |
parser: 'babel-eslint', | |
extends: ['airbnb', 'prettier', 'prettier/react'], | |
globals: { | |
Atomics: 'readonly', | |
SharedArrayBuffer: 'readonly', | |
}, | |
parserOptions: { | |
ecmaFeatures: { | |
jsx: true, | |
modules: true, | |
}, | |
ecmaVersion: 2018, | |
sourceType: 'module', | |
}, | |
plugins: ['react', 'prettier'], | |
rules: { | |
'prettier/prettier': 'error', | |
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }], | |
'react/forbid-prop-types': [0, { forbid: ['any'] }], | |
'react/prop-types': 0, | |
}, | |
env: { | |
jest: true, | |
browser: true, | |
node: true, | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was reading https://medium.com/@haykerman/setting-up-eslint-prettier-for-react-app-in-vscode-8662de2d9a96 when I think I noticed an error.
There are two
env
objects, and the one at the end will overwrite the one at the beginning. The overwrite will retainbrowser
because both env objects havebrowser: true
, butes6: true
will get wiped away by the overwrite.Can you please verify if there is an error here, of if the two separate env properties are indeed meant to be separate?