Skip to content

Instantly share code, notes, and snippets.

@douglira
Last active December 18, 2018 20:29
Show Gist options
  • Save douglira/6da8eea700eb97ee0382f71625592d3f to your computer and use it in GitHub Desktop.
Save douglira/6da8eea700eb97ee0382f71625592d3f to your computer and use it in GitHub Desktop.
React native eslint config
{
"presets": ["module:metro-react-native-babel-preset"],
"plugins": [
["babel-plugin-root-import", {
"rootPathSuffix": "src",
}]
],
"env": {
"production": {
"plugins": [
["babel-plugin-root-import", {
"rootPathSuffix": "src",
}]
]
}
}
}
{
"parser": "babel-eslint",
"extends": ["airbnb", "plugin:react-native/all"],
"plugins": ["react-native", "jsx-a11y", "import"],
"env": {
"jest": true
},
"rules": {
"react/jsx-filename-extension": ["error", {
"extensions": [".jsx", ".js"]
}],
"import/prefer-default-export": "off"
},
"globals": {
"__DEV__": true
},
"settings": {
"import/resolver": {
"babel-plugin-root-import": {}
}
}
}
yarn add eslint -D
yarn eslint --init
yarn add babel-eslint eslint-plugin-react-native -D
yarn add babel-plugin-root-import -D
yarn add eslint-import-resolver-babel-plugin-root-import -D
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"~/*": ["src/*"],
"test/*": ["test/*"],
"underscore": ["lodash"]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment