|
2 | 2 | // ╔═╗╔═╗╦ ╦╔╗╔╔╦╗┬─┐┌─┐
|
3 | 3 | // ║╣ ╚═╗║ ║║║║ ║ ├┬┘│
|
4 | 4 | // o╚═╝╚═╝╩═╝╩╝╚╝ ╩ ┴└─└─┘
|
5 |
| - // A set of basic conventions designed to complement the .jshintrc file. |
| 5 | + // A set of basic conventions (similar to .jshintrc) for use within any |
| 6 | + // arbitrary JavaScript / Node.js package -- inside or outside Sails.js. |
6 | 7 | // For the master copy of this file, see the `.eslintrc` template file in
|
7 | 8 | // the `sails-generate` package (https://www.npmjs.com/package/sails-generate.)
|
| 9 | + // Designed for ESLint v4. |
| 10 | + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| 11 | + // For more information about any of the rules below, check out the relevant |
| 12 | + // reference page on eslint.org. For example, to get details on "no-sequences", |
| 13 | + // you would visit `http://eslint.org/docs/rules/no-sequences`. If you're unsure |
| 14 | + // or could use some advice, come by https://sailsjs.com/support. |
| 15 | + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| 16 | + |
8 | 17 | "env": {
|
9 |
| - "node": true, |
10 |
| - "mocha": true |
| 18 | + "node": true |
11 | 19 | },
|
| 20 | + |
| 21 | + "parserOptions": { |
| 22 | + "ecmaVersion": 5 |
| 23 | + // ^^This can be changed to `8` if this package doesn't need to support <= Node v6. |
| 24 | + }, |
| 25 | + |
| 26 | + "globals": { |
| 27 | + "Promise": true |
| 28 | + // ^^Available since Node v4 |
| 29 | + }, |
| 30 | + |
12 | 31 | "rules": {
|
13 |
| - "callback-return": [2, ["callback", "cb", "next", "done", "proceed"]], |
14 |
| - "camelcase": [2, {"properties": "always"}], |
15 |
| - "comma-style": [2, "last"], |
16 |
| - "curly": [2], |
17 |
| - "eqeqeq": [1, "smart"], |
18 |
| - "eol-last": [2], |
19 |
| - "handle-callback-err": [2], |
20 |
| - "indent": [2, 2, {"SwitchCase": 1}], |
21 |
| - "linebreak-style": [2, "unix"], |
22 |
| - "no-mixed-spaces-and-tabs": [2, "smart-tabs"], |
23 |
| - "no-return-assign": [2, "always"], |
24 |
| - "no-sequences": [2], |
25 |
| - "no-trailing-spaces": [2], |
26 |
| - "no-undef": [2], |
27 |
| - "no-unexpected-multiline": [1], |
28 |
| - "no-unused-vars": [2], |
29 |
| - "one-var": [2, "never"], |
30 |
| - "semi": [1, "always"] |
| 32 | + "callback-return": ["error", ["done", "proceed", "next", "onwards", "callback", "cb"]], |
| 33 | + "camelcase": ["warn", {"properties": "always"}], |
| 34 | + "comma-style": ["warn", "last"], |
| 35 | + "curly": ["error"], |
| 36 | + "eqeqeq": ["error", "always"], |
| 37 | + "eol-last": ["warn"], |
| 38 | + "handle-callback-err": ["error"], |
| 39 | + "indent": ["warn", 2, { |
| 40 | + "SwitchCase": 1, |
| 41 | + "MemberExpression": "off", |
| 42 | + "FunctionDeclaration": {"body":1, "parameters": "off"}, |
| 43 | + "FunctionExpression": {"body":1, "parameters": "off"}, |
| 44 | + "CallExpression": {"arguments":"off"}, |
| 45 | + "ArrayExpression": 1, |
| 46 | + "ObjectExpression": 1, |
| 47 | + "ignoredNodes": ["ConditionalExpression"] |
| 48 | + }], |
| 49 | + "linebreak-style": ["error", "unix"], |
| 50 | + "no-dupe-keys": ["error"], |
| 51 | + "no-duplicate-case": ["error"], |
| 52 | + "no-extra-semi": ["warn"], |
| 53 | + "no-labels": ["error"], |
| 54 | + "no-mixed-spaces-and-tabs": ["error", "smart-tabs"], |
| 55 | + "no-redeclare": ["warn"], |
| 56 | + "no-return-assign": ["error", "always"], |
| 57 | + "no-sequences": ["error"], |
| 58 | + "no-trailing-spaces": ["warn"], |
| 59 | + "no-undef": ["error"], |
| 60 | + "no-unexpected-multiline": ["warn"], |
| 61 | + "no-unreachable": ["warn"], |
| 62 | + "no-unused-vars": ["warn", {"caughtErrors":"all", "caughtErrorsIgnorePattern": "^unused($|[A-Z].*$)"}], |
| 63 | + "no-use-before-define": ["error", {"functions":false}], |
| 64 | + "one-var": ["warn", "never"], |
| 65 | + "quotes": ["warn", "single", {"avoidEscape":false, "allowTemplateLiterals":true}], |
| 66 | + "semi": ["error", "always"], |
| 67 | + "semi-spacing": ["warn", {"before":false, "after":true}], |
| 68 | + "semi-style": ["warn", "last"] |
31 | 69 | }
|
| 70 | + |
32 | 71 | }
|
0 commit comments