Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(eslint-config): replace gts with prettier and eslint #1439

Merged
merged 12 commits into from
May 1, 2023
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"eslint-plugin-header": "3.1.1",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-json5": "0.1.4",
"gts": "3.1.0",
"html-webpack-plugin": "5.3.2",
"jimp": "0.16.1",
"jsdom": "15.2.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
"@types/mocha": "8.2.3",
"@types/node": "18.11.7",
"@types/sinon": "10.0.2",
"gts": "3.1.0",
"mocha": "7.2.0",
"nock": "12.0.3",
"nyc": "15.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"@types/mocha": "8.2.3",
"@types/node": "18.11.7",
"@types/sinon": "10.0.2",
"gts": "3.1.0",
"mocha": "7.2.0",
"nock": "12.0.3",
"nyc": "15.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"@types/node": "^18.0.0",
"@types/sinon": "10.0.2",
"eslint-plugin-header": "^3.1.1",
"gts": "^3.1.0",
"mocha": "7.2.0",
"nock": "12.0.3",
"nyc": "15.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@opentelemetry/contrib-test-utils": "^0.33.2",
"@types/mocha": "8.2.3",
"@types/node": "18.11.7",
"gts": "3.1.0",
"@types/semver": "7.3.8",
"mocha": "7.2.0",
"nock": "12.0.3",
"nyc": "15.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
"@types/mocha": "8.2.3",
"@types/node": "18.11.7",
"@types/sinon": "10.0.2",
"gts": "3.1.0",
"mocha": "7.2.0",
"nyc": "15.1.0",
"rimraf": "4.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
"@types/semver": "7.3.8",
"mocha": "7.2.0",
"nock": "12.0.3",
"gts": "3.1.0",
"nyc": "15.1.0",
"rimraf": "4.2.0",
"ts-mocha": "10.0.0",
Expand Down
68 changes: 41 additions & 27 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,64 @@ module.exports = {
plugins: [
"@typescript-eslint",
"header",
"import"
],
extends: [
"./node_modules/gts",
"node",
"prettier"
],
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"],
parser: "@typescript-eslint/parser",
parserOptions: {
"project": "./tsconfig.json"
"project": "./tsconfig.json"
},
rules: {
"quotes": [2, "single", { "avoidEscape": true }],
"@typescript-eslint/no-this-alias": "off",
"quotes": ["error", "single", { "avoidEscape": true }],
"eqeqeq": "off",
"prefer-rest-params": "off",
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "memberLike",
"modifiers": ["private", "protected"],
"format": ["camelCase"],
"leadingUnderscore": "require"
}
],
"@typescript-eslint/no-inferrable-types": ["error", { ignoreProperties: true }],
"arrow-parens": ["error", "as-needed"],
"prettier/prettier": ["error", { "singleQuote": true, "arrowParens": "avoid" }],
"no-shadow": "off",
"node/no-deprecated-api": ["warn"],
"header/header": [2, "block", [{
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,
template:
"header/header": ["error", "block", [{
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,
template:
`\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 `
}]],
"import/no-extraneous-dependencies": ["error", { devDependencies: ["test/**/*.ts"] }],
}]]
},
overrides: [
{
"files": ["test/**/*.ts"],
"rules": {
files: ['*.ts'],
rules: {
"@typescript-eslint/no-this-alias": "off",
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "memberLike",
"modifiers": ["private", "protected"],
"format": ["camelCase"],
"leadingUnderscore": "require"
}
],
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-inferrable-types": ["error", { ignoreProperties: true }],
"@typescript-eslint/no-empty-function": ["off"],
"@typescript-eslint/ban-types": ["warn", {
"types": {
"Function": null,
}
}],
"@typescript-eslint/no-shadow": ["warn"],
}
},
{
files: ["test/**/*.ts"],
rules: {
"no-empty": "off",
"@typescript-eslint/ban-ts-ignore": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-var-requires": "off"
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-shadow": ["off"],
"@typescript-eslint/no-floating-promises": ["off"],
"@typescript-eslint/no-non-null-assertion": ["off"],
"@typescript-eslint/explicit-module-boundary-types": ["off"]
}
}
]
Expand Down
1 change: 0 additions & 1 deletion metapackages/auto-instrumentations-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"@types/mocha": "7.0.2",
"@types/node": "18.11.7",
"@types/sinon": "10.0.2",
"gts": "3.1.0",
"mocha": "7.2.0",
"nyc": "15.1.0",
"rimraf": "4.2.0",
Expand Down
1 change: 0 additions & 1 deletion metapackages/auto-instrumentations-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"@types/sinon": "10.0.2",
"@types/webpack-env": "1.16.2",
"babel-loader": "8.2.2",
"gts": "3.1.0",
"@jsdevtools/coverage-istanbul-loader": "3.0.5",
"karma": "6.3.16",
"karma-chrome-launcher": "^3.1.1",
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,15 @@
"@typescript-eslint/parser": "5.8.1",
"eslint": "8.7.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-config-prettier": "8.8.0",
"eslint-plugin-header": "3.1.1",
"eslint-plugin-import": "2.25.4",
"gts": "3.1.0",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-prettier": "4.2.1",
"husky": "7.0.4",
"lerna": "5.5.2",
"lerna-changelog": "2.2.0",
"prettier": "2.8.7",
"typescript": "4.4.4"
},
"changelog": {
Expand Down
1 change: 0 additions & 1 deletion packages/opentelemetry-host-metrics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
"@types/mocha": "8.2.3",
"@types/node": "18.11.7",
"@types/sinon": "10.0.2",
"gts": "3.1.0",
"mocha": "7.2.0",
"nyc": "15.1.0",
"rimraf": "4.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
"@types/node": "18.11.7",
"@types/sinon": "10.0.2",
"@types/webpack-env": "1.16.2",
"gts": "3.1.0",
"@jsdevtools/coverage-istanbul-loader": "3.0.5",
"karma": "6.3.16",
"karma-chrome-launcher": "^3.1.1",
Expand Down
1 change: 0 additions & 1 deletion packages/opentelemetry-propagation-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
"@types/node": "18.11.7",
"@types/sinon": "^10.0.11",
"expect": "29.2.0",
"gts": "3.1.0",
"mocha": "7.2.0",
"nyc": "15.1.0",
"sinon": "15.0.1",
Expand Down
1 change: 0 additions & 1 deletion packages/opentelemetry-redis-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"devDependencies": {
"@types/mocha": "^9.1.1",
"@types/node": "18.11.7",
"gts": "3.1.0",
"mocha": "7.2.0",
"nyc": "15.1.0",
"ts-mocha": "10.0.0",
Expand Down
1 change: 0 additions & 1 deletion packages/opentelemetry-test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"devDependencies": {
"@opentelemetry/api": "^1.3.0",
"@types/node": "18.11.7",
"gts": "3.1.0",
"typescript": "4.4.4"
},
"dependencies": {
Expand Down
1 change: 0 additions & 1 deletion plugins/node/instrumentation-amqplib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
"mocha": "7.2.0",
"ts-mocha": "10.0.0",
"nyc": "15.1.0",
"gts": "3.1.0",
"sinon": "15.0.1",
"test-all-versions": "5.0.1",
"typescript": "4.4.4"
Expand Down
1 change: 0 additions & 1 deletion plugins/node/instrumentation-dataloader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"@types/mocha": "7.0.2",
"@types/node": "18.11.7",
"dataloader": "2.2.1",
"gts": "3.1.0",
"mocha": "7.2.0",
"nyc": "15.1.0",
"rimraf": "4.2.0",
Expand Down
1 change: 0 additions & 1 deletion plugins/node/instrumentation-fs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
"@types/mocha": "7.0.2",
"@types/node": "18.11.7",
"@types/sinon": "^10.0.11",
"gts": "3.1.0",
"mocha": "7.2.0",
"nyc": "15.1.0",
"rimraf": "4.2.0",
Expand Down
1 change: 0 additions & 1 deletion plugins/node/instrumentation-lru-memoizer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"@types/mocha": "8.2.3",
"@types/node": "18.11.7",
"expect": "29.2.0",
"gts": "3.1.0",
"lru-memoizer": "2.1.4",
"mocha": "7.2.0",
"nyc": "15.1.0",
Expand Down
1 change: 0 additions & 1 deletion plugins/node/instrumentation-mongoose/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"@types/mocha": "8.2.3",
"@types/node": "18.11.7",
"expect": "29.2.0",
"gts": "3.1.0",
"mocha": "7.2.0",
"mongoose": "6.5.2",
"nyc": "15.1.0",
Expand Down
1 change: 0 additions & 1 deletion plugins/node/instrumentation-socket.io/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"@types/mocha": "8.2.3",
"@types/node": "18.11.7",
"expect": "27.4.2",
"gts": "3.1.0",
"mocha": "7.2.0",
"nyc": "15.1.0",
"rimraf": "4.2.0",
Expand Down
1 change: 0 additions & 1 deletion plugins/node/instrumentation-tedious/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"@opentelemetry/sdk-trace-base": "^1.8.0",
"@types/mocha": "7.0.2",
"@types/node": "18.11.7",
"gts": "3.1.0",
"mocha": "7.2.0",
"nyc": "15.1.0",
"rimraf": "4.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"@opentelemetry/sdk-metrics": "^1.8.0",
"@types/mocha": "7.0.2",
"@types/node": "18.11.7",
"gts": "3.1.0",
"mocha": "7.2.0",
"nyc": "15.1.0",
"rimraf": "4.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
"aws-sdk": "2.1008.0",
"eslint": "8.7.0",
"expect": "29.2.0",
"gts": "3.1.0",
"mocha": "7.2.0",
"nock": "13.2.1",
"nyc": "15.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
"@types/node": "18.11.7",
"@types/sinon": "10.0.2",
"bunyan": "1.8.15",
"gts": "3.1.0",
"mocha": "7.2.0",
"nyc": "15.1.0",
"rimraf": "4.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
"@types/semver": "7.3.8",
"@types/sinon": "10.0.2",
"cassandra-driver": "4.6.3",
"gts": "3.1.0",
"mocha": "7.2.0",
"nyc": "15.1.0",
"rimraf": "4.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"@types/mocha": "7.0.2",
"@types/node": "18.11.7",
"connect": "3.7.0",
"gts": "3.1.0",
"mocha": "7.2.0",
"nyc": "15.1.0",
"rimraf": "4.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
"@types/semver": "7.3.8",
"@types/shimmer": "1.0.2",
"@types/sinon": "10.0.2",
"gts": "3.1.0",
"mocha": "7.2.0",
"nyc": "15.1.0",
"rimraf": "4.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
"@types/node": "18.11.7",
"@types/sinon": "10.0.9",
"express": "4.17.3",
"gts": "3.1.0",
"mocha": "7.2.0",
"nyc": "15.1.0",
"rimraf": "4.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
"@types/mocha": "7.0.2",
"@types/node": "18.11.7",
"fastify": "^4.5.3",
"gts": "3.1.0",
"mocha": "7.2.0",
"nyc": "15.1.0",
"rimraf": "4.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"@types/node": "18.11.7",
"@types/semver": "7.3.8",
"generic-pool": "3.8.2",
"gts": "3.1.0",
"mocha": "7.2.0",
"nyc": "15.1.0",
"rimraf": "4.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"@types/mocha": "8.2.3",
"@types/node": "18.11.7",
"graphql": "^16.5.0",
"gts": "3.1.0",
"mocha": "7.2.0",
"nyc": "15.1.0",
"rimraf": "4.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"@opentelemetry/sdk-trace-node": "^1.8.0",
"@types/mocha": "7.0.2",
"@types/node": "18.11.7",
"gts": "3.1.0",
"mocha": "7.2.0",
"nyc": "15.1.0",
"rimraf": "4.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
"@types/node": "18.11.7",
"cross-env": "7.0.3",
"ioredis": "5.2.2",
"gts": "3.1.0",
"mocha": "7.2.0",
"nyc": "15.1.0",
"rimraf": "4.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"@opentelemetry/sdk-trace-node": "^1.8.0",
"@types/mocha": "7.0.2",
"@types/node": "18.11.7",
"gts": "3.1.0",
"knex": "0.95.9",
"mocha": "7.2.0",
"nyc": "15.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
"@types/mocha": "7.0.2",
"@types/node": "18.11.7",
"@types/sinon": "10.0.9",
"gts": "3.1.0",
"koa": "2.13.1",
"mocha": "7.2.0",
"nyc": "15.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
"@types/mocha": "7.0.2",
"@types/node": "18.11.7",
"cross-env": "7.0.3",
"gts": "3.1.0",
"memcached": "2.2.2",
"mocha": "7.2.0",
"nyc": "15.1.0",
Expand Down
Loading