|
| 1 | +# vim: syntax=yaml |
| 2 | + |
| 3 | +# |
| 4 | +# List of very light restrictions designed to prevent obvious errors, |
| 5 | +# not impose our own code style upon other contributors. |
| 6 | +# |
| 7 | +# This is supposed to be used with `eslint --reset` |
| 8 | +# |
| 9 | +# Created to work with eslint@0.18.0 |
| 10 | +# |
| 11 | + |
| 12 | +extends: ["eslint:recommended", "google"] |
| 13 | + |
| 14 | +env: |
| 15 | + node: true |
| 16 | + browser: true |
| 17 | + es6: true |
| 18 | + mocha: true |
| 19 | + |
| 20 | +parserOptions: |
| 21 | + sourceType: "module" |
| 22 | + ecmaVersion: 8 |
| 23 | + ecmaFeatures: |
| 24 | + modules: true |
| 25 | + |
| 26 | +rules: |
| 27 | + # useful to have in node.js, |
| 28 | + # if you're sure you don't need to handle error, rename it to "_err" |
| 29 | + handle-callback-err: 2 |
| 30 | + |
| 31 | + padded-blocks: 0 |
| 32 | + |
| 33 | + # just to make sure we don't forget to remove them when releasing |
| 34 | + no-debugger: 2 |
| 35 | + |
| 36 | + # add "falls through" for those |
| 37 | + no-fallthrough: 2 |
| 38 | + |
| 39 | + # enforce use curly always |
| 40 | + # curly: 1 |
| 41 | + |
| 42 | + # just warnings about whitespace weirdness here |
| 43 | + eol-last: 1 |
| 44 | + no-irregular-whitespace: 1 |
| 45 | + no-mixed-spaces-and-tabs: [1, smart-tabs] |
| 46 | + no-trailing-spaces: 1 |
| 47 | + |
| 48 | + # probably always an error, tell me if it's not |
| 49 | + no-new-require: 2 |
| 50 | + |
| 51 | + # single most important rule here, without it linting won't even |
| 52 | + # make any sense |
| 53 | + no-undef: 2 |
| 54 | + |
| 55 | + # in practice, those are always errors |
| 56 | + no-unreachable: 2 |
| 57 | + |
| 58 | + # useful for code clean-up |
| 59 | + no-unused-vars: [2, {"vars": "all", "args": "none"}] |
| 60 | + |
| 61 | + max-len: [1, 160] |
| 62 | + |
| 63 | + # camelcase is standard, but this should be 1 and then 2 soon |
| 64 | + camelcase: 0 |
| 65 | + |
| 66 | + # jsdoc is mandatory |
| 67 | + require-jsdoc: 0 |
| 68 | + valid-jsdoc: 0 |
| 69 | + |
| 70 | + # this feature is cool but not supported by Node 4, disable via comments |
| 71 | + prefer-spread: 1 |
| 72 | + prefer-rest-params: 1 |
| 73 | + |
| 74 | + # encorage use es6 |
| 75 | + no-var: 2 |
| 76 | + |
| 77 | + # configuration that should be upgraded progresivelly |
| 78 | + no-constant-condition: 2 |
| 79 | + no-empty: 2 |
| 80 | + |
| 81 | + # loop over objects http://eslint.org/docs/rules/guard-for-in |
| 82 | + guard-for-in: 2 |
| 83 | + |
| 84 | + # this must be used within classes |
| 85 | + no-invalid-this: 2 |
| 86 | + |
| 87 | + # All object must be uppercase |
| 88 | + new-cap: 2 |
| 89 | + |
| 90 | + # readbility is important, no multiple inline declarations |
| 91 | + one-var: 2 |
| 92 | + |
| 93 | + # console not allowed unless for testing |
| 94 | + no-console: [2, {"allow": ["log", "warn"]}] |
0 commit comments