diff --git a/eslint.config.js b/eslint.config.js index 80f6b9242f..3c65700699 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -14,36 +14,14 @@ module.exports = { "no-trailing-spaces": "error", "eol-last": "error", "quotes": [2, "single", { "avoidEscape": true }], - "@typescript-eslint/no-floating-promises": 2, - "@typescript-eslint/no-this-alias": "off", "brace-style": ["error", "1tbs"], "eqeqeq": [ "error", "smart" ], "prefer-rest-params": "off", - "@typescript-eslint/naming-convention": [ - "error", - { - "selector": "memberLike", - "modifiers": ["private", "protected"], - "format": ["camelCase"], - "leadingUnderscore": "require" - } - ], "no-console": "error", "no-shadow": "off", - "@typescript-eslint/no-shadow": ["warn"], - "@typescript-eslint/no-unused-vars": ["error", {"argsIgnorePattern": "^_", "args": "after-used"}], - "@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"], - "@typescript-eslint/semi": "error", "arrow-parens": ["error", "as-needed"], "node/no-deprecated-api": ["warn"], "header/header": [2, "block", [{ @@ -54,8 +32,35 @@ module.exports = { }, overrides: [ { - "files": ["test/**/*.ts"], - "rules": { + files: ['*.ts'], + rules: { + "@typescript-eslint/no-floating-promises": 2, + "@typescript-eslint/no-this-alias": "off", + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "memberLike", + "modifiers": ["private", "protected"], + "format": ["camelCase"], + "leadingUnderscore": "require" + } + ], + "@typescript-eslint/no-shadow": ["warn"], + "@typescript-eslint/no-unused-vars": ["error", {"argsIgnorePattern": "^_", "args": "after-used"}], + "@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"], + "@typescript-eslint/semi": "error" + } + }, + { + files: ["test/**/*.ts"], + rules: { "no-empty": "off", "@typescript-eslint/ban-ts-ignore": "off", "@typescript-eslint/no-empty-function": "off", diff --git a/examples/.eslintrc.js b/examples/.eslintrc.js new file mode 100644 index 0000000000..3da8752ef1 --- /dev/null +++ b/examples/.eslintrc.js @@ -0,0 +1,13 @@ +module.exports = { + env: { + mocha: true, + node: true, + es6: true + }, + parserOptions: { + ecmaVersion: '2021' + }, + rules: { + "header/header": "off" + } +} diff --git a/examples/.eslintrc.json b/examples/.eslintrc.json deleted file mode 100644 index 6000f93619..0000000000 --- a/examples/.eslintrc.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "env": { - "node": true - }, - "extends": "airbnb-base", - "parserOptions": { - "sourceType": "script" - }, - "rules": { - "strict": ["error", "global"], - "no-use-before-define": ["error", "nofunc"], - "no-console": "off", - "import/no-unresolved": "off", - "no-unused-vars": ["error", { "argsIgnorePattern": "^_" }] - }, - "ignorePatterns": "**/*_pb.js" -} diff --git a/examples/grpc-js/client.js b/examples/grpc-js/client.js index 471f6ff94d..f939fcf61c 100644 --- a/examples/grpc-js/client.js +++ b/examples/grpc-js/client.js @@ -2,7 +2,6 @@ const api = require('@opentelemetry/api'); const tracer = require('./tracer')('example-grpc-js-client'); -// eslint-disable-next-line import/order const grpc = require('@grpc/grpc-js'); const messages = require('./helloworld_pb'); const services = require('./helloworld_grpc_pb'); diff --git a/examples/grpc-js/server.js b/examples/grpc-js/server.js index e76a112288..9427a9d3f4 100644 --- a/examples/grpc-js/server.js +++ b/examples/grpc-js/server.js @@ -2,7 +2,6 @@ const api = require('@opentelemetry/api'); const tracer = require('./tracer')(('example-grpc-js-server')); -// eslint-disable-next-line import/order const grpc = require('@grpc/grpc-js'); const messages = require('./helloworld_pb'); diff --git a/examples/grpc/client.js b/examples/grpc/client.js index 56825a906b..18c7cf7354 100644 --- a/examples/grpc/client.js +++ b/examples/grpc/client.js @@ -2,7 +2,6 @@ const api = require('@opentelemetry/api'); const tracer = require('./tracer')('example-grpc-client'); -// eslint-disable-next-line import/order const grpc = require('grpc'); const messages = require('./helloworld_pb'); const services = require('./helloworld_grpc_pb'); diff --git a/examples/grpc/server.js b/examples/grpc/server.js index 7422f63edb..6cb34dee5e 100644 --- a/examples/grpc/server.js +++ b/examples/grpc/server.js @@ -2,7 +2,6 @@ const api = require('@opentelemetry/api'); const tracer = require('./tracer')(('example-grpc-server')); -// eslint-disable-next-line import/order const grpc = require('grpc'); const messages = require('./helloworld_pb'); diff --git a/examples/http/client.js b/examples/http/client.js index 79dcc99a5a..40babbda89 100644 --- a/examples/http/client.js +++ b/examples/http/client.js @@ -2,7 +2,6 @@ const api = require('@opentelemetry/api'); const tracer = require('./tracer')('example-http-client'); -// eslint-disable-next-line import/order const http = require('http'); /** A function which makes requests and handles response. */ diff --git a/examples/http/server.js b/examples/http/server.js index b8d4f1e003..1c11f60323 100644 --- a/examples/http/server.js +++ b/examples/http/server.js @@ -2,7 +2,6 @@ const api = require('@opentelemetry/api'); const tracer = require('./tracer')('example-http-server'); -// eslint-disable-next-line import/order const http = require('http'); /** Starts a HTTP server that receives requests on sample server port. */ diff --git a/examples/https/client.js b/examples/https/client.js index 4befda7955..2240399d21 100644 --- a/examples/https/client.js +++ b/examples/https/client.js @@ -2,7 +2,6 @@ const api = require('@opentelemetry/api'); const tracer = require('./tracer')('example-https-client'); -// eslint-disable-next-line import/order const https = require('https'); /** A function which makes requests and handles response. */ diff --git a/examples/https/server.js b/examples/https/server.js index 73fc6d3535..20460bb2a4 100644 --- a/examples/https/server.js +++ b/examples/https/server.js @@ -1,7 +1,6 @@ 'use strict'; const api = require('@opentelemetry/api'); -// eslint-disable-next-line import/order const tracer = require('./tracer')('example-https-server'); const fs = require('fs'); const https = require('https'); diff --git a/examples/tracer-web/.eslintrc b/examples/tracer-web/.eslintrc deleted file mode 100644 index ab18623027..0000000000 --- a/examples/tracer-web/.eslintrc +++ /dev/null @@ -1,17 +0,0 @@ -{ - "env": { - "browser": true - }, - "extends": "airbnb-base", - "parserOptions": { - "sourceType": "module" - }, - "rules": { - "strict": ["error", "global"], - "no-use-before-define": ["error", "nofunc"], - "no-console": "off", - "import/no-unresolved": "off", - "no-unused-vars": ["error", { "argsIgnorePattern": "^_" }], - "import/no-extraneous-dependencies": [ "error", { "devDependencies": true } ] - } -} diff --git a/examples/tracer-web/.eslintrc.js b/examples/tracer-web/.eslintrc.js new file mode 100644 index 0000000000..2a69c87097 --- /dev/null +++ b/examples/tracer-web/.eslintrc.js @@ -0,0 +1,5 @@ +module.exports = { + env: { + browser: true + } +} diff --git a/package.json b/package.json index d311d84a7e..5aee41c22e 100644 --- a/package.json +++ b/package.json @@ -51,9 +51,7 @@ "@typescript-eslint/eslint-plugin": "5.3.1", "@typescript-eslint/parser": "5.3.1", "eslint": "7.32.0", - "eslint-config-airbnb-base": "14.2.1", "eslint-plugin-header": "3.1.1", - "eslint-plugin-import": "2.25.3", "eslint-plugin-node": "11.1.0", "gh-pages": "3.2.3", "lerna": "3.22.1",