|
1 | 1 | module.exports = {
|
2 |
| - "env": { |
3 |
| - "mocha": true, |
4 |
| - "commonjs": true, |
5 |
| - "shared-node-browser": true |
6 |
| - }, |
7 |
| - plugins: [ |
8 |
| - "@typescript-eslint", |
9 |
| - "header" |
| 2 | + plugins: [ |
| 3 | + "@typescript-eslint", |
| 4 | + "header", |
| 5 | + "node" |
| 6 | + ], |
| 7 | + extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"], |
| 8 | + parser: "@typescript-eslint/parser", |
| 9 | + parserOptions: { |
| 10 | + "project": "./tsconfig.json" |
| 11 | + }, |
| 12 | + rules: { |
| 13 | + "quotes": [2, "single", { "avoidEscape": true }], |
| 14 | + "@typescript-eslint/no-floating-promises": 2, |
| 15 | + "@typescript-eslint/no-this-alias": "off", |
| 16 | + "brace-style": ["error", "1tbs"], |
| 17 | + "eqeqeq": [ |
| 18 | + "error", |
| 19 | + "smart" |
10 | 20 | ],
|
11 |
| - extends: [ |
12 |
| - "./node_modules/gts", |
| 21 | + "prefer-rest-params": "off", |
| 22 | + "@typescript-eslint/naming-convention": [ |
| 23 | + "error", |
| 24 | + { |
| 25 | + "selector": "memberLike", |
| 26 | + "modifiers": ["private", "protected"], |
| 27 | + "format": ["camelCase"], |
| 28 | + "leadingUnderscore": "require" |
| 29 | + } |
13 | 30 | ],
|
14 |
| - parser: "@typescript-eslint/parser", |
15 |
| - parserOptions: { |
16 |
| - "project": [ |
17 |
| - "./tsconfig.json" |
18 |
| - ] |
19 |
| - }, |
20 |
| - ignorePatterns: [ |
21 |
| - 'build', |
22 |
| - ], |
23 |
| - rules: { |
24 |
| - "@typescript-eslint/no-this-alias": "off", |
25 |
| - "eqeqeq": [ |
26 |
| - "error", |
27 |
| - "smart" |
28 |
| - ], |
29 |
| - "prefer-rest-params": "off", |
30 |
| - "@typescript-eslint/naming-convention": [ |
31 |
| - "error", |
32 |
| - { |
33 |
| - "selector": "memberLike", |
34 |
| - "modifiers": ["private", "protected"], |
35 |
| - "format": ["camelCase"], |
36 |
| - "leadingUnderscore": "require" |
37 |
| - } |
38 |
| - ], |
39 |
| - "@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_", "args": "after-used" }], |
40 |
| - "@typescript-eslint/no-inferrable-types": ["error", { ignoreProperties: true }], |
41 |
| - "arrow-parens": ["error", "as-needed"], |
42 |
| - "prettier/prettier": ["error", { "singleQuote": true, "arrowParens": "avoid" }], |
43 |
| - "prefer-spread": "off", |
44 |
| - "node/no-deprecated-api": ["warn"], |
45 |
| - "header/header": [2, "block", [{ |
46 |
| - pattern: / \* Copyright The OpenTelemetry Authors[\r\n]+ \*[\r\n]+ \* Licensed under the Apache License, Version 2\.0 \(the \"License\"\);[\r\n]+ \* you may not use this file except in compliance with the License\.[\r\n]+ \* You may obtain a copy of the License at[\r\n]+ \*[\r\n]+ \* https:\/\/www\.apache\.org\/licenses\/LICENSE-2\.0[\r\n]+ \*[\r\n]+ \* Unless required by applicable law or agreed to in writing, software[\r\n]+ \* distributed under the License is distributed on an \"AS IS\" BASIS,[\r\n]+ \* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.[\r\n]+ \* See the License for the specific language governing permissions and[\r\n]+ \* limitations under the License\./gm, |
47 |
| - template: |
48 |
| - `\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n ` |
49 |
| - }]] |
50 |
| - }, |
51 |
| - overrides: [ |
52 |
| - { |
53 |
| - "files": ["test/**/*.ts"], |
54 |
| - "rules": { |
55 |
| - "no-empty": "off", |
56 |
| - "@typescript-eslint/ban-ts-ignore": "off", |
57 |
| - "@typescript-eslint/no-empty-function": "off", |
58 |
| - "@typescript-eslint/no-explicit-any": "off", |
59 |
| - "@typescript-eslint/no-unused-vars": "off", |
60 |
| - "@typescript-eslint/no-var-requires": "off" |
61 |
| - } |
62 |
| - } |
63 |
| - ] |
64 |
| -} |
| 31 | + "no-console": "error", |
| 32 | + "no-shadow": "off", |
| 33 | + "@typescript-eslint/no-shadow": ["warn"], |
| 34 | + "@typescript-eslint/no-unused-vars": ["error", {"argsIgnorePattern": "^_", "args": "after-used"}], |
| 35 | + "@typescript-eslint/no-inferrable-types": ["error", { ignoreProperties: true }], |
| 36 | + "@typescript-eslint/no-empty-function": ["off"], |
| 37 | + "@typescript-eslint/ban-types": ["warn", { |
| 38 | + "types": { |
| 39 | + "Function": null, |
| 40 | + } |
| 41 | + }], |
| 42 | + "@typescript-eslint/no-shadow": ["warn"], |
| 43 | + "arrow-parens": ["error", "as-needed"], |
| 44 | + "node/no-deprecated-api": ["warn"], |
| 45 | + "header/header": [2, "block", [{ |
| 46 | + pattern: / \* Copyright The OpenTelemetry Authors[\r\n]+ \*[\r\n]+ \* Licensed under the Apache License, Version 2\.0 \(the \"License\"\);[\r\n]+ \* you may not use this file except in compliance with the License\.[\r\n]+ \* You may obtain a copy of the License at[\r\n]+ \*[\r\n]+ \* https:\/\/www\.apache\.org\/licenses\/LICENSE-2\.0[\r\n]+ \*[\r\n]+ \* Unless required by applicable law or agreed to in writing, software[\r\n]+ \* distributed under the License is distributed on an \"AS IS\" BASIS,[\r\n]+ \* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.[\r\n]+ \* See the License for the specific language governing permissions and[\r\n]+ \* limitations under the License\./gm, |
| 47 | + template: |
| 48 | + `\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n ` |
| 49 | + }]] |
| 50 | + }, |
| 51 | + overrides: [ |
| 52 | + { |
| 53 | + "files": ["test/**/*.ts"], |
| 54 | + "rules": { |
| 55 | + "no-empty": "off", |
| 56 | + "@typescript-eslint/ban-ts-ignore": "off", |
| 57 | + "@typescript-eslint/no-empty-function": "off", |
| 58 | + "@typescript-eslint/no-explicit-any": "off", |
| 59 | + "@typescript-eslint/no-floating-promises": 1, |
| 60 | + "@typescript-eslint/no-unused-vars": "off", |
| 61 | + "@typescript-eslint/no-var-requires": "off", |
| 62 | + "@typescript-eslint/no-shadow": ["off"], |
| 63 | + "@typescript-eslint/no-floating-promises": ["off"], |
| 64 | + "@typescript-eslint/no-non-null-assertion": ["off"], |
| 65 | + "@typescript-eslint/explicit-module-boundary-types": ["off"] |
| 66 | + } |
| 67 | + } |
| 68 | + ] |
| 69 | +}; |
0 commit comments