Skip to content

Instantly share code, notes, and snippets.

@aamnah
Created August 1, 2020 16:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aamnah/e80c49c01af22fbeb2b3189b11c4695c to your computer and use it in GitHub Desktop.
Save aamnah/e80c49c01af22fbeb2b3189b11c4695c to your computer and use it in GitHub Desktop.
ESLint for React Native (sans Typescript support)
# .eslintrc.yaml
# Configuration: https://eslint.org/docs/user-guide/configuring
# Using with Prettier: https://prettier.io/docs/en/integrating-with-linters.html#recommended-configuration
root: true
extends:
- '@react-native-community'
- plugin:import/errors
- plugin:import/warnings
- plugin:import/typescript
- prettier # needs to be LAST, so it gets the chance to override other configs.
- prettier/react
plugins:
- import
settings:
import/resolver:
node:
extensions: ['.js', '.jsx', '.ts', '.tsx']
moduleDirectory: ['node_modules', 'src/']
rules:
import/order:
- error
- groups:
- builtin
- external
- internal
- - parent
- sibling
pathGroups:
- pattern: react
group: external
position: before
pathGroupsExcludedImportTypes:
- react
newlines-between: always
alphabetize:
order: asc
caseInsensitive: true
npm i -D eslint prettier eslint-plugin-import eslint-config-prettier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment