Created
March 26, 2019 23:37
-
-
Save yuritoledo/b43ce984c0ac158e3e2c40b8c13ea58f 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
--- | |
root: true | |
parser: babel-eslint | |
extends: | |
# https://github.com/yannickcr/eslint-plugin-react | |
- plugin:react/recommended | |
# https://github.com/gajus/eslint-plugin-flowtype | |
- plugin:flowtype/recommended | |
# https://www.npmjs.com/package/eslint-plugin-jest | |
- plugin:jest/recommended | |
# https://www.npmjs.com/package/eslint-config-airbnb-base | |
- airbnb | |
# https://github.com/prettier/eslint-config-prettier | |
- prettier | |
- prettier/flowtype | |
- prettier/react | |
plugins: | |
- react | |
- import | |
- jest | |
- flowtype | |
# https://github.com/prettier/eslint-plugin-prettier | |
- prettier | |
settings: | |
flowtype: | |
# with this option you do not have to add @flow in files | |
onlyFilesWithFlowAnnotation: false | |
env: | |
es6: true | |
browser: true | |
node: true | |
jasmine: true | |
jest: true | |
jest/globals: true | |
globals: | |
fetch: true | |
navigator: true | |
__DEV__: true | |
XMLHttpRequest: true | |
React$Element: true | |
Generator: true | |
parserOptions: | |
ecmaVersion: 2017 | |
sourceType: module | |
ecmaFeatures: | |
jsx: true | |
rules: | |
prettier/prettier: | |
- error | |
- | |
trailingComma: all | |
bracketSpacing: false | |
### Different from airbnb config | |
### Styling ### | |
# Prefer new line before return | |
# http://eslint.org/docs/rules/newline-before-return | |
newline-before-return: error # airbnb default: off | |
### Variables ### | |
# Functions and classes can be used before declaration | |
# http://eslint.org/docs/rules/no-use-before-define | |
no-use-before-define: # airbnb default: ['error', { functions: true, classes: true, variables: true }] | |
- error | |
- | |
functions: false | |
classes: false | |
variables: true | |
### From error to warning ### | |
# was not working when used with flow prop types | |
no-unused-vars: warn | |
react/no-unused-prop-types: warn | |
### ES6 ### | |
### Best practices ### | |
# require or disallow Yoda conditions | |
# https://eslint.org/docs/rules/yoda | |
yoda: [error, never, { exceptRange: true }] # airbnb default: 'error' | |
# add culry braces all the time | |
# https://eslint.org/docs/rules/curly | |
curly: [error, all] # airbnb default: [error, multi-line] | |
### Import ### | |
# Require modules with a single export to use a default export | |
# https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/prefer-default-export.md | |
import/prefer-default-export: off # airbnb default: 'error' | |
# https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/imports-first.md | |
import/first: off # airbnb default: ['error', 'absolute-first'] | |
### Debugging is allowed but not allowed to commit ### | |
no-console: warn # airbnb default: 'error' | |
no-debugger: warn # airbnb default: 'error' | |
### React ### | |
# do not force jsx use js | |
# https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md | |
react/jsx-filename-extension: off | |
# Require stateless functions when not using lifecycle methods, setState or ref | |
# https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-stateless-function.md | |
react/prefer-stateless-function: warn # airbnb default: 'error' | |
# Enforce a defaultProps definition for every prop that is not a required prop | |
# reason: function composition over default props | |
# https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-default-props.md | |
react/require-default-props: off # airbnb default: 'error' | |
### Removed rules | |
# no longer defined | |
jsx-a11y/href-no-hash: off | |
# was complaining about inline snapshots | |
no-irregular-whitespace: | |
- off |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment