Skip to content

Commit 2571c37

Browse files
fix(eslint-config): replace gts with prettier and eslint (#1439)
* fix(eslint-config): replace gts with prettier and eslint recommended config * fix(eslint-config): using the core repo's configuration --------- Co-authored-by: Haddas Bronfman <85441461+haddasbronfman@users.noreply.github.com>
1 parent 2d8e2b8 commit 2571c37

59 files changed

Lines changed: 55 additions & 85 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

archive/opentelemetry-browser-extension-autoinjection/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
"eslint-plugin-header": "3.1.1",
4545
"eslint-plugin-import": "2.25.4",
4646
"eslint-plugin-json5": "0.1.4",
47-
"gts": "3.1.0",
4847
"html-webpack-plugin": "5.3.2",
4948
"jimp": "0.16.1",
5049
"jsdom": "15.2.1",

detectors/node/opentelemetry-resource-detector-alibaba-cloud/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
"@types/mocha": "8.2.3",
4848
"@types/node": "18.11.7",
4949
"@types/sinon": "10.0.2",
50-
"gts": "3.1.0",
5150
"mocha": "7.2.0",
5251
"nock": "12.0.3",
5352
"nyc": "15.1.0",

detectors/node/opentelemetry-resource-detector-aws/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
"@types/mocha": "8.2.3",
4747
"@types/node": "18.11.7",
4848
"@types/sinon": "10.0.2",
49-
"gts": "3.1.0",
5049
"mocha": "7.2.0",
5150
"nock": "12.0.3",
5251
"nyc": "15.1.0",

detectors/node/opentelemetry-resource-detector-container/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
"@types/node": "^18.0.0",
4242
"@types/sinon": "10.0.2",
4343
"eslint-plugin-header": "^3.1.1",
44-
"gts": "^3.1.0",
4544
"mocha": "7.2.0",
4645
"nock": "12.0.3",
4746
"nyc": "15.1.0",

detectors/node/opentelemetry-resource-detector-gcp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"@opentelemetry/contrib-test-utils": "^0.33.2",
4646
"@types/mocha": "8.2.3",
4747
"@types/node": "18.11.7",
48-
"gts": "3.1.0",
48+
"@types/semver": "7.3.8",
4949
"mocha": "7.2.0",
5050
"nock": "12.0.3",
5151
"nyc": "15.1.0",

detectors/node/opentelemetry-resource-detector-github/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
"@types/mocha": "8.2.3",
5050
"@types/node": "18.11.7",
5151
"@types/sinon": "10.0.2",
52-
"gts": "3.1.0",
5352
"mocha": "7.2.0",
5453
"nyc": "15.1.0",
5554
"rimraf": "4.2.0",

detectors/node/opentelemetry-resource-detector-instana/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
"@types/semver": "7.3.8",
4848
"mocha": "7.2.0",
4949
"nock": "12.0.3",
50-
"gts": "3.1.0",
5150
"nyc": "15.1.0",
5251
"rimraf": "4.2.0",
5352
"ts-mocha": "10.0.0",

eslint.config.js

Lines changed: 41 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,64 @@ module.exports = {
22
plugins: [
33
"@typescript-eslint",
44
"header",
5-
"import"
6-
],
7-
extends: [
8-
"./node_modules/gts",
5+
"node",
6+
"prettier"
97
],
8+
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"],
109
parser: "@typescript-eslint/parser",
1110
parserOptions: {
12-
"project": "./tsconfig.json"
11+
"project": "./tsconfig.json"
1312
},
1413
rules: {
15-
"quotes": [2, "single", { "avoidEscape": true }],
16-
"@typescript-eslint/no-this-alias": "off",
14+
"quotes": ["error", "single", { "avoidEscape": true }],
1715
"eqeqeq": "off",
1816
"prefer-rest-params": "off",
19-
"@typescript-eslint/naming-convention": [
20-
"error",
21-
{
22-
"selector": "memberLike",
23-
"modifiers": ["private", "protected"],
24-
"format": ["camelCase"],
25-
"leadingUnderscore": "require"
26-
}
27-
],
28-
"@typescript-eslint/no-inferrable-types": ["error", { ignoreProperties: true }],
29-
"arrow-parens": ["error", "as-needed"],
30-
"prettier/prettier": ["error", { "singleQuote": true, "arrowParens": "avoid" }],
17+
"no-shadow": "off",
3118
"node/no-deprecated-api": ["warn"],
32-
"header/header": [2, "block", [{
33-
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,
34-
template:
19+
"header/header": ["error", "block", [{
20+
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,
21+
template:
3522
`\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 `
36-
}]],
37-
"import/no-extraneous-dependencies": ["error", { devDependencies: ["test/**/*.ts"] }],
23+
}]]
3824
},
3925
overrides: [
4026
{
41-
"files": ["test/**/*.ts"],
42-
"rules": {
27+
files: ['*.ts'],
28+
rules: {
29+
"@typescript-eslint/no-this-alias": "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-var-requires": "off",
40+
"@typescript-eslint/no-inferrable-types": ["error", { ignoreProperties: true }],
41+
"@typescript-eslint/no-empty-function": ["off"],
42+
"@typescript-eslint/ban-types": ["warn", {
43+
"types": {
44+
"Function": null,
45+
}
46+
}],
47+
"@typescript-eslint/no-shadow": ["warn"],
48+
}
49+
},
50+
{
51+
files: ["test/**/*.ts"],
52+
rules: {
4353
"no-empty": "off",
4454
"@typescript-eslint/ban-ts-ignore": "off",
4555
"@typescript-eslint/no-empty-function": "off",
4656
"@typescript-eslint/no-explicit-any": "off",
4757
"@typescript-eslint/no-unused-vars": "off",
48-
"@typescript-eslint/no-var-requires": "off"
58+
"@typescript-eslint/no-var-requires": "off",
59+
"@typescript-eslint/no-shadow": ["off"],
60+
"@typescript-eslint/no-floating-promises": ["off"],
61+
"@typescript-eslint/no-non-null-assertion": ["off"],
62+
"@typescript-eslint/explicit-module-boundary-types": ["off"]
4963
}
5064
}
5165
]

metapackages/auto-instrumentations-node/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
"@types/mocha": "7.0.2",
4242
"@types/node": "18.11.7",
4343
"@types/sinon": "10.0.2",
44-
"gts": "3.1.0",
4544
"mocha": "7.2.0",
4645
"nyc": "15.1.0",
4746
"rimraf": "4.2.0",

metapackages/auto-instrumentations-web/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
"@types/sinon": "10.0.2",
4141
"@types/webpack-env": "1.16.2",
4242
"babel-loader": "8.2.2",
43-
"gts": "3.1.0",
4443
"@jsdevtools/coverage-istanbul-loader": "3.0.5",
4544
"karma": "6.3.16",
4645
"karma-chrome-launcher": "^3.1.1",

0 commit comments

Comments
 (0)