Skip to content

Commit 2571c37

Browse files
fix(eslint-config): replace gts with prettier and eslint (open-telemetry#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 <[email protected]>
1 parent 2d8e2b8 commit 2571c37

File tree

59 files changed

+55
-85
lines changed

Some content is hidden

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

59 files changed

+55
-85
lines changed

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

-1
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

-1
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

-1
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

-1
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

+1-1
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

-1
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

-1
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

+41-27
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

-1
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

-1
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",

package.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,15 @@
5050
"@typescript-eslint/parser": "5.8.1",
5151
"eslint": "8.7.0",
5252
"eslint-config-airbnb-base": "15.0.0",
53+
"eslint-config-prettier": "8.8.0",
5354
"eslint-plugin-header": "3.1.1",
54-
"eslint-plugin-import": "2.25.4",
55-
"gts": "3.1.0",
55+
"eslint-plugin-import": "2.27.5",
56+
"eslint-plugin-node": "11.1.0",
57+
"eslint-plugin-prettier": "4.2.1",
5658
"husky": "7.0.4",
5759
"lerna": "5.5.2",
5860
"lerna-changelog": "2.2.0",
61+
"prettier": "2.8.7",
5962
"typescript": "4.4.4"
6063
},
6164
"changelog": {

packages/opentelemetry-host-metrics/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
"@types/mocha": "8.2.3",
5151
"@types/node": "18.11.7",
5252
"@types/sinon": "10.0.2",
53-
"gts": "3.1.0",
5453
"mocha": "7.2.0",
5554
"nyc": "15.1.0",
5655
"rimraf": "4.2.0",

packages/opentelemetry-id-generator-aws-xray/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
"@types/node": "18.11.7",
6060
"@types/sinon": "10.0.2",
6161
"@types/webpack-env": "1.16.2",
62-
"gts": "3.1.0",
6362
"@jsdevtools/coverage-istanbul-loader": "3.0.5",
6463
"karma": "6.3.16",
6564
"karma-chrome-launcher": "^3.1.1",

packages/opentelemetry-propagation-utils/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
"@types/node": "18.11.7",
5151
"@types/sinon": "^10.0.11",
5252
"expect": "29.2.0",
53-
"gts": "3.1.0",
5453
"mocha": "7.2.0",
5554
"nyc": "15.1.0",
5655
"sinon": "15.0.1",

packages/opentelemetry-redis-common/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
"devDependencies": {
4242
"@types/mocha": "^9.1.1",
4343
"@types/node": "18.11.7",
44-
"gts": "3.1.0",
4544
"mocha": "7.2.0",
4645
"nyc": "15.1.0",
4746
"ts-mocha": "10.0.0",

packages/opentelemetry-test-utils/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
"devDependencies": {
4444
"@opentelemetry/api": "^1.3.0",
4545
"@types/node": "18.11.7",
46-
"gts": "3.1.0",
4746
"typescript": "4.4.4"
4847
},
4948
"dependencies": {

plugins/node/instrumentation-amqplib/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
"mocha": "7.2.0",
6565
"ts-mocha": "10.0.0",
6666
"nyc": "15.1.0",
67-
"gts": "3.1.0",
6867
"sinon": "15.0.1",
6968
"test-all-versions": "5.0.1",
7069
"typescript": "4.4.4"

plugins/node/instrumentation-dataloader/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
"@types/mocha": "7.0.2",
5454
"@types/node": "18.11.7",
5555
"dataloader": "2.2.1",
56-
"gts": "3.1.0",
5756
"mocha": "7.2.0",
5857
"nyc": "15.1.0",
5958
"rimraf": "4.2.0",

plugins/node/instrumentation-fs/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
"@types/mocha": "7.0.2",
5151
"@types/node": "18.11.7",
5252
"@types/sinon": "^10.0.11",
53-
"gts": "3.1.0",
5453
"mocha": "7.2.0",
5554
"nyc": "15.1.0",
5655
"rimraf": "4.2.0",

plugins/node/instrumentation-lru-memoizer/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
"@types/mocha": "8.2.3",
4949
"@types/node": "18.11.7",
5050
"expect": "29.2.0",
51-
"gts": "3.1.0",
5251
"lru-memoizer": "2.1.4",
5352
"mocha": "7.2.0",
5453
"nyc": "15.1.0",

plugins/node/instrumentation-mongoose/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
"@types/mocha": "8.2.3",
5252
"@types/node": "18.11.7",
5353
"expect": "29.2.0",
54-
"gts": "3.1.0",
5554
"mocha": "7.2.0",
5655
"mongoose": "6.5.2",
5756
"nyc": "15.1.0",

plugins/node/instrumentation-socket.io/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
"@types/mocha": "8.2.3",
4949
"@types/node": "18.11.7",
5050
"expect": "27.4.2",
51-
"gts": "3.1.0",
5251
"mocha": "7.2.0",
5352
"nyc": "15.1.0",
5453
"rimraf": "4.2.0",

plugins/node/instrumentation-tedious/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
"@opentelemetry/sdk-trace-base": "^1.8.0",
5454
"@types/mocha": "7.0.2",
5555
"@types/node": "18.11.7",
56-
"gts": "3.1.0",
5756
"mocha": "7.2.0",
5857
"nyc": "15.1.0",
5958
"rimraf": "4.2.0",

plugins/node/opentelemetry-instrumentation-aws-lambda/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
"@opentelemetry/sdk-metrics": "^1.8.0",
5353
"@types/mocha": "7.0.2",
5454
"@types/node": "18.11.7",
55-
"gts": "3.1.0",
5655
"mocha": "7.2.0",
5756
"nyc": "15.1.0",
5857
"rimraf": "4.2.0",

plugins/node/opentelemetry-instrumentation-aws-sdk/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
"aws-sdk": "2.1008.0",
6868
"eslint": "8.7.0",
6969
"expect": "29.2.0",
70-
"gts": "3.1.0",
7170
"mocha": "7.2.0",
7271
"nock": "13.2.1",
7372
"nyc": "15.1.0",

plugins/node/opentelemetry-instrumentation-bunyan/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
"@types/node": "18.11.7",
5656
"@types/sinon": "10.0.2",
5757
"bunyan": "1.8.15",
58-
"gts": "3.1.0",
5958
"mocha": "7.2.0",
6059
"nyc": "15.1.0",
6160
"rimraf": "4.2.0",

plugins/node/opentelemetry-instrumentation-cassandra/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
"@types/semver": "7.3.8",
5757
"@types/sinon": "10.0.2",
5858
"cassandra-driver": "4.6.3",
59-
"gts": "3.1.0",
6059
"mocha": "7.2.0",
6160
"nyc": "15.1.0",
6261
"rimraf": "4.2.0",

plugins/node/opentelemetry-instrumentation-connect/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
"@types/mocha": "7.0.2",
5252
"@types/node": "18.11.7",
5353
"connect": "3.7.0",
54-
"gts": "3.1.0",
5554
"mocha": "7.2.0",
5655
"nyc": "15.1.0",
5756
"rimraf": "4.2.0",

plugins/node/opentelemetry-instrumentation-dns/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
"@types/semver": "7.3.8",
5555
"@types/shimmer": "1.0.2",
5656
"@types/sinon": "10.0.2",
57-
"gts": "3.1.0",
5857
"mocha": "7.2.0",
5958
"nyc": "15.1.0",
6059
"rimraf": "4.2.0",

plugins/node/opentelemetry-instrumentation-express/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
"@types/node": "18.11.7",
5757
"@types/sinon": "10.0.9",
5858
"express": "4.17.3",
59-
"gts": "3.1.0",
6059
"mocha": "7.2.0",
6160
"nyc": "15.1.0",
6261
"rimraf": "4.2.0",

plugins/node/opentelemetry-instrumentation-fastify/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
"@types/mocha": "7.0.2",
5656
"@types/node": "18.11.7",
5757
"fastify": "^4.5.3",
58-
"gts": "3.1.0",
5958
"mocha": "7.2.0",
6059
"nyc": "15.1.0",
6160
"rimraf": "4.2.0",

plugins/node/opentelemetry-instrumentation-generic-pool/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
"@types/node": "18.11.7",
5454
"@types/semver": "7.3.8",
5555
"generic-pool": "3.8.2",
56-
"gts": "3.1.0",
5756
"mocha": "7.2.0",
5857
"nyc": "15.1.0",
5958
"rimraf": "4.2.0",

plugins/node/opentelemetry-instrumentation-graphql/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
"@types/mocha": "8.2.3",
5454
"@types/node": "18.11.7",
5555
"graphql": "^16.5.0",
56-
"gts": "3.1.0",
5756
"mocha": "7.2.0",
5857
"nyc": "15.1.0",
5958
"rimraf": "4.2.0",

plugins/node/opentelemetry-instrumentation-hapi/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
"@opentelemetry/sdk-trace-node": "^1.8.0",
5353
"@types/mocha": "7.0.2",
5454
"@types/node": "18.11.7",
55-
"gts": "3.1.0",
5655
"mocha": "7.2.0",
5756
"nyc": "15.1.0",
5857
"rimraf": "4.2.0",

plugins/node/opentelemetry-instrumentation-ioredis/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
"@types/node": "18.11.7",
6161
"cross-env": "7.0.3",
6262
"ioredis": "5.2.2",
63-
"gts": "3.1.0",
6463
"mocha": "7.2.0",
6564
"nyc": "15.1.0",
6665
"rimraf": "4.2.0",

plugins/node/opentelemetry-instrumentation-knex/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
"@opentelemetry/sdk-trace-node": "^1.8.0",
5252
"@types/mocha": "7.0.2",
5353
"@types/node": "18.11.7",
54-
"gts": "3.1.0",
5554
"knex": "0.95.9",
5655
"mocha": "7.2.0",
5756
"nyc": "15.1.0",

plugins/node/opentelemetry-instrumentation-koa/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
"@types/mocha": "7.0.2",
5858
"@types/node": "18.11.7",
5959
"@types/sinon": "10.0.9",
60-
"gts": "3.1.0",
6160
"koa": "2.13.1",
6261
"mocha": "7.2.0",
6362
"nyc": "15.1.0",

plugins/node/opentelemetry-instrumentation-memcached/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
"@types/mocha": "7.0.2",
5656
"@types/node": "18.11.7",
5757
"cross-env": "7.0.3",
58-
"gts": "3.1.0",
5958
"memcached": "2.2.2",
6059
"mocha": "7.2.0",
6160
"nyc": "15.1.0",

0 commit comments

Comments
 (0)