diff --git a/sdk/cosmosdb/cosmos/.eslintrc.json b/sdk/cosmosdb/cosmos/.eslintrc.json index 189e66aa5366..58f0d08ee19c 100644 --- a/sdk/cosmosdb/cosmos/.eslintrc.json +++ b/sdk/cosmosdb/cosmos/.eslintrc.json @@ -1,5 +1,5 @@ { - "plugins": ["@azure/azure-sdk", "@typescript-eslint/tslint"], + "plugins": ["@azure/azure-sdk"], "extends": ["plugin:@azure/azure-sdk/recommended"], "parserOptions": { "createDefaultProgram": true @@ -19,15 +19,6 @@ "@azure/azure-sdk/ts-package-json-module": "warn", "@azure/azure-sdk/ts-doc-internal": "warn", // https://github.com/benmosher/eslint-plugin-import/issues/1816 - "import/no-extraneous-dependencies": "off", - "@typescript-eslint/tslint/config": [ - "error", - { - "rules": { - "import-blacklist": [true, "assert", "util"], - "no-floating-promises": true - } - } - ] + "import/no-extraneous-dependencies": "off" } } diff --git a/sdk/cosmosdb/cosmos/dev.md b/sdk/cosmosdb/cosmos/dev.md index 22abfabbc52b..406b672254cb 100644 --- a/sdk/cosmosdb/cosmos/dev.md +++ b/sdk/cosmosdb/cosmos/dev.md @@ -30,7 +30,7 @@ available via `npm run-script`: clean rimraf lib lint - tslint --project tsconfig.json + eslint package.json api-extractor.json src samples --ext .ts format prettier --write --config .prettierrc.json "src/**/*.ts" check-format diff --git a/sdk/cosmosdb/cosmos/package.json b/sdk/cosmosdb/cosmos/package.json index d7912495cd5b..fce9d7b80122 100644 --- a/sdk/cosmosdb/cosmos/package.json +++ b/sdk/cosmosdb/cosmos/package.json @@ -52,7 +52,7 @@ "build:src": "echo Using TypeScript && tsc --version && tsc -b --pretty", "build:test": "tsc", "build:types": "downlevel-dts dist/types/latest dist/types/3.1", - "build": "npm run clean && tslint --project ./tsconfig.json && npm run extract-api && npm run build:types && node writeSDKVersion.js && npm run bundle", + "build": "npm run clean && npm run extract-api && npm run build:types && node writeSDKVersion.js && npm run bundle", "bundle": "rollup -c", "bundle-types": "node bundle-types.js", "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", @@ -116,7 +116,6 @@ "@types/tunnel": "^0.0.1", "@types/underscore": "^1.8.8", "@types/uuid": "^8.0.0", - "@typescript-eslint/eslint-plugin-tslint": "^4.8.1", "cross-env": "^7.0.2", "dotenv": "^8.2.0", "downlevel-dts": "~0.4.0", @@ -135,8 +134,6 @@ "snap-shot-it": "^7.9.1", "source-map-support": "^0.5.9", "ts-node": "^8.3.0", - "tslint": "^5.0.0", - "tslint-config-prettier": "^1.14.0", "typedoc": "0.15.2", "typescript": "4.1.2" } diff --git a/sdk/cosmosdb/cosmos/samples/.eslintrc.json b/sdk/cosmosdb/cosmos/samples/.eslintrc.json index 94fc5dea8250..5b6ad8bd47db 100644 --- a/sdk/cosmosdb/cosmos/samples/.eslintrc.json +++ b/sdk/cosmosdb/cosmos/samples/.eslintrc.json @@ -1,5 +1,5 @@ { - "plugins": ["@azure/azure-sdk", "@typescript-eslint/tslint"], + "plugins": ["@azure/azure-sdk"], "extends": ["plugin:@azure/azure-sdk/recommended"], "parserOptions": { "createDefaultProgram": true @@ -10,15 +10,6 @@ "dot-notation": "off", "some-rule": "off", // ChangeFeed.ts has problems with this rule - "no-irregular-whitespace": "off", - "@typescript-eslint/tslint/config": [ - "error", - { - "rules": { - "import-blacklist": [true, "assert", "util"], - "no-floating-promises": true - } - } - ] + "no-irregular-whitespace": "off" } } diff --git a/sdk/cosmosdb/cosmos/samples/DatabaseManagement.ts b/sdk/cosmosdb/cosmos/samples/DatabaseManagement.ts index 3fc82d673677..7b1f14658dec 100644 --- a/sdk/cosmosdb/cosmos/samples/DatabaseManagement.ts +++ b/sdk/cosmosdb/cosmos/samples/DatabaseManagement.ts @@ -3,7 +3,6 @@ import { handleError, logStep, logSampleHeader, finish } from "./Shared/handleError"; import { CosmosClient } from "../dist"; import { endpoint, key, database as databaseId } from "./Shared/config"; -// eslint-disable-next-line @typescript-eslint/tslint/config import assert from "assert"; logSampleHeader("Database Management"); diff --git a/sdk/cosmosdb/cosmos/samples/MultiRegionWrite/ConflictWorker.ts b/sdk/cosmosdb/cosmos/samples/MultiRegionWrite/ConflictWorker.ts index fef4810b6f6f..906e732abc17 100644 --- a/sdk/cosmosdb/cosmos/samples/MultiRegionWrite/ConflictWorker.ts +++ b/sdk/cosmosdb/cosmos/samples/MultiRegionWrite/ConflictWorker.ts @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -// tslint:disable:no-console + import { v4 as guid } from "uuid"; import { CosmosClient, diff --git a/sdk/cosmosdb/cosmos/samples/MultiRegionWrite/Worker.ts b/sdk/cosmosdb/cosmos/samples/MultiRegionWrite/Worker.ts index 5a4daffedb5a..3bab7a4ba258 100644 --- a/sdk/cosmosdb/cosmos/samples/MultiRegionWrite/Worker.ts +++ b/sdk/cosmosdb/cosmos/samples/MultiRegionWrite/Worker.ts @@ -3,7 +3,6 @@ import { v4 as guid } from "uuid"; import { Container } from "../../dist"; -// tslint:disable:no-console export class Worker { constructor(private readonly regionName: string, private readonly container: Container) {} diff --git a/sdk/cosmosdb/cosmos/samples/MultiRegionWrite/app.ts b/sdk/cosmosdb/cosmos/samples/MultiRegionWrite/app.ts index 806d0b04e409..8ccc011f3e0e 100644 --- a/sdk/cosmosdb/cosmos/samples/MultiRegionWrite/app.ts +++ b/sdk/cosmosdb/cosmos/samples/MultiRegionWrite/app.ts @@ -2,7 +2,6 @@ // Licensed under the MIT license. import { MultiRegionWriteScenario } from "./MultiRegionWriteScenario"; -// tslint:disable:no-console async function run(): Promise { const scenarios = new MultiRegionWriteScenario(); await scenarios.init(); diff --git a/sdk/cosmosdb/cosmos/samples/MultiRegionWrite/config.ts b/sdk/cosmosdb/cosmos/samples/MultiRegionWrite/config.ts index 1f2a0479ed97..dc22c83f7fe1 100644 --- a/sdk/cosmosdb/cosmos/samples/MultiRegionWrite/config.ts +++ b/sdk/cosmosdb/cosmos/samples/MultiRegionWrite/config.ts @@ -4,7 +4,6 @@ const endpoint = process.env["endpoint"]; const key = process.env["key"]; if (!endpoint || !key) { - // tslint:disable-next-line:no-console console.error("Missing endpoint and key environment variables. Exiting..."); process.exit(1); } diff --git a/sdk/cosmosdb/cosmos/src/CosmosClient.ts b/sdk/cosmosdb/cosmos/src/CosmosClient.ts index 8eb31a1faec5..baa4e67ea9f6 100644 --- a/sdk/cosmosdb/cosmos/src/CosmosClient.ts +++ b/sdk/cosmosdb/cosmos/src/CosmosClient.ts @@ -58,7 +58,7 @@ export class CosmosClient { * Creates a new {@link CosmosClient} object. See {@link CosmosClientOptions} for more details on what options you can use. * @param options - bag of options; require at least endpoint and auth to be configured */ - constructor(options: CosmosClientOptions); // tslint:disable-line:unified-signatures + constructor(options: CosmosClientOptions); constructor(optionsOrConnectionString: string | CosmosClientOptions) { if (typeof optionsOrConnectionString === "string") { optionsOrConnectionString = parseConnectionString(optionsOrConnectionString); diff --git a/sdk/cosmosdb/cosmos/src/queryExecutionContext/documentProducer.ts b/sdk/cosmosdb/cosmos/src/queryExecutionContext/documentProducer.ts index e8d941ccd12b..5505c966f9a1 100644 --- a/sdk/cosmosdb/cosmos/src/queryExecutionContext/documentProducer.ts +++ b/sdk/cosmosdb/cosmos/src/queryExecutionContext/documentProducer.ts @@ -59,7 +59,6 @@ export class DocumentProducer { this.continuationToken = undefined; this.respHeaders = getInitialHeader(); - // tslint:disable-next-line:no-shadowed-variable this.internalExecutionContext = new DefaultQueryExecutionContext(options, this.fetchFunction); } /** diff --git a/sdk/cosmosdb/cosmos/src/queryMetrics/runtimeExecutionTimes.ts b/sdk/cosmosdb/cosmos/src/queryMetrics/runtimeExecutionTimes.ts index b77dbb056f00..e7b4156d868d 100644 --- a/sdk/cosmosdb/cosmos/src/queryMetrics/runtimeExecutionTimes.ts +++ b/sdk/cosmosdb/cosmos/src/queryMetrics/runtimeExecutionTimes.ts @@ -46,12 +46,10 @@ export class RuntimeExecutionTimes { * Output the RuntimeExecutionTimes as a delimited string. */ public toDelimitedString(): string { - // tslint:disable-next-line:max-line-length return ( `${ QueryMetricsConstants.SystemFunctionExecuteTimeInMs }=${this.systemFunctionExecutionTime.totalMilliseconds()};` + - // tslint:disable-next-line:max-line-length `${ QueryMetricsConstants.UserDefinedFunctionExecutionTimeInMs }=${this.userDefinedFunctionExecutionTime.totalMilliseconds()}` diff --git a/sdk/cosmosdb/cosmos/src/queryMetrics/timeSpan.ts b/sdk/cosmosdb/cosmos/src/queryMetrics/timeSpan.ts index e53b01b0f3eb..e7eae1a1cb4e 100644 --- a/sdk/cosmosdb/cosmos/src/queryMetrics/timeSpan.ts +++ b/sdk/cosmosdb/cosmos/src/queryMetrics/timeSpan.ts @@ -55,7 +55,6 @@ const minMilliSeconds = Number.MIN_SAFE_INTEGER / ticksPerMillisecond; * @hidden */ export class TimeSpan { - // tslint:disable-next-line:variable-name protected _ticks: number; constructor(days: number, hours: number, minutes: number, seconds: number, milliseconds: number) { // Constructor diff --git a/sdk/cosmosdb/cosmos/src/request/defaultAgent.ts b/sdk/cosmosdb/cosmos/src/request/defaultAgent.ts index bb3cad366876..94ad8acb1ff9 100644 --- a/sdk/cosmosdb/cosmos/src/request/defaultAgent.ts +++ b/sdk/cosmosdb/cosmos/src/request/defaultAgent.ts @@ -7,9 +7,7 @@ import { Agent } from "http"; */ export let defaultHttpsAgent: Agent; -// tslint:disable-next-line:no-var-requires const https = require("https"); // eslint-disable-line @typescript-eslint/no-require-imports -// tslint:disable-next-line:no-var-requires const tls = require("tls"); // eslint-disable-line @typescript-eslint/no-require-imports // minVersion only available in Node 10+ @@ -25,7 +23,6 @@ if (tls.DEFAULT_MIN_VERSION) { secureProtocol: "TLSv1_2_method" }); } -// tslint:disable-next-line:no-var-requires const http = require("http"); // eslint-disable-line @typescript-eslint/no-require-imports /** * @internal diff --git a/sdk/cosmosdb/cosmos/src/routing/QueryRange.ts b/sdk/cosmosdb/cosmos/src/routing/QueryRange.ts index 923ad00875b7..0cb52dd33921 100644 --- a/sdk/cosmosdb/cosmos/src/routing/QueryRange.ts +++ b/sdk/cosmosdb/cosmos/src/routing/QueryRange.ts @@ -32,7 +32,6 @@ export class QueryRange { this.isMaxInclusive = isMaxInclusive; } public overlaps(other: QueryRange): boolean { - // tslint:disable-next-line:no-this-assignment const range1 = this; // eslint-disable-line @typescript-eslint/no-this-alias const range2 = other; if (range1 === undefined || range2 === undefined) { diff --git a/sdk/cosmosdb/cosmos/src/utils/globalCrypto.native.ts b/sdk/cosmosdb/cosmos/src/utils/globalCrypto.native.ts index 8a7795c2700f..db9582b8fbf1 100644 --- a/sdk/cosmosdb/cosmos/src/utils/globalCrypto.native.ts +++ b/sdk/cosmosdb/cosmos/src/utils/globalCrypto.native.ts @@ -4,6 +4,5 @@ // isomorphic-webcrypto is not listed as a dependency in package.json because // doing so requires adding a bunch of react packages as peer dependencies. So, // it is being loaded dynamically here to not cause compiler error. -// tslint:disable-next-line:no-var-requires const globalCrypto = require("isomorphic-webcrypto"); // eslint-disable-line import/no-extraneous-dependencies, @typescript-eslint/no-require-imports export { globalCrypto }; diff --git a/sdk/cosmosdb/cosmos/test/.eslintrc.json b/sdk/cosmosdb/cosmos/test/.eslintrc.json index f46384bde412..150383183916 100644 --- a/sdk/cosmosdb/cosmos/test/.eslintrc.json +++ b/sdk/cosmosdb/cosmos/test/.eslintrc.json @@ -3,14 +3,6 @@ "rules": { "no-console": "off", "no-invalid-this": "off", - "space-before-function-paren": "off", - "@typescript-eslint/tslint/config": [ - "error", - { - "rules": { - "no-implicit-dependencies": [true, "dev"] - } - } - ] + "space-before-function-paren": "off" } } diff --git a/sdk/cosmosdb/cosmos/test/public/functional/sproc.spec.ts b/sdk/cosmosdb/cosmos/test/public/functional/sproc.spec.ts index fc076bb4cb47..69f4c9c0f8a6 100644 --- a/sdk/cosmosdb/cosmos/test/public/functional/sproc.spec.ts +++ b/sdk/cosmosdb/cosmos/test/public/functional/sproc.spec.ts @@ -97,11 +97,6 @@ describe("NodeJS CRUD Tests", function() { }); it("nativeApi should do stored procedure operations successfully with create/replace", async function() { - // tslint:disable:no-var-keyword - // tslint:disable:prefer-const - // tslint:disable:curly - // tslint:disable:no-string-throw - // tslint:disable:object-literal-shorthand const sproc1: StoredProcedureDefinition = { id: "storedProcedure1", body: function() { @@ -138,12 +133,6 @@ describe("NodeJS CRUD Tests", function() { } }; - // tslint:enable:no-var-keyword - // tslint:enable:prefer-const - // tslint:enable:curly - // tslint:enable:no-string-throw - // tslint:enable:object-literal-shorthand - const { resource: retrievedSproc } = await container.scripts.storedProcedures.create(sproc1); const { resource: result } = await container.scripts .storedProcedure(retrievedSproc.id) @@ -178,12 +167,6 @@ describe("NodeJS CRUD Tests", function() { }); const container = await database.container(containerResult.id); - // tslint:disable:no-var-keyword - // tslint:disable:prefer-const - // tslint:disable:curly - // tslint:disable:no-string-throw - // tslint:disable:no-shadowed-variable - // tslint:disable:object-literal-shorthand const querySproc = { id: "querySproc", body: function() { @@ -204,12 +187,6 @@ describe("NodeJS CRUD Tests", function() { if (!accept) throw "Unable to read player details, abort "; } }; - // tslint:enable:no-var-keyword - // tslint:enable:prefer-const - // tslint:enable:curly - // tslint:enable:no-string-throw - // tslint:enable:no-shadowed-variable - // tslint:enable:object-literal-shorthand const documents = [ { id: "document1" }, @@ -246,12 +223,6 @@ describe("NodeJS CRUD Tests", function() { }); const container = await database.container(containerResult.id); - - // tslint:disable:curly - // tslint:disable:no-string-throw - // tslint:disable:no-shadowed-variable - // tslint:disable:one-line - // tslint:disable:object-literal-shorthand const sproc1 = { id: "storedProcedure", body: function() { @@ -270,12 +241,6 @@ describe("NodeJS CRUD Tests", function() { } }; - // tslint:enable:curly - // tslint:enable:no-string-throw - // tslint:enable:no-shadowed-variable - // tslint:enable:one-line - // tslint:enable:object-literal-shorthand - const { resource: retrievedSproc } = await container.scripts.storedProcedures.create(sproc1); const { resource: result1, headers: headers1 } = await container.scripts .storedProcedure(retrievedSproc.id) diff --git a/sdk/cosmosdb/cosmos/test/public/functional/trigger.spec.ts b/sdk/cosmosdb/cosmos/test/public/functional/trigger.spec.ts index 22630dd1ceb5..4a1f4ad875e5 100644 --- a/sdk/cosmosdb/cosmos/test/public/functional/trigger.spec.ts +++ b/sdk/cosmosdb/cosmos/test/public/functional/trigger.spec.ts @@ -27,16 +27,12 @@ describe("NodeJS CRUD Tests", function() { // create a trigger const beforeCreateTriggersCount = triggers.length; - // tslint:disable:no-var-keyword - // tslint:disable:prefer-const const triggerDefinition: TriggerDefinition = { id: "sample trigger", body: "serverScript() { var x = 10; }", triggerType: TriggerType.Pre, triggerOperation: TriggerOperation.All }; - // tslint:enable:no-var-keyword - // tslint:enable:prefer-const const { resource: trigger } = await container.scripts.triggers.create(triggerDefinition); @@ -99,11 +95,6 @@ describe("NodeJS CRUD Tests", function() { const triggers: TriggerDefinition[] = [ { id: "t1", - // tslint:disable:no-var-keyword - // tslint:disable:prefer-const - // tslint:disable:curly - // tslint:disable:no-string-throw - // tslint:disable:object-literal-shorthand body: function() { const item = getContext() .getRequest() @@ -158,11 +149,6 @@ describe("NodeJS CRUD Tests", function() { triggerOperation: TriggerOperation.Delete } ]; - // tslint:enable:no-var-keyword - // tslint:enable:prefer-const - // tslint:enable:curly - // tslint:enable:no-string-throw - // tslint:enable:object-literal-shorthand it("should do trigger operations successfully with create", async function() { for (const trigger of triggers) { diff --git a/sdk/cosmosdb/cosmos/tslint.json b/sdk/cosmosdb/cosmos/tslint.json deleted file mode 100644 index 9b4159a873f9..000000000000 --- a/sdk/cosmosdb/cosmos/tslint.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": ["tslint:recommended", "tslint-config-prettier"], - "exclude": "./node_modules", - "rules": { - "interface-name": false, - "ordered-imports": false, - "no-string-literal": false, - "object-literal-sort-keys": false, - "member-ordering": false, // TODO: might want to look at this eventually... - "no-floating-promises": true, - "import-blacklist": [true, "assert", "util"], - "no-unnecessary-class": true, - "no-invalid-this": true, - "no-console": false, - "no-bitwise": false - }, - "linterOptions": { - "exclude": ["*.json"] - } -}