Skip to content

Instantly share code, notes, and snippets.

@aherok
Last active April 4, 2017 18:36
Show Gist options
  • Save aherok/ea97edf0777f5b1438ce8a46c0888f90 to your computer and use it in GitHub Desktop.
Save aherok/ea97edf0777f5b1438ce8a46c0888f90 to your computer and use it in GitHub Desktop.
eslint codestyle config
module.exports = {
// enable parsing ES5 code
/*
"parserOptions": {
"ecmaVersion": 5,
},
*/
"parser": "babel-eslint", // needed to properly parse ES7 features, e.g. 'static' declarations
"extends": "airbnb",
// put variables that are global. `false` means they cannot be changed, `true` means they can change
"globals": {
"jest": false
},
"plugins": [
"react",
"jsx-a11y",
"import"
],
"env": {
"browser": true,
"mocha": true,
"jasmine": true
},
"rules": {
"comma-dangle": 2, // comma after last element in arrays/objects
"global-require": 0,
"no-unused-vars": 1,
"no-shadow": 1,
"max-len": ["error", 120],
"semi": 2, // semicolons after each instruction, even `return`
"import/prefer-default-export": 0,
"import/extensions": 1, // nexpected use of file extension "js" for ...
"react/jsx-filename-extension": [2, { "extensions": [".js", ".jsx"] }],
"react/prefer-stateless-function": 1, // Component should be written as a pure function
},
};
{
"devDependencies": {
"eslint": "^3.18.0",
"eslint-config-airbnb": "^14.1.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jsx-a11y": "^4.0.0",
"eslint-plugin-react": "^6.10.3"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment