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

[engsys][eslint-plugin] upgrade eslint dependencies #21733

Merged
merged 2 commits into from
May 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
331 changes: 247 additions & 84 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions common/tools/eslint-plugin-azure-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,19 @@
},
"prettier": "./prettier.json",
"peerDependencies": {
"@typescript-eslint/eslint-plugin": "~4.19.0",
"@typescript-eslint/parser": "~4.19.0",
"eslint": "^7.15.0",
"@typescript-eslint/eslint-plugin": "~5.22.0",
"@typescript-eslint/parser": "~5.22.0",
"eslint": "^8.0.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-no-only-tests": "^2.4.0",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-tsdoc": "^0.2.10"
},
"dependencies": {
"@typescript-eslint/typescript-estree": "~4.19.0",
"@types/eslint": "~7.2.7",
"@typescript-eslint/typescript-estree": "~5.22.0",
"@types/eslint": "~8.4.0",
"@types/estree": "~0.0.46",
"eslint-config-prettier": "^7.0.0",
"eslint-config-prettier": "^8.0.0",
"glob": "^8.0.0",
"json-schema": "^0.4.0",
"typescript": "~4.2.0",
Expand All @@ -83,11 +83,11 @@
"@types/json-schema": "^7.0.6",
"@types/mocha": "^7.0.2",
"@types/node": "^12.0.0",
"@typescript-eslint/eslint-plugin": "~4.19.0",
"@typescript-eslint/experimental-utils": "~4.19.0",
"@typescript-eslint/parser": "~4.19.0",
"@typescript-eslint/eslint-plugin": "~5.22.0",
"@typescript-eslint/experimental-utils": "~5.22.0",
"@typescript-eslint/parser": "~5.22.0",
"chai": "^4.2.0",
"eslint": "^7.15.0",
"eslint": "^8.0.0",
"mocha": "^7.1.1",
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default {
extends: [
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"prettier/@typescript-eslint",
"prettier",
"plugin:@azure/azure-sdk/recommended",
],
rules: {
Expand All @@ -52,7 +52,7 @@ export default {
"no-invalid-this": "off",
"no-empty": "error",
"no-fallthrough": "error",
"@typescript-eslint/no-invalid-this": "error",
"@typescript-eslint/no-invalid-this": "off",
"@typescript-eslint/no-require-imports": "error",
"no-restricted-imports": ["error", { paths: ["rhea", "rhea/.*"] }],
"no-return-await": "error",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export = {
const converter = parserServices.esTreeNodeToTSNodeMap;

return {
":matches(ClassProperty, MethodDefinition, TSMethodSignature, TSPropertySignature, TSIndexSignature, TSParameterProperty)":
":matches(ClassProperty, PropertyDefinition, MethodDefinition, TSMethodSignature, TSPropertySignature, TSIndexSignature, TSParameterProperty)":
(node: Node): void => reportInternal(node, context, converter),
};
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,66 +112,94 @@ ruleTester.run("ts-doc-internal-private-member", rule, {
invalid: [
{
code: `
/**
* Class documentation
*/
class ExampleClass {
/**
* Class Property
* @internal
*/
private x = 0;

/**
* Property Signature
* @internal
*/
private y: number;

/**
* Index signature
* @internal
*/
private [s: string]: boolean | ((s: string) => boolean);

/**
* Parameter Property
* @internal
*/
private testMethod(private x: number, private y: number) {}

/**
* Method Definition
* @internal
*/
private get getter(): number { return 0 }

/**
* Method Signature
* @internal
*/
private method1(): any;

}`,
/**
* Class documentation
*/
class ExampleClass {
/**
* Property Definition
* @internal
*/
private x = 0;

/**
* Property Signature
* @internal
*/
private y: number;

/**
* Method Definition
* @internal
*/
private testMethod() { }

/**
* Method Definition
* @internal
*/
private get getter(): number { return 0 }

/**
* Method Signature
* @internal
*/
private method1(): any;


/**
* constructor
* @internal
*/
constructor(
/**
* param x
* @internal
*/
private param_x: number,
/**
* param y
* @internal
*/
private param_y: number) { }
}
`,
filename: "src/test.ts",
errors: [
{
message: "private class members should not include an @internal tag",
line: 10,
column: 3,
},
{
message: "private class members should not include an @internal tag",
line: 16,
column: 3,
},
{
message: "private class members should not include an @internal tag",
line: 22,
column: 3,
},
{
message: "private class members should not include an @internal tag",
line: 28,
column: 3,
},
{
message: "private class members should not include an @internal tag",
line: 34,
column: 3,
},
{
message: "private class members should not include an @internal tag",
line: 46,
column: 5,
},
{
message: "private class members should not include an @internal tag",
line: 51,
column: 5,
},
],
},
Expand Down
2 changes: 1 addition & 1 deletion sdk/appconfiguration/app-configuration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
"@types/uuid": "^8.3.4",
"chai": "^4.2.0",
"dotenv": "^8.2.0",
"eslint": "^7.15.0",
"eslint": "^8.0.0",
"esm": "^3.2.18",
"karma": "^6.2.0",
"karma-chrome-launcher": "^3.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function isDefined<T>(thing: T | undefined | null): thing is T {
* @param properties - The name of the properties that should appear in the object.
* @internal
*/
export function isObjectWithProperties<Thing extends unknown, PropertyName extends string>(
export function isObjectWithProperties<Thing, PropertyName extends string>(
thing: Thing,
properties: PropertyName[]
): thing is Thing & Record<PropertyName, unknown> {
Expand All @@ -39,7 +39,7 @@ export function isObjectWithProperties<Thing extends unknown, PropertyName exten
* @param property - The name of the property that should appear in the object.
* @internal
*/
function objectHasProperty<Thing extends unknown, PropertyName extends string>(
function objectHasProperty<Thing, PropertyName extends string>(
thing: Thing,
property: PropertyName
): thing is Thing & Record<PropertyName, unknown> {
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-amqp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"cross-env": "^7.0.2",
"debug": "^4.1.1",
"downlevel-dts": "^0.8.0",
"eslint": "^7.15.0",
"eslint": "^8.0.0",
"karma": "^6.2.0",
"karma-chrome-launcher": "^3.0.0",
"karma-mocha": "^2.0.1",
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/core-amqp/src/util/typeGuards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function isDefined<T>(thing: T | undefined | null): thing is T {
* @param properties - The name of the properties that should appear in the object.
* @internal
*/
export function isObjectWithProperties<Thing extends unknown, PropertyName extends string>(
export function isObjectWithProperties<Thing, PropertyName extends string>(
thing: Thing,
properties: PropertyName[]
): thing is Thing & Record<PropertyName, unknown> {
Expand All @@ -43,7 +43,7 @@ export function isObjectWithProperties<Thing extends unknown, PropertyName exten
* @param property - The name of the property that should appear in the object.
* @internal
*/
export function objectHasProperty<Thing extends unknown, PropertyName extends string>(
export function objectHasProperty<Thing, PropertyName extends string>(
thing: Thing,
property: PropertyName
): thing is Thing & Record<PropertyName, unknown> {
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"chai": "^4.2.0",
"cross-env": "^7.0.2",
"downlevel-dts": "^0.8.0",
"eslint": "^7.15.0",
"eslint": "^8.0.0",
"inherits": "^2.0.3",
"mocha": "^7.1.1",
"mocha-junit-reporter": "^2.0.0",
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/core-auth/src/typeguards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function isDefined<T>(thing: T | undefined | null): thing is T {
* @param properties - The name of the properties that should appear in the object.
* @internal
*/
export function isObjectWithProperties<Thing extends unknown, PropertyName extends string>(
export function isObjectWithProperties<Thing, PropertyName extends string>(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

opportunity for core-util

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logged #21734

thing: Thing,
properties: PropertyName[]
): thing is Thing & Record<PropertyName, unknown> {
Expand All @@ -41,7 +41,7 @@ export function isObjectWithProperties<Thing extends unknown, PropertyName exten
* @param property - The name of the property that should appear in the object.
* @internal
*/
function objectHasProperty<Thing extends unknown, PropertyName extends string>(
function objectHasProperty<Thing, PropertyName extends string>(
thing: Thing,
property: PropertyName
): thing is Thing & Record<PropertyName, unknown> {
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-client-rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"@types/sinon": "^9.0.4",
"chai": "^4.2.0",
"cross-env": "^7.0.2",
"eslint": "^7.15.0",
"eslint": "^8.0.0",
"inherits": "^2.0.3",
"karma-chrome-launcher": "^3.0.0",
"karma-coverage": "^2.0.0",
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/core-client-rest/src/typeGuards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function isDefined<T>(thing: T | undefined | null): thing is T {
* @param properties - The name of the properties that should appear in the object.
* @internal
*/
export function isObjectWithProperties<Thing extends unknown, PropertyName extends string>(
export function isObjectWithProperties<Thing, PropertyName extends string>(
thing: Thing,
properties: PropertyName[]
): thing is Thing & Record<PropertyName, unknown> {
Expand All @@ -39,7 +39,7 @@ export function isObjectWithProperties<Thing extends unknown, PropertyName exten
* @param property - The name of the property that should appear in the object.
* @internal
*/
function objectHasProperty<Thing extends unknown, PropertyName extends string>(
function objectHasProperty<Thing, PropertyName extends string>(
thing: Thing,
property: PropertyName
): thing is Thing & Record<PropertyName, unknown> {
Expand Down
2 changes: 1 addition & 1 deletion sdk/eventhub/event-hubs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
"debug": "^4.1.1",
"dotenv": "^8.2.0",
"downlevel-dts": "^0.8.0",
"eslint": "^7.15.0",
"eslint": "^8.0.0",
"esm": "^3.2.18",
"https-proxy-agent": "^5.0.0",
"karma": "^6.2.0",
Expand Down
4 changes: 2 additions & 2 deletions sdk/eventhub/event-hubs/src/util/typeGuards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function isDefined<T>(thing: T | undefined | null): thing is T {
* @param properties - The name of the properties that should appear in the object.
* @internal
*/
export function isObjectWithProperties<Thing extends unknown, PropertyName extends string>(
export function isObjectWithProperties<Thing, PropertyName extends string>(
thing: Thing,
properties: PropertyName[]
): thing is Thing & Record<PropertyName, unknown> {
Expand All @@ -48,7 +48,7 @@ export function isObjectWithProperties<Thing extends unknown, PropertyName exten
* @param property - The name of the property that should appear in the object.
* @internal
*/
export function objectHasProperty<Thing extends unknown, PropertyName extends string>(
export function objectHasProperty<Thing, PropertyName extends string>(
thing: Thing,
property: PropertyName
): thing is Thing & Record<PropertyName, unknown> {
Expand Down
2 changes: 1 addition & 1 deletion sdk/monitor/monitor-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
"cross-env": "^7.0.2",
"dotenv": "^8.2.0",
"downlevel-dts": "^0.8.0",
"eslint": "^7.15.0",
"eslint": "^8.0.0",
"esm": "^3.2.18",
"inherits": "^2.0.3",
"karma-chrome-launcher": "^3.0.0",
Expand Down
4 changes: 2 additions & 2 deletions sdk/monitor/monitor-query/src/timespanConversion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function convertIntervalToTimeIntervalObject(timespan: string): QueryTime
* @param property - The name of the property that should appear in the object.
* @internal
*/
export function objectHasProperty<Thing extends unknown, PropertyName extends string>(
export function objectHasProperty<Thing, PropertyName extends string>(
thing: Thing,
property: PropertyName
): thing is Thing & Record<PropertyName, unknown> {
Expand All @@ -67,7 +67,7 @@ export function isDefined<T>(thing: T | undefined | null): thing is T {
* @param properties - The name of the properties that should appear in the object.
* @internal
*/
export function isObjectWithProperties<Thing extends unknown, PropertyName extends string>(
export function isObjectWithProperties<Thing, PropertyName extends string>(
thing: Thing,
properties: PropertyName[]
): thing is Thing & Record<PropertyName, unknown> {
Expand Down
2 changes: 1 addition & 1 deletion sdk/servicebus/service-bus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
"debug": "^4.1.1",
"dotenv": "^8.2.0",
"downlevel-dts": "^0.8.0",
"eslint": "^7.15.0",
"eslint": "^8.0.0",
"esm": "^3.2.18",
"glob": "^8.0.0",
"https-proxy-agent": "^5.0.0",
Expand Down
4 changes: 2 additions & 2 deletions sdk/servicebus/service-bus/src/util/typeGuards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function isDefined<T>(thing: T | undefined | null): thing is T {
* @param properties - The name of the properties that should appear in the object.
* @internal
*/
export function isObjectWithProperties<Thing extends unknown, PropertyName extends string>(
export function isObjectWithProperties<Thing, PropertyName extends string>(
thing: Thing,
properties: PropertyName[]
): thing is Thing & Record<PropertyName, unknown> {
Expand All @@ -48,7 +48,7 @@ export function isObjectWithProperties<Thing extends unknown, PropertyName exten
* @param property - The name of the property that should appear in the object.
* @internal
*/
function objectHasProperty<Thing extends unknown, PropertyName extends string>(
function objectHasProperty<Thing, PropertyName extends string>(
thing: Thing,
property: PropertyName
): thing is Thing & Record<PropertyName, unknown> {
Expand Down