-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
azure-sdk-base.ts
127 lines (126 loc) · 4.53 KB
/
azure-sdk-base.ts
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
export default {
parser: "@typescript-eslint/parser",
parserOptions: {
project: [
"./tsconfig.json",
"../../../common/tools/eslint-plugin-azure-sdk/tsconfig.lintjson.json"
],
sourceType: "module",
extraFileExtensions: [".json"]
},
plugins: ["@typescript-eslint", "no-only-tests", "promise", "eslint-plugin-tsdoc", "import"],
extends: [
"plugin:@typescript-eslint/recommended",
"eslint:recommended",
"plugin:promise/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"prettier",
"prettier/@typescript-eslint",
"plugin:@azure/azure-sdk/recommended"
],
env: {
mocha: true
},
ignorePatterns: ["**/generated/**"],
rules: {
curly: ["error", "multi-line"],
"eol-last": ["error", "always"],
eqeqeq: ["error", "always", { null: "ignore" }],
"import/no-extraneous-dependencies": [
"error",
{
devDependencies: ["test/**/*.ts", "samples/**", "**/karma.conf.js", "**/.eslintrc.js"],
optionalDependencies: false,
peerDependencies: false
}
],
"no-console": "off",
"no-dupe-class-members": "off",
"no-invalid-this": "off",
"no-empty": "error",
"no-fallthrough": "error",
"@typescript-eslint/no-invalid-this": "error",
"@typescript-eslint/no-require-imports": "error",
"no-restricted-imports": ["error", { paths: ["rhea", "rhea/.*"] }],
"no-return-await": "error",
"no-undef": "off",
"no-unsafe-finally": "error",
"no-unused-vars": "off",
"no-unused-expressions": "error",
"no-useless-constructor": "off",
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": ["error", { functions: false, classes: false }],
"no-var": "error",
"one-var-declaration-per-line": "error",
"prefer-const": "error",
"spaced-comment": ["error", "always", { markers: ["/"] }],
"space-infix-ops": ["error", { int32Hint: false }],
"use-isnan": "error",
"no-only-tests/no-only-tests": "error",
"@typescript-eslint/explicit-module-boundary-types": ["error"],
"no-redeclare": "off",
"@typescript-eslint/no-redeclare": ["error", { builtinGlobals: true }],
"@typescript-eslint/camelcase": "off",
"@typescript-eslint/naming-convention": [
"error",
{ selector: "default", format: null },
{ selector: ["class", "interface"], format: ["PascalCase"] },
{
selector: "interface",
format: ["PascalCase"],
custom: {
regex: "^I[A-Z]",
match: false
}
}
],
"@typescript-eslint/no-angle-bracket-type-assertion": "off",
"@typescript-eslint/no-array-constructor": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-function-return-type": [
"warn",
{ allowExpressions: true, allowTypedFunctionExpressions: true }
],
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/no-inferrable-types": "off",
// We use empty extends and empty interface for shimming and renaming extensively
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
"@typescript-eslint/no-useless-constructor": "error",
"@typescript-eslint/no-var-requires": "off",
"no-shadow": "off",
"@typescript-eslint/no-shadow": ["error", { ignoreTypeValueShadow: true }],
// https://github.com/Azure/azure-sdk-for-js/issues/7608
// "@typescript-eslint/member-ordering": [
// "error",
// {
// default: [
// "instance-method",
// "method",
// "private-instance-method",
// "private-method",
// "private-static-method",
// "protected-instance-method",
// "protected-method",
// "protected-static-method",
// "public-instance-method",
// "public-method",
// "public-static-method",
// "static-method"
// ]
// }
// ],
"@azure/azure-sdk/ts-config-lib": "warn",
// https://github.com/Azure/azure-sdk-for-js/issues/7605
"@azure/azure-sdk/ts-apisurface-supportcancellation": "off",
// https://github.com/Azure/azure-sdk-for-js/issues/7609
"@azure/azure-sdk/ts-pagination-list": "off",
// https://github.com/Azure/azure-sdk-for-js/issues/7610
"@azure/azure-sdk/ts-doc-internal": "off",
"tsdoc/syntax": "error"
}
};