Skip to content

Instantly share code, notes, and snippets.

@A-gambit
Created July 6, 2015 22:43
Show Gist options
  • Save A-gambit/8bb9bbb31ca83c56fa1e to your computer and use it in GitHub Desktop.
Save A-gambit/8bb9bbb31ca83c56fa1e to your computer and use it in GitHub Desktop.
.git/
node_modules/
dist/
// Sublime config instructions:
//
// * start from https://medium.com/@dan_abramov/lint-like-it-s-2015-6987d44c5b48
// * then see https://github.com/yannickcr/eslint-plugin-react
//
// Known to work well with following versions:
//
// * [email protected]
// * [email protected]
// * [email protected]
//
// NOTE you may need `/* eslint no-var: 0, strict: [2, "global"] */` comment for es5 files
// also use `comma-dangle: [2, "never"]` for client side es5 files
//
// Known issues:
// - coma-spacing will be reported for `${a}, b` https://github.com/babel/babel-eslint/issues/31
// - you can escape comma as a workaround: `${a}\, b`
// - `// empty` seems to not work, use `// eslint-disable-line no-empty` instead
// - doesn't understand var usages as jsx tags when used outside of component class
// - use `// eslint-disable-line no-unused-vars`
//
{
"parser": "babel-eslint",
"plugins": [
"react"
],
"ecmaFeatures": {
"jsx": true
},
"env": {
"browser": true,
"node": true
},
"globals": {
"fetch": false, // TODO remove after fixing https://github.com/matthew-andrews/isomorphic-fetch/issues/16
// for tests
"describe": false,
"expect": false,
"it": false
},
"rules": {
// possible errors
"comma-dangle": [2, "always-multiline"], // babel will care of it
// best practices
"eqeqeq": 0,
"no-eval": 0,
"no-self-compare": 2,
"no-unused-expressions": 0, // to allow f && f() constructions
"no-unused-vars": [2, {"vars": "all", "args": "none"}], // args can be provided for information reasons
"no-use-before-define": 0, // NOTE only for old code which doesn't use classes
"wrap-iife": 2,
"yoda": [2, "never"],
// strict mode
"strict": [2, "never"],
// variables
"no-shadow": 0, // to allow shadowing of commonly used vars, e.g. err, cb, etc.
// node.js
"no-process-exit": 0,
// stylistic
"brace-style": [2, "stroustrup", { "allowSingleLine": true }],
"comma-style": [2, "last"],
"eol-last": 2,
"indent": [2, 2],
"new-cap": [2, {newIsCap: true, capIsNew: false}],
"no-lonely-if": 1,
"no-underscore-dangle": 0,
"quotes": [2, "single", "avoid-escape"],
"semi": [2, "never"],
"space-after-keywords": [2, "always"],
"space-before-blocks": [2, "always"],
// es6
"no-var": 2,
// eslint-react-plugin
// see https://github.com/yannickcr/eslint-plugin-react for details
"react/jsx-boolean-value": [2, "never"],
"react/jsx-quotes": [2, "single", "avoid-escape"],
"react/jsx-no-undef": 2,
"react/no-did-mount-set-state": [2, "allow-in-func"],
"react/no-did-update-set-state": 2,
"react/no-unknown-property": 2,
"react/react-in-jsx-scope": 2,
"react/self-closing-comp": 2,
"react/wrap-multilines": 2
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment