Skip to content

Instantly share code, notes, and snippets.

@tavareshenrique
Created November 30, 2019 20:42
Show Gist options
  • Save tavareshenrique/584b32398289ddcf3846a84ca5da25b5 to your computer and use it in GitHub Desktop.
Save tavareshenrique/584b32398289ddcf3846a84ca5da25b5 to your computer and use it in GitHub Desktop.
ESLint Configure to React Native
module.exports = {
env: {
es6: true,
},
extends: ['plugin:react/recommended', 'airbnb', 'prettier', 'prettier/react'],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
__DEV__: 'readonly',
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: ['react', 'prettier'],
rules: {
'prettier/prettier': 'error',
'react/jsx-filename-extension': ['warn', { extensions: ['.jsx', '.js'] }],
'import/prefer-default-export': 'off',
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'react/jsx-one-expression-per-line': 'off',
'global-require': 'off',
'react-native/no-raw-text': 'off',
'no-param-reassign': 'off',
'no-underscore-dangle': 'off',
camelcase: 'off',
'no-console': ['error', { allow: ['tron'] }],
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
},
settings: {
'import/resolver': {
'babel-plugin-root-import': {
rootPathSuffix: 'src',
},
},
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment