Skip to content

Instantly share code, notes, and snippets.

@juanpablocs
Last active April 4, 2018 16:06
Show Gist options
  • Save juanpablocs/60b32345dc13c656fe2649fd5cdaaa51 to your computer and use it in GitHub Desktop.
Save juanpablocs/60b32345dc13c656fe2649fd5cdaaa51 to your computer and use it in GitHub Desktop.
Eslint base for react and js good parts

.eslintrc.js

module.exports = {
    "env": {
        "browser": true,
        "node": true,
        "es6": true
    },
    "globals": {
        "eplanning": true
    },
    "rules": {
        "for-direction": "error",
        "no-cond-assign": "error",
        "no-empty": "error",
        "no-extra-semi": "error",
        "valid-typeof": "error",
        "no-multi-spaces": ["error", {
            "exceptions": {
                "VariableDeclarator": true,
                "ImportDeclaration": true,
                "Property": true
            }
        }
        ],
        "comma-dangle": ["error", "never"],
        "space-before-blocks": "error",
        "semi": "error",
        "comma-spacing": ["error", {
            "before": false,
            "after": true
        }
        ],
        "eqeqeq": "error",
        "quotes": ["error", "single"],
        "indent": ["error", 4],
        "brace-style": ["error"],
        "new-cap": ["error", {
            "newIsCap": true
        }
        ],
        "no-unused-vars": ["error", { 
            "vars": "all", 
            "args": "after-used", 
            "ignoreRestSiblings": false 
        }
        ],
        "react/jsx-uses-react": ["error"],
        "react/jsx-uses-vars": "error",
        "no-undef": "error",
    },
    "plugins": [
        "react"
    ],
    "parserOptions": {
        "ecmaVersion": 6,
        "sourceType": "module",
        "ecmaFeatures": {
            "jsx": true,
            "modules": true
        }
    },
    "settings": {
        "react": {
            "pragma": "React",
            "version": "16.0"
        }
    }
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment