-
Notifications
You must be signed in to change notification settings - Fork 16
/
.eslintrc
105 lines (100 loc) · 4.51 KB
/
.eslintrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
{
// ╔═╗╔═╗╦ ╦╔╗╔╔╦╗┬─┐┌─┐
// ║╣ ╚═╗║ ║║║║ ║ ├┬┘│
// o╚═╝╚═╝╩═╝╩╝╚╝ ╩ ┴└─└─┘
// A set of basic code conventions (similar to a .jshintrc file) designed to
// encourage quality and consistency across your Sails app's code base.
// These rules are checked against automatically any time you run `npm test`.
//
// > An additional eslintrc override file is included in the `assets/` folder
// > right out of the box. This is specifically to allow for variations in acceptable
// > global variables between front-end JavaScript code designed to run in the browser
// > vs. backend code designed to run in a Node.js/Sails process.
//
// > Note: If you're using mocha, you'll want to add an extra override file to your
// > `test/` folder so that eslint will tolerate mocha-specific globals like `before`
// > and `describe`.
// Designed for ESLint v4.
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// For more information about any of the rules below, check out the relevant
// reference page on eslint.org. For example, to get details on "no-sequences",
// you would visit `http://eslint.org/docs/rules/no-sequences`. If you're unsure
// or could use some advice, come by https://sailsjs.com/support.
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"extends": ["eslint:recommended", "prettier/@typescript-eslint"],
"env": {
"node": true
},
"parserOptions": {
"ecmaVersion": 9
},
"globals": {
// If "no-undef" is enabled below, be sure to list all global variables that
// are used in this app's backend code (including the globalIds of models):
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"Promise": true,
"sails": true,
"_": true,
"async": true
// …and any others (e.g. `"Organization": true`)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
},
"rules": {
"callback-return": [
"error",
["done", "proceed", "next", "onwards", "callback", "cb"]
],
"comma-style": ["warn", "last"],
"curly": ["error"],
"eqeqeq": ["error", "always"],
"eol-last": ["warn"],
"handle-callback-err": ["error"],
"indent": [
"error",
4,
{
"SwitchCase": 1,
"MemberExpression": "off",
"FunctionDeclaration": { "body": 1, "parameters": "off" },
"FunctionExpression": { "body": 1, "parameters": "off" },
"CallExpression": { "arguments": "off" },
"ArrayExpression": 1,
"ObjectExpression": 1,
"ignoredNodes": ["ConditionalExpression"]
}
],
"linebreak-style": ["error", "unix"],
"no-console": "off",
"no-dupe-keys": ["error"],
"no-duplicate-case": ["error"],
"no-extra-semi": ["error"],
"no-labels": ["error"],
"no-mixed-spaces-and-tabs": [2, "smart-tabs"],
"no-redeclare": ["error"],
"no-return-assign": ["error", "always"],
"no-sequences": ["error"],
"no-trailing-spaces": ["error"],
"no-undef": ["off"],
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// ^^Note: If this "no-undef" rule is enabled (set to `["error"]`), then all model globals
// (e.g. `"Organization": true`) should be included above under "globals".
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"no-unexpected-multiline": ["error"],
"no-unreachable": ["error"],
"no-unused-vars": [
"error",
{
"caughtErrors": "all",
"caughtErrorsIgnorePattern": "^unused($|[A-Z].*$)",
"argsIgnorePattern": "^unused($|[A-Z].*$)",
"varsIgnorePattern": "^unused($|[A-Z].*$)"
}
],
"no-use-before-define": ["error", { "functions": false }],
"one-var": ["error", "never"],
"prefer-arrow-callback": ["error", { "allowNamedFunctions": true }],
"semi": ["error", "always"],
"semi-spacing": ["error", { "before": false, "after": true }],
"semi-style": ["error", "last"]
}
}