Skip to content

Instantly share code, notes, and snippets.

@jwarby
Created January 18, 2017 01:23
Show Gist options
  • Save jwarby/2cc636405a19a6ffe1ca9cda128d2a86 to your computer and use it in GitHub Desktop.
Save jwarby/2cc636405a19a6ffe1ca9cda128d2a86 to your computer and use it in GitHub Desktop.
ESLint configuration file for React/React Native projects
{
"extends": "eslint:recommended",
"parser": "babel-eslint",
"env": {
"node": true,
"mocha": true,
"es6": true
},
"rules": {
"import/default": 2,
"import/export": 2,
"import/imports-first": 2,
"import/no-duplicates": 2,
"import/named": 2,
"import/namespace": 2,
"import/no-unresolved": 2,
"import/no-named-as-default": 0,
"react/no-deprecated": 2,
"react/no-did-mount-set-state": 2,
"react/no-did-update-set-state": 2,
"react/no-direct-mutation-state": 2,
"react/no-unknown-property": 2,
"react/prefer-stateless-function": 0,
"react/prop-types": [2],
"react/react-in-jsx-scope": 2,
"react/self-closing-comp": 2,
"react/sort-comp": 1,
"react/jsx-boolean-value": [2, "always"],
"react/jsx-closing-bracket-location": [2, "tag-aligned"],
"react/jsx-equals-spacing": [2, "never"],
"react/jsx-indent": [2, 2],
"react/jsx-indent-props": [2, 2],
"react/jsx-key": 2,
"react/jsx-no-bind": 2,
"react/jsx-no-duplicate-props": 2,
"react/jsx-no-undef": 2,
"react/jsx-space-before-closing": [2, "always"],
"react/jsx-uses-react": 2,
"react/jsx-uses-vars": 2,
"react-native/no-unused-styles": 2,
"react-native/split-platform-components": 2,
"comma-dangle": [2, "never"],
"consistent-return": 0,
"indent": [2, 2, {"SwitchCase": 1}],
"linebreak-style": [2, "unix"],
"max-len": [2, 120, 4],
"no-alert": 0,
"no-console": 2,
"no-param-reassign": [2, {"props": false}],
"no-trailing-spaces": 2,
"no-useless-constructor": 2,
"no-unused-vars": [2, { "args": "none" }],
"object-shorthand": [2, "always"],
"semi": [2, "never"],
"quotes": [2, "single"],
"prefer-const": 2
},
"plugins": [
"react", "import", "react-native"
],
"settings": {
"import/parser": "babel-eslint",
"import/resolve": {
"moduleDirectory": ["node_modules", "src"],
},
"import/ignore": ["\\.scss$", "node_modules", "\\.json$"],
"import/resolver": {
"node": {
"extensions": [".js", ".android.js", "ios.js"]
}
}
},
"globals": {
"__DEV__": true,
"__CLIENT__": true,
"__SERVER__": true,
"__DISABLE_SSR__": true,
"__DEVTOOLS__": true,
"socket": true,
"webpackIsomorphicTools": true
},
"parserOptions": {
"ecmaFeatures": {
"jsx": true,
"experimentalObjectRestSpread": true,
"modules": true
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment