diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index af96992b1e09..45b1eacd0c26 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -1558,6 +1558,7 @@ packages: /@opentelemetry/node/0.22.0_@opentelemetry+api@1.0.3: resolution: {integrity: sha512-+HhGbDruQ7cwejVOIYyxRa28uosnG8W95NiQZ6qE8PXXPsDSyGeftAPbtYpGit0H2f5hrVcMlwmWHeAo9xkSLA==} engines: {node: '>=8.0.0'} + deprecated: Package renamed to @opentelemetry/sdk-trace-node peerDependencies: '@opentelemetry/api': ^1.0.0 dependencies: @@ -10609,7 +10610,7 @@ packages: dev: false file:projects/eslint-plugin-azure-sdk.tgz: - resolution: {integrity: sha512-J35xOLMjkbGTj6mKWiUneuknJsBuksy6zGWJGZk9Y4Osvu/qLeMKWELZ7UEr2WIpJBSeTqvJihgvgrIJ0VUkUQ==, tarball: file:projects/eslint-plugin-azure-sdk.tgz} + resolution: {integrity: sha512-nt2PioFhX1erfXVX4YZ3pwvSoTJQP8o2SbpM2dZl3/LgEqzpJ7M8tZ1UzygG/8EwWL3cqdFw5EHwLshSLLbdhA==, tarball: file:projects/eslint-plugin-azure-sdk.tgz} name: '@rush-temp/eslint-plugin-azure-sdk' version: 0.0.0 dependencies: @@ -10638,10 +10639,13 @@ packages: prettier: 1.19.1 rimraf: 3.0.2 source-map-support: 0.5.20 + ts-node: 10.4.0_377e20767e69b752ace82a162788c459 tslib: 2.3.1 typedoc: 0.15.2 typescript: 4.2.4 transitivePeerDependencies: + - '@swc/core' + - '@swc/wasm' - supports-color dev: false diff --git a/common/tools/eslint-plugin-azure-sdk/.eslintrc.json b/common/tools/eslint-plugin-azure-sdk/.eslintrc.json index dfae6b14fee3..da2f0eb7061d 100644 --- a/common/tools/eslint-plugin-azure-sdk/.eslintrc.json +++ b/common/tools/eslint-plugin-azure-sdk/.eslintrc.json @@ -33,6 +33,7 @@ "no-multi-spaces": "error", "no-redeclare": "error", "no-useless-escape": "off", - "prefer-template": "error" + "prefer-template": "error", + "sort-imports": "error" } } diff --git a/common/tools/eslint-plugin-azure-sdk/src/configs/index.ts b/common/tools/eslint-plugin-azure-sdk/src/configs/index.ts index 89977fe833cc..514861113d20 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/configs/index.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/configs/index.ts @@ -48,7 +48,6 @@ export = { "@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-sdktype": "error", "@azure/azure-sdk/ts-package-json-author": "error", "@azure/azure-sdk/ts-package-json-bugs": "error", "@azure/azure-sdk/ts-package-json-engine-is-present": "error", @@ -61,6 +60,8 @@ export = { "@azure/azure-sdk/ts-package-json-name": "error", "@azure/azure-sdk/ts-package-json-repo": "error", "@azure/azure-sdk/ts-package-json-required-scripts": "error", + "@azure/azure-sdk/ts-package-json-sdktype": "error", + "@azure/azure-sdk/ts-package-json-sdktype-exists": "error", "@azure/azure-sdk/ts-package-json-sideeffects": "error", "@azure/azure-sdk/ts-package-json-types": "error", "@azure/azure-sdk/ts-pagination-list": "error", diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/github-source-headers.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/github-source-headers.ts index 680543a56642..91b0413d0da5 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/github-source-headers.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/github-source-headers.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import { Rule } from "eslint"; import { Comment, Node } from "estree"; +import { Rule } from "eslint"; import { getRuleMetaData } from "../utils"; //------------------------------------------------------------------------------ diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/index.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/index.ts index 51c0cd8b11a6..081f48a7cf8a 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/index.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/index.ts @@ -33,7 +33,6 @@ 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 tsPackageJsonSdkType from "./ts-package-json-sdktype"; import tsPackageJsonBugs from "./ts-package-json-bugs"; import tsPackageJsonEngineIsPresent from "./ts-package-json-engine-is-present"; import tsPackageJsonFilesRequired from "./ts-package-json-files-required"; @@ -45,6 +44,8 @@ import tsPackageJsonModule from "./ts-package-json-module"; import tsPackageJsonName from "./ts-package-json-name"; import tsPackageJsonRepo from "./ts-package-json-repo"; import tsPackageJsonRequiredScripts from "./ts-package-json-required-scripts"; +import tsPackageJsonSdkType from "./ts-package-json-sdktype"; +import tsPackageJsonSdkTypeExists from "./ts-package-json-sdktype-exists"; import tsPackageJsonSideEffects from "./ts-package-json-sideeffects"; import tsPackageJsonTypes from "./ts-package-json-types"; import tsPaginationList from "./ts-pagination-list"; @@ -95,6 +96,7 @@ export = { "ts-package-json-name": tsPackageJsonName, "ts-package-json-repo": tsPackageJsonRepo, "ts-package-json-required-scripts": tsPackageJsonRequiredScripts, + "ts-package-json-sdktype-exists": tsPackageJsonSdkTypeExists, "ts-package-json-sideeffects": tsPackageJsonSideEffects, "ts-package-json-types": tsPackageJsonTypes, "ts-pagination-list": tsPaginationList, diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-apiextractor-json-types.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-apiextractor-json-types.ts index b93940b18ba8..573927f225af 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-apiextractor-json-types.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-apiextractor-json-types.ts @@ -7,9 +7,9 @@ * @author Will Temple */ -import { Rule } from "eslint"; -import { Property } from "estree"; import { getRuleMetaData, getVerifiers, stripPath } from "../utils"; +import { Property } from "estree"; +import { Rule } from "eslint"; import { stripFileName } from "../utils/verifiers"; //------------------------------------------------------------------------------ diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-apisurface-standardized-verbs.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-apisurface-standardized-verbs.ts index 7d2d278d7043..65b501fad2df 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-apisurface-standardized-verbs.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-apisurface-standardized-verbs.ts @@ -6,9 +6,9 @@ * @author Arpan Laha */ -import { Rule } from "eslint"; import { ClassDeclaration, Identifier, MethodDefinition } from "estree"; import { getPublicMethods, getRuleMetaData } from "../utils"; +import { Rule } from "eslint"; //------------------------------------------------------------------------------ // Rule Definition diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-apisurface-supportcancellation.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-apisurface-supportcancellation.ts index b37a809adbd5..a67b10cbb05a 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-apisurface-supportcancellation.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-apisurface-supportcancellation.ts @@ -6,12 +6,12 @@ * @author Arpan Laha */ -import { ParserServices, TSESTree } from "@typescript-eslint/experimental-utils"; -import { ParserWeakMapESTreeToTSNode } from "@typescript-eslint/typescript-estree/dist/parser-options"; -import { Rule } from "eslint"; import { ClassDeclaration, Identifier, MethodDefinition } from "estree"; +import { ParserServices, TSESTree } from "@typescript-eslint/experimental-utils"; import { Symbol as TSSymbol, Type, TypeChecker, TypeFlags } from "typescript"; import { getPublicMethods, getRuleMetaData } from "../utils"; +import { ParserWeakMapESTreeToTSNode } from "@typescript-eslint/typescript-estree/dist/parser-options"; +import { Rule } from "eslint"; //------------------------------------------------------------------------------ // Rule Definition diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-allowsyntheticdefaultimports.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-allowsyntheticdefaultimports.ts index 0ea6f1cc012b..9211343da885 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-allowsyntheticdefaultimports.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-allowsyntheticdefaultimports.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import { Rule } from "eslint"; import { getRuleMetaData, getVerifiers, stripPath } from "../utils"; +import { Rule } from "eslint"; //------------------------------------------------------------------------------ // Rule Definition diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-declaration.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-declaration.ts index c2c48f5f4337..fa93caaad89e 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-declaration.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-declaration.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import { Rule } from "eslint"; import { getRuleMetaData, getVerifiers, stripPath } from "../utils"; +import { Rule } from "eslint"; //------------------------------------------------------------------------------ // Rule Definition diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-esmoduleinterop.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-esmoduleinterop.ts index 8dfca2ada58a..46327f5841d0 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-esmoduleinterop.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-esmoduleinterop.ts @@ -6,10 +6,10 @@ * @author Arpan Laha */ -"use strict"; - -import { Rule } from "eslint"; import { getRuleMetaData, getVerifiers, stripPath } from "../utils"; +import { Rule } from "eslint"; + +"use strict"; //------------------------------------------------------------------------------ // Rule Definition diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-exclude.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-exclude.ts index f191c76bd2ec..f331e88c7f76 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-exclude.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-exclude.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import { Rule } from "eslint"; import { getRuleMetaData, getVerifiers, stripPath } from "../utils"; +import { Rule } from "eslint"; //------------------------------------------------------------------------------ // Rule Definition diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-forceconsistentcasinginfilenames.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-forceconsistentcasinginfilenames.ts index f13edb84aaee..cffa44f1e1ba 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-forceconsistentcasinginfilenames.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-forceconsistentcasinginfilenames.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import { Rule } from "eslint"; import { getRuleMetaData, getVerifiers, stripPath } from "../utils"; +import { Rule } from "eslint"; //------------------------------------------------------------------------------ // Rule Definition diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-importhelpers.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-importhelpers.ts index b8be7ceb5097..ff36b0039525 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-importhelpers.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-importhelpers.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import { Rule } from "eslint"; import { getRuleMetaData, getVerifiers, stripPath } from "../utils"; +import { Rule } from "eslint"; //------------------------------------------------------------------------------ // Rule Definition diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-lib.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-lib.ts index 428b38b0c5d4..356616cf6522 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-lib.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-lib.ts @@ -6,9 +6,9 @@ * @author Arpan Laha */ -import { Rule } from "eslint"; import { ArrayExpression, Property } from "estree"; import { getRuleMetaData, getVerifiers, stripPath } from "../utils"; +import { Rule } from "eslint"; //------------------------------------------------------------------------------ // Rule Definition diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-module.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-module.ts index 75662279273b..4943fe412845 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-module.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-module.ts @@ -6,9 +6,9 @@ * @author Arpan Laha */ -import { Rule } from "eslint"; import { Literal, Property } from "estree"; import { getRuleMetaData, getVerifiers, stripPath } from "../utils"; +import { Rule } from "eslint"; //------------------------------------------------------------------------------ // Rule Definition diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-moduleresolution.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-moduleresolution.ts index e3f8b6295dac..85e135effd4f 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-moduleresolution.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-moduleresolution.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import { Rule } from "eslint"; import { getRuleMetaData, getVerifiers, stripPath } from "../utils"; +import { Rule } from "eslint"; //------------------------------------------------------------------------------ // Rule Definition diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-no-experimentaldecorators.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-no-experimentaldecorators.ts index 18f573f060b5..81817c0518ec 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-no-experimentaldecorators.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-no-experimentaldecorators.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import { Rule } from "eslint"; import { getRuleMetaData, getVerifiers, stripPath } from "../utils"; +import { Rule } from "eslint"; //------------------------------------------------------------------------------ // Rule Definition diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-sourcemap.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-sourcemap.ts index 747de80c48df..1833d4a7480b 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-sourcemap.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-sourcemap.ts @@ -6,9 +6,9 @@ * @author Arpan Laha */ -import { Rule } from "eslint"; -import { Property } from "estree"; import { getRuleMetaData, getVerifiers, stripPath } from "../utils"; +import { Property } from "estree"; +import { Rule } from "eslint"; //------------------------------------------------------------------------------ // Rule Definition diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-strict.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-strict.ts index 768ae66e3f03..ae9efba682c5 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-strict.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-strict.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import { Rule } from "eslint"; import { getRuleMetaData, getVerifiers, stripPath } from "../utils"; +import { Rule } from "eslint"; //------------------------------------------------------------------------------ // Rule Definition diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-target.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-target.ts index 2389b940ba4c..af78af815b94 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-target.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-config-target.ts @@ -6,9 +6,9 @@ * @author Arpan Laha */ -import { Rule } from "eslint"; -import { Property } from "estree"; import { getRuleMetaData, getVerifiers, stripPath } from "../utils"; +import { Property } from "estree"; +import { Rule } from "eslint"; //------------------------------------------------------------------------------ // Rule Definition diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-doc-internal.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-doc-internal.ts index db553fe832a6..6a07b14fcbbb 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-doc-internal.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-doc-internal.ts @@ -7,14 +7,14 @@ */ import { ParserServices, TSESTree } from "@typescript-eslint/experimental-utils"; +import { getLocalExports, getRuleMetaData } from "../utils"; +import { Node } from "estree"; import { ParserWeakMapESTreeToTSNode } from "@typescript-eslint/typescript-estree/dist/parser-options"; import { Rule } from "eslint"; -import { Node } from "estree"; -import { readFileSync } from "fs"; +import { TypeChecker } from "typescript"; import { sync as globSync } from "glob"; +import { readFileSync } from "fs"; import { relative } from "path"; -import { TypeChecker } from "typescript"; -import { getLocalExports, getRuleMetaData } from "../utils"; //------------------------------------------------------------------------------ // Rule Definition diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-error-handling.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-error-handling.ts index 683ee342d4a7..ab5c94d0457c 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-error-handling.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-error-handling.ts @@ -6,9 +6,9 @@ * @author Arpan Laha */ +import { Identifier, NewExpression, ThrowStatement } from "estree"; import { ParserServices, TSESTree } from "@typescript-eslint/experimental-utils"; import { Rule } from "eslint"; -import { Identifier, NewExpression, ThrowStatement } from "estree"; import { getRuleMetaData } from "../utils"; //------------------------------------------------------------------------------ diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-modules-only-named.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-modules-only-named.ts index fae0b7706eed..72fe5f927376 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-modules-only-named.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-modules-only-named.ts @@ -6,9 +6,9 @@ * @author Arpan Laha */ -import { Rule } from "eslint"; -import { ExportDefaultDeclaration } from "estree"; import { normalize, relative } from "path"; +import { ExportDefaultDeclaration } from "estree"; +import { Rule } from "eslint"; import { getRuleMetaData } from "../utils"; //------------------------------------------------------------------------------ diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-naming-drop-noun.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-naming-drop-noun.ts index 26a92904ab16..e44792d78107 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-naming-drop-noun.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-naming-drop-noun.ts @@ -6,10 +6,10 @@ * @author Arpan Laha */ -import { TSESTree } from "@typescript-eslint/experimental-utils"; -import { Rule } from "eslint"; import { ClassDeclaration, Identifier, MethodDefinition } from "estree"; import { getPublicMethods, getRuleMetaData } from "../utils"; +import { Rule } from "eslint"; +import { TSESTree } from "@typescript-eslint/experimental-utils"; //------------------------------------------------------------------------------ // Rule Definition diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-naming-options.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-naming-options.ts index 1303e07ade0c..ce5baab1f0ea 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-naming-options.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-naming-options.ts @@ -6,10 +6,10 @@ * @author Arpan Laha */ -import { ParserServices, TSESTree } from "@typescript-eslint/experimental-utils"; -import { Rule } from "eslint"; import { ClassDeclaration, Identifier, MethodDefinition } from "estree"; +import { ParserServices, TSESTree } from "@typescript-eslint/experimental-utils"; import { getPublicMethods, getRuleMetaData } from "../utils"; +import { Rule } from "eslint"; //------------------------------------------------------------------------------ // Rule Definition diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-naming-subclients.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-naming-subclients.ts index 1464f63c0ffc..0482de392f9c 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-naming-subclients.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-naming-subclients.ts @@ -6,10 +6,10 @@ * @author Arpan Laha */ -import { TSESTree } from "@typescript-eslint/experimental-utils"; -import { Rule } from "eslint"; import { ClassDeclaration, Identifier, MethodDefinition } from "estree"; import { getPublicMethods, getRuleMetaData } from "../utils"; +import { Rule } from "eslint"; +import { TSESTree } from "@typescript-eslint/experimental-utils"; //------------------------------------------------------------------------------ // Rule Definition diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-author.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-author.ts index 19e381ac3338..b5501abf35e7 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-author.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-author.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import { Rule } from "eslint"; import { getRuleMetaData, getVerifiers, stripPath } from "../utils"; +import { Rule } from "eslint"; //------------------------------------------------------------------------------ // Rule Definition diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-bugs.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-bugs.ts index 78846d11d4b6..5d4bb729c124 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-bugs.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-bugs.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import { Rule } from "eslint"; import { getRuleMetaData, getVerifiers, stripPath } from "../utils"; +import { Rule } from "eslint"; //------------------------------------------------------------------------------ // Rule Definition diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-engine-is-present.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-engine-is-present.ts index c0cac04ac69f..a3c610e2a47b 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-engine-is-present.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-engine-is-present.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import { Rule } from "eslint"; import { getRuleMetaData, getVerifiers, stripPath } from "../utils"; +import { Rule } from "eslint"; /** * definition of LTS Node versions diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-files-required.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-files-required.ts index 5759d2989711..9100244b47fd 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-files-required.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-files-required.ts @@ -6,9 +6,9 @@ * @author Arpan Laha */ -import { Rule } from "eslint"; import { Literal, Property } from "estree"; import { arrayToString, getRuleMetaData, getVerifiers, stripPath } from "../utils"; +import { Rule } from "eslint"; //------------------------------------------------------------------------------ // Rule Definition diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-homepage.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-homepage.ts index ed343b7d9721..96f15fb644bd 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-homepage.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-homepage.ts @@ -6,9 +6,9 @@ * @author Arpan Laha */ +import { Literal, Property } from "estree"; import { getRuleMetaData, getVerifiers, stripPath } from "../utils"; import { Rule } from "eslint"; -import { Literal, Property } from "estree"; //------------------------------------------------------------------------------ // Rule Definition diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-keywords.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-keywords.ts index a8ce344f3c99..51e35fc2cf13 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-keywords.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-keywords.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import { Rule } from "eslint"; import { getRuleMetaData, getVerifiers, stripPath } from "../utils"; +import { Rule } from "eslint"; //------------------------------------------------------------------------------ // Rule Definition diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-license.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-license.ts index 2b95be8bfe3c..c439f14813ff 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-license.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-license.ts @@ -6,8 +6,8 @@ * @license Arpan Laha */ -import { Rule } from "eslint"; import { getRuleMetaData, getVerifiers, stripPath } from "../utils"; +import { Rule } from "eslint"; //------------------------------------------------------------------------------ // Rule Definition diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-main-is-cjs.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-main-is-cjs.ts index 445e626df4ce..9a2ec2881c3f 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-main-is-cjs.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-main-is-cjs.ts @@ -6,9 +6,9 @@ * @author Arpan Laha */ -import { Rule } from "eslint"; import { Literal, Property } from "estree"; import { getRuleMetaData, getVerifiers, stripPath } from "../utils"; +import { Rule } from "eslint"; //------------------------------------------------------------------------------ // Rule Definition diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-module.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-module.ts index 3e9f0a47adc4..76f2c8ebd873 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-module.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-module.ts @@ -6,9 +6,9 @@ * @author Arpan Laha */ -import { Rule } from "eslint"; import { Literal, Property } from "estree"; import { getRuleMetaData, getVerifiers, stripPath } from "../utils"; +import { Rule } from "eslint"; //------------------------------------------------------------------------------ // Rule Definition diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-name.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-name.ts index 0475c46186bc..117d1a818069 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-name.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-name.ts @@ -6,9 +6,9 @@ * @author Arpan Laha */ -import { Rule } from "eslint"; import { Literal, Property } from "estree"; import { getRuleMetaData, getVerifiers, stripPath } from "../utils"; +import { Rule } from "eslint"; import { stripFileName } from "../utils/verifiers"; //------------------------------------------------------------------------------ diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-repo.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-repo.ts index f95ac5c2d765..c275b4788666 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-repo.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-repo.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import { Rule } from "eslint"; import { getRuleMetaData, getVerifiers, stripPath } from "../utils"; +import { Rule } from "eslint"; //------------------------------------------------------------------------------ // Rule Definition diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-required-scripts.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-required-scripts.ts index fa25a9afb650..3c952850f9ff 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-required-scripts.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-required-scripts.ts @@ -6,9 +6,9 @@ * @author Arpan Laha */ -import { Rule } from "eslint"; -import { Property } from "estree"; import { getRuleMetaData, getVerifiers, stripPath } from "../utils"; +import { Property } from "estree"; +import { Rule } from "eslint"; //------------------------------------------------------------------------------ // Rule Definition diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-sdktype-exists.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-sdktype-exists.ts new file mode 100644 index 000000000000..0c34d219aca0 --- /dev/null +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-sdktype-exists.ts @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +/** + * @file Rule to check if package.json includes 'sdk-type' + * @author Ben Zhang + */ + +import { getRuleMetaData, getVerifiers, stripPath } from "../utils"; +import { Rule } from "eslint"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +export = { + meta: getRuleMetaData( + "ts-package-json-sdktype-exists", + "check if package.json includes 'sdk-type'", + "code" + ), + create: (context: Rule.RuleContext): Rule.RuleListener => { + const verifiers = getVerifiers(context, { + outer: "sdk-type", + }); + return stripPath(context.getFilename()) === "package.json" + ? ({ + // callback functions + + // check to see if package.json includes 'sdk-type' + "ExpressionStatement > ObjectExpression": verifiers.existsInFile, + } as Rule.RuleListener) + : {}; + } +}; diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-sdktype.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-sdktype.ts index 7505d9312785..ac436fccfa2a 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-sdktype.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-sdktype.ts @@ -6,9 +6,9 @@ * @author Arpan Laha */ -import { Rule } from "eslint"; -import { Property } from "estree"; import { getRuleMetaData, stripPath } from "../utils"; +import { Property } from "estree"; +import { Rule } from "eslint"; //------------------------------------------------------------------------------ // Rule Definition diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-sideeffects.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-sideeffects.ts index 9d6296365aab..6d27587e10f2 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-sideeffects.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-sideeffects.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import { Rule } from "eslint"; import { getRuleMetaData, getVerifiers, stripPath } from "../utils"; +import { Rule } from "eslint"; //------------------------------------------------------------------------------ // Rule Definition diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-types.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-types.ts index ab685f079368..7b211816488d 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-types.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-package-json-types.ts @@ -6,9 +6,9 @@ * @author Arpan Laha */ -import { Rule } from "eslint"; -import { Property } from "estree"; import { getRuleMetaData, getVerifiers, stripPath } from "../utils"; +import { Property } from "estree"; +import { Rule } from "eslint"; import { stripFileName } from "../utils/verifiers"; //------------------------------------------------------------------------------ diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-pagination-list.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-pagination-list.ts index 9fd6529b4820..511f3c91f659 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-pagination-list.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-pagination-list.ts @@ -6,9 +6,9 @@ * @author Arpan Laha */ -import { TSESTree } from "@typescript-eslint/experimental-utils"; -import { Rule } from "eslint"; import { Identifier, MethodDefinition } from "estree"; +import { Rule } from "eslint"; +import { TSESTree } from "@typescript-eslint/experimental-utils"; import { getRuleMetaData } from "../utils"; //------------------------------------------------------------------------------ diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-use-interface-parameters.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-use-interface-parameters.ts index 0f3c1437c57a..b78fa5e0cda5 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-use-interface-parameters.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-use-interface-parameters.ts @@ -6,12 +6,20 @@ * @author Arpan Laha */ -import { ParserServices, TSESTree } from "@typescript-eslint/experimental-utils"; import { - ParserWeakMapESTreeToTSNode, - ParserWeakMap -} from "@typescript-eslint/typescript-estree/dist/parser-options"; -import { Rule } from "eslint"; + Declaration, + Modifier, + PropertySignature, + SymbolFlags, + SyntaxKind, + Node as TSNode, + Symbol as TSSymbol, + Type, + TypeChecker, + TypeReference, + TypeReferenceNode, + isArrayTypeNode +} from "typescript"; import { FunctionDeclaration, FunctionExpression, @@ -19,20 +27,12 @@ import { MethodDefinition, Pattern } from "estree"; +import { ParserServices, TSESTree } from "@typescript-eslint/experimental-utils"; import { - Declaration, - isArrayTypeNode, - Node as TSNode, - PropertySignature, - Symbol as TSSymbol, - SymbolFlags, - Type, - TypeChecker, - TypeReferenceNode, - TypeReference, - Modifier, - SyntaxKind -} from "typescript"; + ParserWeakMap, + ParserWeakMapESTreeToTSNode +} from "@typescript-eslint/typescript-estree/dist/parser-options"; +import { Rule } from "eslint"; import { getRuleMetaData } from "../utils"; //------------------------------------------------------------------------------ diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-use-promises.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-use-promises.ts index 8b4aafb4c8eb..1f588dc05fcc 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-use-promises.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-use-promises.ts @@ -8,8 +8,8 @@ import { ParserServices } from "@typescript-eslint/experimental-utils"; import { Rule } from "eslint"; -import { isExternalModule } from "typescript"; import { getRuleMetaData } from "../utils"; +import { isExternalModule } from "typescript"; //------------------------------------------------------------------------------ // Rule Definition diff --git a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-versioning-semver.ts b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-versioning-semver.ts index 0efe360eae2b..42ab0fd70d9f 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/rules/ts-versioning-semver.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/rules/ts-versioning-semver.ts @@ -6,9 +6,9 @@ * @author Arpan Laha */ -import { Rule } from "eslint"; -import { Property } from "estree"; import { getRuleMetaData, getVerifiers, stripPath } from "../utils"; +import { Property } from "estree"; +import { Rule } from "eslint"; //------------------------------------------------------------------------------ // Rule Definition diff --git a/common/tools/eslint-plugin-azure-sdk/src/utils/exports.ts b/common/tools/eslint-plugin-azure-sdk/src/utils/exports.ts index f2cb9235064f..4ac31a102ad9 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/utils/exports.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/utils/exports.ts @@ -6,10 +6,10 @@ * @author Arpan Laha */ +import { ClassDeclaration, MethodDefinition } from "estree"; import { ParserServices, TSESTree } from "@typescript-eslint/experimental-utils"; -import { Rule } from "eslint"; import { SourceFile, Symbol as TSSymbol } from "typescript"; -import { ClassDeclaration, MethodDefinition } from "estree"; +import { Rule } from "eslint"; /** * Gets all Symbols of Types of all top-level exports from a package. diff --git a/common/tools/eslint-plugin-azure-sdk/src/utils/metadata.ts b/common/tools/eslint-plugin-azure-sdk/src/utils/metadata.ts index 4447a459fecf..0f282bbf137d 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/utils/metadata.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/utils/metadata.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import { Rule } from "eslint"; import { JSONSchema4 } from "json-schema"; +import { Rule } from "eslint"; export const getRuleMetaData = ( ruleName: string, diff --git a/common/tools/eslint-plugin-azure-sdk/src/utils/verifiers.ts b/common/tools/eslint-plugin-azure-sdk/src/utils/verifiers.ts index efbda6dc55bd..e95b218a566a 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/utils/verifiers.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/utils/verifiers.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import { Rule } from "eslint"; import { ArrayExpression, Literal, ObjectExpression, Property, SpreadElement } from "estree"; +import { Rule } from "eslint"; interface StructureData { outer: string; diff --git a/common/tools/eslint-plugin-azure-sdk/tests/plugin.ts b/common/tools/eslint-plugin-azure-sdk/tests/plugin.ts index 603dc30647fe..a7ae50426dd0 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/plugin.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/plugin.ts @@ -6,9 +6,9 @@ * @author Arpan Laha */ -import plugin from "../src"; import { describe, it } from "mocha"; import { assert } from "chai"; +import plugin from "../src"; /** * A list of all currently supported rules @@ -41,7 +41,6 @@ const ruleList = [ "ts-no-namespaces", "ts-no-window", "ts-package-json-author", - "ts-package-json-sdktype", "ts-package-json-bugs", "ts-package-json-engine-is-present", "ts-package-json-files-required", @@ -53,6 +52,8 @@ const ruleList = [ "ts-package-json-name", "ts-package-json-repo", "ts-package-json-required-scripts", + "ts-package-json-sdktype", + "ts-package-json-sdktype-exists", "ts-package-json-sideeffects", "ts-package-json-types", "ts-pagination-list", diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/github-source-headers.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/github-source-headers.ts index ac0ae2aaf34f..1435b85c849b 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/github-source-headers.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/github-source-headers.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import rule from "../../src/rules/github-source-headers"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/github-source-headers"; //------------------------------------------------------------------------------ // Tests diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-apiextractor-json-types.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-apiextractor-json-types.ts index b4f44765d305..2d83af9e137c 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-apiextractor-json-types.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-apiextractor-json-types.ts @@ -7,8 +7,8 @@ * @author Will Temple */ -import rule from "../../src/rules/ts-apiextractor-json-types"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-apiextractor-json-types"; //------------------------------------------------------------------------------ // Example files diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-apisurface-standardized-verbs.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-apisurface-standardized-verbs.ts index 9ad73c94764a..c137a469501f 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-apisurface-standardized-verbs.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-apisurface-standardized-verbs.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-apisurface-standardized-verbs"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-apisurface-standardized-verbs"; //------------------------------------------------------------------------------ // Tests diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-apisurface-supportcancellation.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-apisurface-supportcancellation.ts index 3c6916ffa124..69d8a63c750b 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-apisurface-supportcancellation.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-apisurface-supportcancellation.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-apisurface-supportcancellation"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-apisurface-supportcancellation"; //------------------------------------------------------------------------------ // Tests diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-allowsyntheticdefaultimports.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-allowsyntheticdefaultimports.ts index 1f30c46f5bb4..60b0690181d8 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-allowsyntheticdefaultimports.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-allowsyntheticdefaultimports.ts @@ -8,8 +8,8 @@ "use strict"; -import rule from "../../src/rules/ts-config-allowsyntheticdefaultimports"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-config-allowsyntheticdefaultimports"; //------------------------------------------------------------------------------ // Example files diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-declaration.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-declaration.ts index b840e1d06cf1..0d1141087fc1 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-declaration.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-declaration.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-config-declaration"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-config-declaration"; //------------------------------------------------------------------------------ // Example files diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-esmoduleinterop.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-esmoduleinterop.ts index 59ea46aa9b35..231effd2e088 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-esmoduleinterop.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-esmoduleinterop.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-config-esmoduleinterop"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-config-esmoduleinterop"; //------------------------------------------------------------------------------ // Example files diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-exclude.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-exclude.ts index 3f1a19915792..0140b9c40bc0 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-exclude.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-exclude.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-config-exclude"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-config-exclude"; //------------------------------------------------------------------------------ // Example files diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-forceconsistentcasinginfilenames.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-forceconsistentcasinginfilenames.ts index 6102f7c0b063..37e5106badb1 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-forceconsistentcasinginfilenames.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-forceconsistentcasinginfilenames.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-config-forceconsistentcasinginfilenames"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-config-forceconsistentcasinginfilenames"; //------------------------------------------------------------------------------ // Example files diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-importhelpers.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-importhelpers.ts index 6e619a93b15b..b88b2a622a6c 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-importhelpers.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-importhelpers.ts @@ -8,8 +8,8 @@ "use strict"; -import rule from "../../src/rules/ts-config-importhelpers"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-config-importhelpers"; //------------------------------------------------------------------------------ // Example files diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-lib.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-lib.ts index f589fe640769..c9f394d3158c 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-lib.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-lib.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-config-lib"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-config-lib"; //------------------------------------------------------------------------------ // Example files diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-module.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-module.ts index 992b9bb6f5fe..c08a80994c30 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-module.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-module.ts @@ -8,8 +8,8 @@ "use strict"; -import rule from "../../src/rules/ts-config-module"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-config-module"; //------------------------------------------------------------------------------ // Example files diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-moduleresolution.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-moduleresolution.ts index c12114f9c2e9..bab7fb748ca9 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-moduleresolution.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-moduleresolution.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-config-moduleresolution"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-config-moduleresolution"; //------------------------------------------------------------------------------ // Example files diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-no-experimentaldecorators.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-no-experimentaldecorators.ts index 22588193fa06..c990c13e17be 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-no-experimentaldecorators.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-no-experimentaldecorators.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-config-no-experimentaldecorators"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-config-no-experimentaldecorators"; //------------------------------------------------------------------------------ // Example files diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-sourcemap.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-sourcemap.ts index 53aacf680c3d..dcaccf6d7aa9 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-sourcemap.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-sourcemap.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-config-sourcemap"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-config-sourcemap"; //------------------------------------------------------------------------------ // Example files diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-strict.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-strict.ts index b0ce32f35636..590e81aa8e78 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-strict.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-strict.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-config-strict"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-config-strict"; //------------------------------------------------------------------------------ // Example files diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-target.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-target.ts index 0c2fd5d0819c..abafd3f6fc23 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-target.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-config-target.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-config-target"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-config-target"; //------------------------------------------------------------------------------ // Example files diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-doc-internal.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-doc-internal.ts index fcd464a1965b..fda524621e45 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-doc-internal.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-doc-internal.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-doc-internal"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-doc-internal"; //------------------------------------------------------------------------------ // Tests diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-error-handling.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-error-handling.ts index 4aa482b70811..d3fce03f0b9c 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-error-handling.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-error-handling.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-error-handling"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-error-handling"; //------------------------------------------------------------------------------ // Tests diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-modules-only-named.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-modules-only-named.ts index b5048f15cefd..dbe723cb6b59 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-modules-only-named.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-modules-only-named.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-modules-only-named"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-modules-only-named"; //------------------------------------------------------------------------------ // Tests diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-naming-drop-noun.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-naming-drop-noun.ts index 7f8498f6154b..2e6c01bff5f8 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-naming-drop-noun.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-naming-drop-noun.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-naming-drop-noun"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-naming-drop-noun"; //------------------------------------------------------------------------------ // Tests diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-naming-options.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-naming-options.ts index 128c8fe7a171..7c8bdeaaad1b 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-naming-options.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-naming-options.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-naming-options"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-naming-options"; //------------------------------------------------------------------------------ // Tests diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-naming-subclients.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-naming-subclients.ts index cbfa551df3dd..757d9b3eb5ae 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-naming-subclients.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-naming-subclients.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-naming-subclients"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-naming-subclients"; //------------------------------------------------------------------------------ // Tests diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-no-const-enums.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-no-const-enums.ts index 9a6fec883870..8ec7334462e0 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-no-const-enums.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-no-const-enums.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-no-const-enums"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-no-const-enums"; //------------------------------------------------------------------------------ // Tests diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-no-namespaces.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-no-namespaces.ts index 3e3f3b79b6ec..e3913bac0a04 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-no-namespaces.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-no-namespaces.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-no-namespaces"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-no-namespaces"; //------------------------------------------------------------------------------ // Tests diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-no-window.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-no-window.ts index 1029d49c658a..d877b1f2d075 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-no-window.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-no-window.ts @@ -6,8 +6,8 @@ * @author Maor Leger */ -import rule from "../../src/rules/ts-no-window"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-no-window"; //------------------------------------------------------------------------------ // Tests diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-author.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-author.ts index 09bb3bffa4ea..138ca9c7fbb0 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-author.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-author.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-package-json-author"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-package-json-author"; //------------------------------------------------------------------------------ // Example files @@ -80,7 +80,7 @@ const examplePackageGood = `{ "eslint-detailed-reporter": "^0.8.0", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-only-tests": "^2.3.0", - "eslint-plugin-promise": "^4.1.1", + "eslint-plugin-promise": "^4.1.1", "https-proxy-agent": "^2.2.1", "karma": "^4.0.1", "karma-chrome-launcher": "^2.2.0", @@ -193,7 +193,7 @@ const examplePackageBad = `{ "eslint-detailed-reporter": "^0.8.0", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-only-tests": "^2.3.0", - "eslint-plugin-promise": "^4.1.1", + "eslint-plugin-promise": "^4.1.1", "https-proxy-agent": "^2.2.1", "karma": "^4.0.1", "karma-chrome-launcher": "^2.2.0", diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-bugs.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-bugs.ts index 0d635c19ab45..4237f9fd0499 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-bugs.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-bugs.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-package-json-bugs"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-package-json-bugs"; //------------------------------------------------------------------------------ // Example files @@ -80,7 +80,7 @@ const examplePackageGood = `{ "eslint-detailed-reporter": "^0.8.0", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-only-tests": "^2.3.0", - "eslint-plugin-promise": "^4.1.1", + "eslint-plugin-promise": "^4.1.1", "https-proxy-agent": "^2.2.1", "karma": "^4.0.1", "karma-chrome-launcher": "^2.2.0", @@ -193,7 +193,7 @@ const examplePackageBad = `{ "eslint-detailed-reporter": "^0.8.0", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-only-tests": "^2.3.0", - "eslint-plugin-promise": "^4.1.1", + "eslint-plugin-promise": "^4.1.1", "https-proxy-agent": "^2.2.1", "karma": "^4.0.1", "karma-chrome-launcher": "^2.2.0", diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-engine-is-present.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-engine-is-present.ts index 78d132fe886d..147fdea60556 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-engine-is-present.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-engine-is-present.ts @@ -8,8 +8,8 @@ "use strict"; -import rule from "../../src/rules/ts-package-json-engine-is-present"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-package-json-engine-is-present"; //------------------------------------------------------------------------------ // Example files @@ -82,7 +82,7 @@ const examplePackageGood = `{ "eslint-detailed-reporter": "^0.8.0", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-only-tests": "^2.3.0", - "eslint-plugin-promise": "^4.1.1", + "eslint-plugin-promise": "^4.1.1", "https-proxy-agent": "^2.2.1", "karma": "^4.0.1", "karma-chrome-launcher": "^2.2.0", @@ -195,7 +195,7 @@ const examplePackageBad = `{ "eslint-detailed-reporter": "^0.8.0", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-only-tests": "^2.3.0", - "eslint-plugin-promise": "^4.1.1", + "eslint-plugin-promise": "^4.1.1", "https-proxy-agent": "^2.2.1", "karma": "^4.0.1", "karma-chrome-launcher": "^2.2.0", diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-files-required.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-files-required.ts index 8c7e98813c03..7369ddebd163 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-files-required.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-files-required.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-package-json-files-required"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-package-json-files-required"; //------------------------------------------------------------------------------ // Example files @@ -80,7 +80,7 @@ const examplePackageGood = `{ "eslint-detailed-reporter": "^0.8.0", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-only-tests": "^2.3.0", - "eslint-plugin-promise": "^4.1.1", + "eslint-plugin-promise": "^4.1.1", "https-proxy-agent": "^2.2.1", "karma": "^4.0.1", "karma-chrome-launcher": "^2.2.0", @@ -192,7 +192,7 @@ const examplePackageBad = `{ "eslint-detailed-reporter": "^0.8.0", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-only-tests": "^2.3.0", - "eslint-plugin-promise": "^4.1.1", + "eslint-plugin-promise": "^4.1.1", "https-proxy-agent": "^2.2.1", "karma": "^4.0.1", "karma-chrome-launcher": "^2.2.0", @@ -302,7 +302,7 @@ const examplePackageBadFixed = `{ "eslint-detailed-reporter": "^0.8.0", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-only-tests": "^2.3.0", - "eslint-plugin-promise": "^4.1.1", + "eslint-plugin-promise": "^4.1.1", "https-proxy-agent": "^2.2.1", "karma": "^4.0.1", "karma-chrome-launcher": "^2.2.0", diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-homepage.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-homepage.ts index cd9560c92351..6f32e1402c2d 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-homepage.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-homepage.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-package-json-homepage"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-package-json-homepage"; //------------------------------------------------------------------------------ // Example files @@ -80,7 +80,7 @@ const examplePackageGood = `{ "eslint-detailed-reporter": "^0.8.0", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-only-tests": "^2.3.0", - "eslint-plugin-promise": "^4.1.1", + "eslint-plugin-promise": "^4.1.1", "https-proxy-agent": "^2.2.1", "karma": "^4.0.1", "karma-chrome-launcher": "^2.2.0", @@ -193,7 +193,7 @@ const examplePackageBad = `{ "eslint-detailed-reporter": "^0.8.0", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-only-tests": "^2.3.0", - "eslint-plugin-promise": "^4.1.1", + "eslint-plugin-promise": "^4.1.1", "https-proxy-agent": "^2.2.1", "karma": "^4.0.1", "karma-chrome-launcher": "^2.2.0", diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-keywords.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-keywords.ts index 24a3ce30e4e2..95da15276b76 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-keywords.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-keywords.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-package-json-keywords"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-package-json-keywords"; //------------------------------------------------------------------------------ // Example files @@ -78,7 +78,7 @@ const examplePackageGood = `{ "eslint-detailed-reporter": "^0.8.0", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-only-tests": "^2.3.0", - "eslint-plugin-promise": "^4.1.1", + "eslint-plugin-promise": "^4.1.1", "https-proxy-agent": "^2.2.1", "karma": "^4.0.1", "karma-chrome-launcher": "^2.2.0", @@ -186,7 +186,7 @@ const examplePackageBad = `{ "eslint-detailed-reporter": "^0.8.0", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-only-tests": "^2.3.0", - "eslint-plugin-promise": "^4.1.1", + "eslint-plugin-promise": "^4.1.1", "https-proxy-agent": "^2.2.1", "karma": "^4.0.1", "karma-chrome-launcher": "^2.2.0", @@ -294,7 +294,7 @@ const examplePackageBadFixed = `{ "eslint-detailed-reporter": "^0.8.0", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-only-tests": "^2.3.0", - "eslint-plugin-promise": "^4.1.1", + "eslint-plugin-promise": "^4.1.1", "https-proxy-agent": "^2.2.1", "karma": "^4.0.1", "karma-chrome-launcher": "^2.2.0", diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-license.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-license.ts index 5e0117ae8bb1..3c6c62d47020 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-license.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-license.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-package-json-license"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-package-json-license"; //------------------------------------------------------------------------------ // Example files @@ -80,7 +80,7 @@ const examplePackageGood = `{ "eslint-detailed-reporter": "^0.8.0", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-only-tests": "^2.3.0", - "eslint-plugin-promise": "^4.1.1", + "eslint-plugin-promise": "^4.1.1", "https-proxy-agent": "^2.2.1", "karma": "^4.0.1", "karma-chrome-launcher": "^2.2.0", @@ -193,7 +193,7 @@ const examplePackageBad = `{ "eslint-detailed-reporter": "^0.8.0", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-only-tests": "^2.3.0", - "eslint-plugin-promise": "^4.1.1", + "eslint-plugin-promise": "^4.1.1", "https-proxy-agent": "^2.2.1", "karma": "^4.0.1", "karma-chrome-launcher": "^2.2.0", diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-main-is-cjs.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-main-is-cjs.ts index 11ab7740972b..7be52a75c58d 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-main-is-cjs.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-main-is-cjs.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-package-json-main-is-cjs"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-package-json-main-is-cjs"; //------------------------------------------------------------------------------ // Example files @@ -80,7 +80,7 @@ const examplePackageGood = `{ "eslint-detailed-reporter": "^0.8.0", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-only-tests": "^2.3.0", - "eslint-plugin-promise": "^4.1.1", + "eslint-plugin-promise": "^4.1.1", "https-proxy-agent": "^2.2.1", "karma": "^4.0.1", "karma-chrome-launcher": "^2.2.0", @@ -193,7 +193,7 @@ const examplePackageBad = `{ "eslint-detailed-reporter": "^0.8.0", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-only-tests": "^2.3.0", - "eslint-plugin-promise": "^4.1.1", + "eslint-plugin-promise": "^4.1.1", "https-proxy-agent": "^2.2.1", "karma": "^4.0.1", "karma-chrome-launcher": "^2.2.0", diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-module.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-module.ts index 3c032bea6b71..2fca4464f7dd 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-module.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-module.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-package-json-module"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-package-json-module"; //------------------------------------------------------------------------------ // Example files @@ -80,7 +80,7 @@ const examplePackageGood = `{ "eslint-detailed-reporter": "^0.8.0", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-only-tests": "^2.3.0", - "eslint-plugin-promise": "^4.1.1", + "eslint-plugin-promise": "^4.1.1", "https-proxy-agent": "^2.2.1", "karma": "^4.0.1", "karma-chrome-launcher": "^2.2.0", @@ -193,7 +193,7 @@ const examplePackageBad = `{ "eslint-detailed-reporter": "^0.8.0", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-only-tests": "^2.3.0", - "eslint-plugin-promise": "^4.1.1", + "eslint-plugin-promise": "^4.1.1", "https-proxy-agent": "^2.2.1", "karma": "^4.0.1", "karma-chrome-launcher": "^2.2.0", diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-name.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-name.ts index 8635abe36e11..633c1f22b1dd 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-name.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-name.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-package-json-name"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-package-json-name"; //------------------------------------------------------------------------------ // Example files @@ -80,7 +80,7 @@ const examplePackageGood = `{ "eslint-detailed-reporter": "^0.8.0", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-only-tests": "^2.3.0", - "eslint-plugin-promise": "^4.1.1", + "eslint-plugin-promise": "^4.1.1", "https-proxy-agent": "^2.2.1", "karma": "^4.0.1", "karma-chrome-launcher": "^2.2.0", @@ -193,7 +193,7 @@ const examplePackageBad = `{ "eslint-detailed-reporter": "^0.8.0", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-only-tests": "^2.3.0", - "eslint-plugin-promise": "^4.1.1", + "eslint-plugin-promise": "^4.1.1", "https-proxy-agent": "^2.2.1", "karma": "^4.0.1", "karma-chrome-launcher": "^2.2.0", diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-repo.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-repo.ts index 3509fb67d4a5..b76f6687b338 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-repo.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-repo.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-package-json-repo"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-package-json-repo"; //------------------------------------------------------------------------------ // Example files @@ -80,7 +80,7 @@ const examplePackageGood = `{ "eslint-detailed-reporter": "^0.8.0", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-only-tests": "^2.3.0", - "eslint-plugin-promise": "^4.1.1", + "eslint-plugin-promise": "^4.1.1", "https-proxy-agent": "^2.2.1", "karma": "^4.0.1", "karma-chrome-launcher": "^2.2.0", @@ -193,7 +193,7 @@ const examplePackageBad = `{ "eslint-detailed-reporter": "^0.8.0", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-only-tests": "^2.3.0", - "eslint-plugin-promise": "^4.1.1", + "eslint-plugin-promise": "^4.1.1", "https-proxy-agent": "^2.2.1", "karma": "^4.0.1", "karma-chrome-launcher": "^2.2.0", diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-required-scripts.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-required-scripts.ts index ad0715bcafe7..8dba5a3eba5a 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-required-scripts.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-required-scripts.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-package-json-required-scripts"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-package-json-required-scripts"; //------------------------------------------------------------------------------ // Example files @@ -80,7 +80,7 @@ const examplePackageGood = `{ "eslint-detailed-reporter": "^0.8.0", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-only-tests": "^2.3.0", - "eslint-plugin-promise": "^4.1.1", + "eslint-plugin-promise": "^4.1.1", "https-proxy-agent": "^2.2.1", "karma": "^4.0.1", "karma-chrome-launcher": "^2.2.0", @@ -199,7 +199,7 @@ const examplePackageBad = `{ "eslint-detailed-reporter": "^0.8.0", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-only-tests": "^2.3.0", - "eslint-plugin-promise": "^4.1.1", + "eslint-plugin-promise": "^4.1.1", "https-proxy-agent": "^2.2.1", "karma": "^4.0.1", "karma-chrome-launcher": "^2.2.0", diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-sdktype-exists.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-sdktype-exists.ts new file mode 100644 index 000000000000..99a54eb9d772 --- /dev/null +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-sdktype-exists.ts @@ -0,0 +1,393 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +/** + * @file Testing the ts-package-json-sdktype-exists rule. + * @author Ben Zhang + */ + +import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-package-json-sdktype-exists"; + +//------------------------------------------------------------------------------ +// Example files +//------------------------------------------------------------------------------ + +const examplePackageGood = `{ + "name": "@azure/event-hubs", + "sdk-type": "client", + "version": "5.7.0-beta.1", + "description": "Azure Event Hubs SDK for JS.", + "author": "Microsoft Corporation", + "license": "MIT", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/eventhub/event-hubs/", + "repository": "github:Azure/azure-sdk-for-js", + "sideEffects": false, + "keywords": [ + "azure", + "cloud", + "event hubs", + "events", + "Azure" + ], + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "engines": { + "node": ">=12.0.0" + }, + "main": "./dist/index.js", + "module": "dist-esm/src/index.js", + "types": "./types/latest/event-hubs.d.ts", + "typesVersions": { + "<3.6": { + "types/latest/*": [ + "types/3.1/*" + ] + } + }, + "browser": { + "./dist-esm/src/util/runtimeInfo.js": "./dist-esm/src/util/runtimeInfo.browser.js", + "./dist-esm/test/public/utils/mockService.js": "./dist-esm/test/public/utils/mockService.browser.js" + }, + "files": [ + "dist/", + "dist-esm/src/", + "types/latest/", + "types/3.1/", + "README.md", + "LICENSE" + ], + "//metadata": { + "constantPaths": [ + { + "path": "src/util/constants.ts", + "prefix": "version" + } + ] + }, + "//sampleConfiguration": { + "extraFiles": { + "./samples-browser": [ + "browser" + ], + "./samples-express": [ + "express" + ] + }, + "skip": [ + "iothubConnectionString.js", + "iothubConnectionStringWebsockets.js", + "useWithIotHub.js", + "usingAadAuth.js" + ], + "productName": "Azure Event Hubs", + "productSlugs": [ + "azure", + "azure-event-hubs" + ], + "requiredResources": { + "Azure Event Hub": "https://docs.microsoft.com/azure/event-hubs/event-hubs-create" + } + }, + "dependencies": { + "@azure/abort-controller": "^1.0.0", + "@azure/core-amqp": "^3.0.0", + "@azure/core-asynciterator-polyfill": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-tracing": "1.0.0-preview.13", + "@azure/logger": "^1.0.0", + "buffer": "^6.0.0", + "is-buffer": "^2.0.3", + "jssha": "^3.1.0", + "process": "^0.11.10", + "rhea-promise": "^2.1.0", + "tslib": "^2.2.0", + "uuid": "^8.3.0" + }, + "devDependencies": { + "@azure/dev-tool": "^1.0.0", + "@azure/eslint-plugin-azure-sdk": "^3.0.0", + "@azure/identity": "^2.0.1", + "@azure/mock-hub": "^1.0.0", + "@azure/test-utils": "^1.0.0", + "@azure/test-utils-perf": "^1.0.0", + "@microsoft/api-extractor": "^7.18.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-inject": "^4.0.0", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", + "@rollup/plugin-replace": "^2.2.0", + "@types/async-lock": "^1.1.0", + "@types/chai": "^4.1.6", + "@types/chai-as-promised": "^7.1.0", + "@types/chai-string": "^1.4.1", + "@types/debug": "^4.1.4", + "@types/long": "^4.0.0", + "@types/mocha": "^7.0.2", + "@types/node": "^12.0.0", + "@types/sinon": "^9.0.4", + "@types/uuid": "^8.0.0", + "@types/ws": "^7.2.4", + "assert": "^1.4.1", + "chai": "^4.2.0", + "chai-as-promised": "^7.1.1", + "chai-exclude": "^2.0.2", + "chai-string": "^1.5.0", + "cross-env": "^7.0.2", + "debug": "^4.1.1", + "dotenv": "^8.2.0", + "downlevel-dts": "~0.4.0", + "eslint": "^7.15.0", + "esm": "^3.2.18", + "https-proxy-agent": "^5.0.0", + "karma": "^6.2.0", + "karma-chrome-launcher": "^3.0.0", + "karma-coverage": "^2.0.0", + "karma-edge-launcher": "^0.4.2", + "karma-env-preprocessor": "^0.1.1", + "karma-firefox-launcher": "^1.1.0", + "karma-ie-launcher": "^1.0.0", + "karma-junit-reporter": "^2.0.1", + "karma-mocha": "^2.0.1", + "karma-mocha-reporter": "^2.2.5", + "karma-sourcemap-loader": "^0.3.8", + "mocha": "^7.1.1", + "mocha-junit-reporter": "^1.18.0", + "moment": "^2.24.0", + "nyc": "^14.0.0", + "prettier": "^1.16.4", + "puppeteer": "^10.2.0", + "rimraf": "^3.0.0", + "rollup": "^1.16.3", + "rollup-plugin-shim": "^1.0.0", + "rollup-plugin-sourcemaps": "^0.4.2", + "rollup-plugin-terser": "^5.1.1", + "sinon": "^9.0.2", + "ts-node": "^10.0.0", + "typescript": "~4.2.0", + "ws": "^7.1.1", + "typedoc": "0.15.2" + } +}`; + +const examplePackageBad = `{ + "name": "@azure/event-hubs", + "version": "5.7.0-beta.1", + "description": "Azure Event Hubs SDK for JS.", + "author": "Microsoft Corporation", + "license": "MIT", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/eventhub/event-hubs/", + "repository": "github:Azure/azure-sdk-for-js", + "sideEffects": false, + "keywords": [ + "azure", + "cloud", + "event hubs", + "events", + "Azure" + ], + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "engines": { + "node": ">=12.0.0" + }, + "main": "./dist/index.js", + "module": "dist-esm/src/index.js", + "types": "./types/latest/event-hubs.d.ts", + "typesVersions": { + "<3.6": { + "types/latest/*": [ + "types/3.1/*" + ] + } + }, + "browser": { + "./dist-esm/src/util/runtimeInfo.js": "./dist-esm/src/util/runtimeInfo.browser.js", + "./dist-esm/test/public/utils/mockService.js": "./dist-esm/test/public/utils/mockService.browser.js" + }, + "files": [ + "dist/", + "dist-esm/src/", + "types/latest/", + "types/3.1/", + "README.md", + "LICENSE" + ], + "//metadata": { + "constantPaths": [ + { + "path": "src/util/constants.ts", + "prefix": "version" + } + ] + }, + "//sampleConfiguration": { + "extraFiles": { + "./samples-browser": [ + "browser" + ], + "./samples-express": [ + "express" + ] + }, + "skip": [ + "iothubConnectionString.js", + "iothubConnectionStringWebsockets.js", + "useWithIotHub.js", + "usingAadAuth.js" + ], + "productName": "Azure Event Hubs", + "productSlugs": [ + "azure", + "azure-event-hubs" + ], + "requiredResources": { + "Azure Event Hub": "https://docs.microsoft.com/azure/event-hubs/event-hubs-create" + } + }, + "dependencies": { + "@azure/abort-controller": "^1.0.0", + "@azure/core-amqp": "^3.0.0", + "@azure/core-asynciterator-polyfill": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-tracing": "1.0.0-preview.13", + "@azure/logger": "^1.0.0", + "buffer": "^6.0.0", + "is-buffer": "^2.0.3", + "jssha": "^3.1.0", + "process": "^0.11.10", + "rhea-promise": "^2.1.0", + "tslib": "^2.2.0", + "uuid": "^8.3.0" + }, + "devDependencies": { + "@azure/dev-tool": "^1.0.0", + "@azure/eslint-plugin-azure-sdk": "^3.0.0", + "@azure/identity": "^2.0.1", + "@azure/mock-hub": "^1.0.0", + "@azure/test-utils": "^1.0.0", + "@azure/test-utils-perf": "^1.0.0", + "@microsoft/api-extractor": "^7.18.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-inject": "^4.0.0", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", + "@rollup/plugin-replace": "^2.2.0", + "@types/async-lock": "^1.1.0", + "@types/chai": "^4.1.6", + "@types/chai-as-promised": "^7.1.0", + "@types/chai-string": "^1.4.1", + "@types/debug": "^4.1.4", + "@types/long": "^4.0.0", + "@types/mocha": "^7.0.2", + "@types/node": "^12.0.0", + "@types/sinon": "^9.0.4", + "@types/uuid": "^8.0.0", + "@types/ws": "^7.2.4", + "assert": "^1.4.1", + "chai": "^4.2.0", + "chai-as-promised": "^7.1.1", + "chai-exclude": "^2.0.2", + "chai-string": "^1.5.0", + "cross-env": "^7.0.2", + "debug": "^4.1.1", + "dotenv": "^8.2.0", + "downlevel-dts": "~0.4.0", + "eslint": "^7.15.0", + "esm": "^3.2.18", + "https-proxy-agent": "^5.0.0", + "karma": "^6.2.0", + "karma-chrome-launcher": "^3.0.0", + "karma-coverage": "^2.0.0", + "karma-edge-launcher": "^0.4.2", + "karma-env-preprocessor": "^0.1.1", + "karma-firefox-launcher": "^1.1.0", + "karma-ie-launcher": "^1.0.0", + "karma-junit-reporter": "^2.0.1", + "karma-mocha": "^2.0.1", + "karma-mocha-reporter": "^2.2.5", + "karma-sourcemap-loader": "^0.3.8", + "mocha": "^7.1.1", + "mocha-junit-reporter": "^1.18.0", + "moment": "^2.24.0", + "nyc": "^14.0.0", + "prettier": "^1.16.4", + "puppeteer": "^10.2.0", + "rimraf": "^3.0.0", + "rollup": "^1.16.3", + "rollup-plugin-shim": "^1.0.0", + "rollup-plugin-sourcemaps": "^0.4.2", + "rollup-plugin-terser": "^5.1.1", + "sinon": "^9.0.2", + "ts-node": "^10.0.0", + "typescript": "~4.2.0", + "ws": "^7.1.1", + "typedoc": "0.15.2" + } +}`; + +//------------------------------------------------------------------------------ +// Tests +//------------------------------------------------------------------------------ + +const ruleTester = new RuleTester({ + parser: require.resolve("@typescript-eslint/parser"), + parserOptions: { + createDefaultProgram: true, + project: "./tsconfig.json" + } +}); + +ruleTester.run("ts-package-json-sdktype-exists", rule, { + valid: [ + { + // only the fields we care about + code: '{"sdk-type": "client"}', + filename: "package.json" + }, + { + // a full example package.json (taken from https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/eventhub/event-hubs/package.json with "scripts" removed for testing purposes) + code: examplePackageGood, + filename: "package.json" + }, + { + // incorrect format but in a file we don't care about + code: '{"types": "typings/index.d.ts"}', + filename: "not_package.json" + } + ], + invalid: [ + { + code: '{"not-sdk-type": "client"}', + filename: "package.json", + errors: [ + { + message: "sdk-type does not exist at the outermost level" + } + ] + }, + { + // sdk-type is in a nested object + code: '{"outer": {"sdk-type": "client"}}', + filename: "package.json", + errors: [ + { + message: "sdk-type does not exist at the outermost level" + } + ] + }, + { + code: examplePackageBad, + filename: "package.json", + errors: [ + { + message: "sdk-type does not exist at the outermost level" + } + ] + } + ] +}); diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-sideeffects.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-sideeffects.ts index e60fee5f440f..f4eb537c9e10 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-sideeffects.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-sideeffects.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-package-json-sideeffects"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-package-json-sideeffects"; //------------------------------------------------------------------------------ // Example files @@ -80,7 +80,7 @@ const examplePackageGood = `{ "eslint-detailed-reporter": "^0.8.0", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-only-tests": "^2.3.0", - "eslint-plugin-promise": "^4.1.1", + "eslint-plugin-promise": "^4.1.1", "https-proxy-agent": "^2.2.1", "karma": "^4.0.1", "karma-chrome-launcher": "^2.2.0", @@ -193,7 +193,7 @@ const examplePackageBad = `{ "eslint-detailed-reporter": "^0.8.0", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-only-tests": "^2.3.0", - "eslint-plugin-promise": "^4.1.1", + "eslint-plugin-promise": "^4.1.1", "https-proxy-agent": "^2.2.1", "karma": "^4.0.1", "karma-chrome-launcher": "^2.2.0", diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-types.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-types.ts index 1a19eb2eb493..9c08ff63f469 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-types.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-package-json-types.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-package-json-types"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-package-json-types"; //------------------------------------------------------------------------------ // Example files @@ -80,7 +80,7 @@ const examplePackageGood = `{ "eslint-detailed-reporter": "^0.8.0", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-only-tests": "^2.3.0", - "eslint-plugin-promise": "^4.1.1", + "eslint-plugin-promise": "^4.1.1", "https-proxy-agent": "^2.2.1", "karma": "^4.0.1", "karma-chrome-launcher": "^2.2.0", @@ -193,7 +193,7 @@ const examplePackageBad = `{ "eslint-detailed-reporter": "^0.8.0", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-only-tests": "^2.3.0", - "eslint-plugin-promise": "^4.1.1", + "eslint-plugin-promise": "^4.1.1", "https-proxy-agent": "^2.2.1", "karma": "^4.0.1", "karma-chrome-launcher": "^2.2.0", diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-pagination-list.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-pagination-list.ts index 01b1b9d10a6a..809545033bae 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-pagination-list.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-pagination-list.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-pagination-list"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-pagination-list"; //------------------------------------------------------------------------------ // Tests diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-use-interface-parameters.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-use-interface-parameters.ts index fff40f32bc45..c799f1d3ba38 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-use-interface-parameters.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-use-interface-parameters.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-use-interface-parameters"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-use-interface-parameters"; //------------------------------------------------------------------------------ // Example class & interface diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-use-promises.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-use-promises.ts index 0fbbe2229ca5..55786ab1427c 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-use-promises.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-use-promises.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-use-promises"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-use-promises"; //------------------------------------------------------------------------------ // Example files diff --git a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-versioning-semver.ts b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-versioning-semver.ts index 98b1fd4f6631..fdd8959c615d 100644 --- a/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-versioning-semver.ts +++ b/common/tools/eslint-plugin-azure-sdk/tests/rules/ts-versioning-semver.ts @@ -6,8 +6,8 @@ * @author Arpan Laha */ -import rule from "../../src/rules/ts-versioning-semver"; import { RuleTester } from "eslint"; +import rule from "../../src/rules/ts-versioning-semver"; //------------------------------------------------------------------------------ // Example files @@ -80,7 +80,7 @@ const examplePackageGood = `{ "eslint-detailed-reporter": "^0.8.0", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-only-tests": "^2.3.0", - "eslint-plugin-promise": "^4.1.1", + "eslint-plugin-promise": "^4.1.1", "https-proxy-agent": "^2.2.1", "karma": "^4.0.1", "karma-chrome-launcher": "^2.2.0", @@ -193,7 +193,7 @@ const examplePackageBad = `{ "eslint-detailed-reporter": "^0.8.0", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-no-only-tests": "^2.3.0", - "eslint-plugin-promise": "^4.1.1", + "eslint-plugin-promise": "^4.1.1", "https-proxy-agent": "^2.2.1", "karma": "^4.0.1", "karma-chrome-launcher": "^2.2.0", diff --git a/sdk/keyvault/keyvault-common/package.json b/sdk/keyvault/keyvault-common/package.json index a19e03450391..79039e353ec0 100644 --- a/sdk/keyvault/keyvault-common/package.json +++ b/sdk/keyvault/keyvault-common/package.json @@ -1,6 +1,7 @@ { "name": "@azure/keyvault-common", "sideEffects": false, + "sdk-type": "client", "private": true, "author": "Microsoft Corporation", "version": "1.0.0",