Skip to content

Commit

Permalink
[eslint-plugin-azure-sdk] Replaced redundant custom rule ts-no-namesp…
Browse files Browse the repository at this point in the history
…aces with typescript-eslint/no-namespace (#18676)

* Removed ts-no-namespaces and replaced with typescript-eslint/no-namespace

* Fixed README.md

Co-authored-by: bbrusniak <[email protected]>
  • Loading branch information
bbrusniak and bbrusniak authored Nov 22, 2021
1 parent 53ef842 commit 65e171e
Show file tree
Hide file tree
Showing 14 changed files with 10 additions and 113 deletions.
1 change: 0 additions & 1 deletion common/tools/eslint-plugin-azure-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ Some rules (see table below) are fixable using the `--fix` ESLint option (added
| [**ts-naming-subclients**](https://github.com/Azure/azure-sdk-for-js/blob/main/common/tools/eslint-plugin-azure-sdk/docs/rules/ts-naming-subclients.md) | :triangular_flag_on_post: | :x: | `1.2.0` |
| [**ts-no-const-enums**](https://github.com/Azure/azure-sdk-for-js/blob/main/common/tools/eslint-plugin-azure-sdk/docs/rules/ts-no-const-enums.md) | :warning: | :heavy_check_mark: | `1.1.0` |
| [**ts-no-window**](https://github.com/Azure/azure-sdk-for-js/blob/main/common/tools/eslint-plugin-azure-sdk/docs/rules/ts-no-window.md) | :triangular_flag_on_post: | :heavy_check_mark: | `3.1.0` |
| [**ts-no-namespaces**](https://github.com/Azure/azure-sdk-for-js/blob/main/common/tools/eslint-plugin-azure-sdk/docs/rules/ts-no-namespaces.md) | :triangular_flag_on_post: | :x: | `1.2.0` |
| [**ts-package-json-author**](https://github.com/Azure/azure-sdk-for-js/blob/main/common/tools/eslint-plugin-azure-sdk/docs/rules/ts-package-json-author.md) | :triangular_flag_on_post: | :heavy_check_mark: | `1.0.0` |
| [**ts-package-json-bugs**](https://github.com/Azure/azure-sdk-for-js/blob/main/common/tools/eslint-plugin-azure-sdk/docs/rules/ts-package-json-bugs.md) | :triangular_flag_on_post: | :heavy_check_mark: | `1.0.0` |
| [**ts-package-json-engine-is-present**](https://github.com/Azure/azure-sdk-for-js/blob/main/common/tools/eslint-plugin-azure-sdk/docs/rules/ts-package-json-engine-is-present.md) | :triangular_flag_on_post: | :heavy_check_mark: | `1.1.0` |
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default {
"@typescript-eslint/no-inferrable-types": "off",
// We use empty extends and empty interface for shimming and renaming extensively
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
"@typescript-eslint/no-useless-constructor": "error",
Expand Down
1 change: 0 additions & 1 deletion common/tools/eslint-plugin-azure-sdk/src/configs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export = {
"@azure/azure-sdk/ts-naming-options": "error",
"@azure/azure-sdk/ts-naming-subclients": "error",
"@azure/azure-sdk/ts-no-const-enums": "warn",
"@azure/azure-sdk/ts-no-namespaces": "error",
"@azure/azure-sdk/ts-no-window": "error",
"@azure/azure-sdk/ts-package-json-author": "error",
"@azure/azure-sdk/ts-package-json-bugs": "error",
Expand Down
2 changes: 0 additions & 2 deletions common/tools/eslint-plugin-azure-sdk/src/rules/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import tsNamingDropNoun from "./ts-naming-drop-noun";
import tsNamingOptions from "./ts-naming-options";
import tsNamingSubclients from "./ts-naming-subclients";
import tsNoConstEnums from "./ts-no-const-enums";
import tsNoNamespaces from "./ts-no-namespaces";
import tsNoWindow from "./ts-no-window";
import tsPackageJsonAuthor from "./ts-package-json-author";
import tsPackageJsonBugs from "./ts-package-json-bugs";
Expand Down Expand Up @@ -82,7 +81,6 @@ export = {
"ts-naming-options": tsNamingOptions,
"ts-naming-subclients": tsNamingSubclients,
"ts-no-const-enums": tsNoConstEnums,
"ts-no-namespaces": tsNoNamespaces,
"ts-no-window": tsNoWindow,
"ts-package-json-author": tsPackageJsonAuthor,
"ts-package-json-bugs": tsPackageJsonBugs,
Expand Down
30 changes: 0 additions & 30 deletions common/tools/eslint-plugin-azure-sdk/src/rules/ts-no-namespaces.ts

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion sdk/attestation/attestation/src/jsrsasign.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

// eslint-disable-next-line @azure/azure-sdk/ts-no-namespaces
// eslint-disable-next-line @typescript-eslint/no-namespace
declare module 'jsrsasign';
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

// eslint-disable-next-line @azure/azure-sdk/ts-no-namespaces
// eslint-disable-next-line @typescript-eslint/no-namespace
declare global {
function atob(input: string): string;
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-client/src/base64.browser.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

// eslint-disable-next-line @azure/azure-sdk/ts-no-namespaces
// eslint-disable-next-line @typescript-eslint/no-namespace
declare global {
// stub these out for the browser
function btoa(input: string): string;
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-http/src/httpOperationResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface HttpResponse {
headers: HttpHeadersLike;
}

// eslint-disable-next-line @azure/azure-sdk/ts-no-namespaces
// eslint-disable-next-line @typescript-eslint/no-namespace
declare global {
/**
* Stub declaration of the browser-only Blob type.
Expand Down
6 changes: 3 additions & 3 deletions sdk/core/core-lro/test/utils/router/paramRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ function deleteasyncRetry(request: PipelineRequest): PipelineResponse | undefine
return undefined;
}

// eslint-disable-next-line @azure/azure-sdk/ts-no-namespaces
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace deleteasyncRetry {
export let internalCounter: number = 1; // eslint-disable-line prefer-const
}
Expand Down Expand Up @@ -293,7 +293,7 @@ function putasyncRetry(request: PipelineRequest): PipelineResponse | undefined {
return undefined;
}

// eslint-disable-next-line @azure/azure-sdk/ts-no-namespaces
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace putasyncRetry {
export let internalCounter: number = 1; // eslint-disable-line prefer-const
}
Expand Down Expand Up @@ -369,7 +369,7 @@ function postasyncRetry(request: PipelineRequest): PipelineResponse | undefined
return undefined;
}

// eslint-disable-next-line @azure/azure-sdk/ts-no-namespaces
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace postasyncRetry {
export let internalCounter: number = 1; // eslint-disable-line prefer-const
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/eventhub/event-hubs/src/connectionContext.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

/* eslint-disable @azure/azure-sdk/ts-no-namespaces */
/* eslint-disable @typescript-eslint/no-namespace */
/* eslint-disable no-inner-declarations */

import { logger, logErrorStackTrace } from "./log";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT license.

/* eslint-disable @typescript-eslint/no-non-null-asserted-optional-chain */
/* eslint-disable @azure/azure-sdk/ts-no-namespaces */
/* eslint-disable @typescript-eslint/no-namespace */

import Sinon from "sinon";
import { assert } from "chai";
Expand Down

0 comments on commit 65e171e

Please sign in to comment.