forked from microsoft/appcenter-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
98 lines (98 loc) · 2.89 KB
/
.eslintrc.js
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
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
env: {
mocha: true,
node: true,
},
extends: [
"plugin:prettier/recommended", // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
plugins: ["@typescript-eslint", "security"],
parserOptions: {
project: "./tsconfig.json",
tsconfigRootDir: __dirname,
ecmaVersion: 2018,
sourceType: "module",
},
reportUnusedDisableDirectives: true,
rules: {
// Only the latest loaded 'instance' of a rule counts. If ESLint encounters a rule twice, the later one completely overrides the
// earlier one.This includes rules with array parameters. Load order:
//
// - extends, left to right
// - rules, top to bottom
//
// Hence, any "extensions" to rules like no-restricted-properties by services extending this package are not possible: they will
// undo the rule set here.
//
// Please keep sorted alphabetically to avoid confusion due to rules occurring multiple times.
"@typescript-eslint/no-array-constructor": "error",
//"@typescript-eslint/no-floating-promises": ["error", { ignoreVoid: true }],
//"@typescript-eslint/prefer-for-of": "error",
curly: "error",
eqeqeq: ["error", "always", { null: "ignore" }],
"eol-last": "error",
"no-caller": "error",
"no-debugger": "error",
"no-delete-var": "error",
"no-empty": "error",
"no-eval": "error",
"no-new-func": "error",
"no-new-wrappers": "error",
"no-octal": "error",
"no-octal-escape": "error",
"no-redeclare": "off",
"no-restricted-properties": [
2,
{
object: "_",
property: "assign",
},
{
object: "_",
property: "concat",
},
{
object: "_",
property: "extend",
},
{
object: "Math",
property: "random",
message: "Use crypto.randomBytes() or window.crypto.getRandomValues() instead.",
},
],
"no-restricted-syntax": [
"error",
{
selector: "CallExpression[callee.name='execScript']",
message: "Do not use the execScript functions",
},
],
"no-unsafe-finally": "error",
"no-unused-labels": "error",
"@typescript-eslint/no-unused-expressions": ["error", { allowShortCircuit: false, allowTernary: true }],
"no-var": "error",
"prefer-const": "error",
radix: "error",
"security/detect-non-literal-require": "error",
"security/detect-possible-timing-attacks": "error",
"prettier/prettier": [
"error",
{
endOfLine: "auto",
},
],
},
overrides: [
{
files: ["test/**/*"],
rules: {
"@typescript-eslint/no-unused-expressions": "off",
"@typescript-eslint/no-redeclare": "error",
},
},
],
};