|
| 1 | +{ |
| 2 | + // To minimize dependencies on Node- or browser-specific features, leave the |
| 3 | + // env empty, and instead define globals as needed. |
| 4 | + "env": {}, |
| 5 | + |
| 6 | + // Project-wide globals. If other globals are necessary, prefer putting them |
| 7 | + // in a comment at the top of the file rather than adding them here. |
| 8 | + "globals": { |
| 9 | + "console": true, |
| 10 | + "module": true, |
| 11 | + "require": true, |
| 12 | + }, |
| 13 | + "rules": { |
| 14 | + // Enforce "one true brace style", allowing start and end braces to be |
| 15 | + // on the same line. |
| 16 | + "brace-style": [2, "1tbs", {"allowSingleLine": true}], |
| 17 | + |
| 18 | + // Enforce the name 'self' when assigning `this` to a local variable. |
| 19 | + "consistent-this": [0, "self"], |
| 20 | + |
| 21 | + // Enforce two-space indentation. |
| 22 | + "indent": [2, 2, {indentSwitchCase: true}], |
| 23 | + |
| 24 | + // Enforce the use of strict mode at the file level. |
| 25 | + "global-strict": [2, "always"], |
| 26 | + |
| 27 | + // Allow things like `while(true)`. |
| 28 | + "no-constant-condition": 0, |
| 29 | + |
| 30 | + // Allow variable shadowing. |
| 31 | + "no-shadow": 0, |
| 32 | + |
| 33 | + // Restrict what kind of objects can be used with 'throw'. |
| 34 | + "no-throw-literal": 2, |
| 35 | + |
| 36 | + // Allow identifiers with leading or trailing underscores. |
| 37 | + "no-underscore-dangle": 0, |
| 38 | + |
| 39 | + // Allow unused parameters, but not unused variables. |
| 40 | + "no-unused-vars": [2, {"vars": "all", "args": "none"}], |
| 41 | + |
| 42 | + // Allow functions to be used before they are defined. |
| 43 | + "no-use-before-define": [2, "nofunc"], |
| 44 | + |
| 45 | + // Use single quotes, except when escaping would be necessary. |
| 46 | + "quotes": [2, "single", "avoid-escape"], |
| 47 | + |
| 48 | + // Force IIFEs to be wrapped in parentheses. |
| 49 | + "wrap-iife": [2, "inside"], |
| 50 | + |
| 51 | + "yoda": [2, "never", {"exceptRange": true}] |
| 52 | + } |
| 53 | +} |
0 commit comments