-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[eslint-plugin-azure-sdk] Replaced redundant custom rule ts-no-namespaces with typescript-eslint/no-namespace #18676
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
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 |
---|---|---|
|
@@ -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 | ||
} | ||
Comment on lines
228
to
230
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is neither here nor there for this PR but the namespaces in these files are the only namespace declarations that actually stick out to me. CC @sadasant and @deyaaeldeen should we file an issue to rework these? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was trying to mimic static variables based on this recommendation: microsoft/TypeScript#8419 (comment) and did not want to change the whole setup of routes logic as functions to accommodate stateful ones. I am fine with opening an issue though to track updating this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah I see the purpose of the pattern now is to let the namespace merge with the function and bind those static fields to it that way. It would be nice to find a different way to bind these to instances of the function (using |
||
|
@@ -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 | ||
} | ||
|
@@ -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 | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder why it was turned off in the first place? but this is a question to the team :) @witemple-msft and @sadasant do you know?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We had our own namespace rule which this PR removes in favor of this built-in one.
In the history of our eslint plugin, it was basically developed in 1:1 correspondence with the guidelines, and at that time the eslint/tslint/typescript-eslint story was not as set in stone as it is now where pretty much everyone is using eslint with the typescript plugin.