Skip to content

Instantly share code, notes, and snippets.

@ohlookemus
Created March 22, 2016 19:29
Show Gist options
  • Save ohlookemus/4fdfeb440d1486ebafb8 to your computer and use it in GitHub Desktop.
Save ohlookemus/4fdfeb440d1486ebafb8 to your computer and use it in GitHub Desktop.
React eslint
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"extends": ["eslint:recommended", "plugin:react/recommended"],
"parserOptions": {
"ecmaVersion": 6,
"ecmaFeatures": {
"arrowFunctions": true,
"binaryLiterals": true,
"blockBindings": true,
"classes": true,
"defaultParams": true,
"destructuring": true,
"forOf": true,
"generators": true,
"modules": true,
"objectLiteralComputedProperties": true,
"objectLiteralDuplicateProperties": true,
"objectLiteralShorthandMethods": true,
"objectLiteralShorthandProperties": true,
"octalLiterals": true,
"regexUFlag": true,
"regexYFlag": true,
"spread": true,
"superInFunctions": true,
"templateStrings": true,
"unicodeCodePointEscapes": true,
"globalReturn": true,
"jsx": true
}
},
"rules": {
"react/display-name": 0, // Prevent missing displayName in a React component definition
"react/jsx-quotes": [2, "double", "avoid-escape"], // Enforce quote style for JSX attributes
"react/jsx-no-undef": 2, // Disallow undeclared variables in JSX
"react/jsx-sort-props": 0, // Enforce props alphabetical sorting
"react/jsx-uses-react": 2, // Prevent React to be incorrectly marked as unused
"react/jsx-uses-vars": 2, // Prevent variables used in JSX to be incorrectly marked as unused
"react/no-did-mount-set-state": 2, // Prevent usage of setState in componentDidMount
"react/no-did-update-set-state": 2, // Prevent usage of setState in componentDidUpdate
"react/no-multi-comp": 0, // Prevent multiple component definition per file
"react/no-unknown-property": 2, // Prevent usage of unknown DOM property
"react/prop-types": 2, // Prevent missing props validation in a React component definition
"react/react-in-jsx-scope": 2, // Prevent missing React when using JSX
"react/self-closing-comp": 2, // Prevent extra closing tags for components without children
"react/wrap-multilines": 2 // Prevent missing parentheses around multilines JSX
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment