From 8c8ce80aa94deca58e8361e48632024a419f7194 Mon Sep 17 00:00:00 2001 From: deyaaeldeen Date: Tue, 15 Sep 2020 16:32:19 -0400 Subject: [PATCH 01/14] update linting and fix linting errors --- sdk/core/abort-controller/package.json | 5 +++-- sdk/core/abort-controller/src/AbortController.ts | 4 ++++ sdk/core/abort-controller/src/AbortSignal.ts | 4 ++++ sdk/core/abort-controller/src/aborter.ts | 3 +++ sdk/core/abort-controller/src/shims-public.d.ts | 3 +++ sdk/core/abort-controller/test/aborter.spec.ts | 15 +++++++++------ 6 files changed, 26 insertions(+), 8 deletions(-) diff --git a/sdk/core/abort-controller/package.json b/sdk/core/abort-controller/package.json index dfe3893ef8b4..3c74d4b858c2 100644 --- a/sdk/core/abort-controller/package.json +++ b/sdk/core/abort-controller/package.json @@ -19,8 +19,8 @@ "integration-test:browser": "echo skipped", "integration-test:node": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "lint:fix": "eslint \"src/**/*.ts\" \"test/**/*.ts\" -c ../../.eslintrc.old.json --fix --fix-type [problem,suggestion]", - "lint": "eslint -c ../../.eslintrc.old.json src test --ext .ts -f html -o abort-controller-lintReport.html || exit 0", + "lint:fix": "eslint -c ../../../.eslintrc.json \"src/**/*.ts\" \"test/**/*.ts\" --fix --fix-type [problem,suggestion]", + "lint": "eslint -c ../../../.eslintrc.json package.json api-extractor.json src test --ext .ts", "pack": "npm pack 2>&1", "prebuild": "npm run clean", "pretest": "npm run build:test", @@ -67,6 +67,7 @@ "tslib": "^2.0.0" }, "devDependencies": { + "@azure/eslint-plugin-azure-sdk": "^3.0.0", "@microsoft/api-extractor": "7.7.11", "@rollup/plugin-commonjs": "11.0.2", "@rollup/plugin-multi-entry": "^3.0.0", diff --git a/sdk/core/abort-controller/src/AbortController.ts b/sdk/core/abort-controller/src/AbortController.ts index d660a28c9d89..edd5f2123ffc 100644 --- a/sdk/core/abort-controller/src/AbortController.ts +++ b/sdk/core/abort-controller/src/AbortController.ts @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + import { AbortSignal, abortSignal, AbortSignalLike } from "./AbortSignal"; /** @@ -76,6 +79,7 @@ export class AbortController { } // coerce parentSignals into an array if (!Array.isArray(parentSignals)) { + // eslint-disable-next-line prefer-rest-params parentSignals = arguments; } for (const parentSignal of parentSignals) { diff --git a/sdk/core/abort-controller/src/AbortSignal.ts b/sdk/core/abort-controller/src/AbortSignal.ts index 04e8e7500869..7894842ecced 100644 --- a/sdk/core/abort-controller/src/AbortSignal.ts +++ b/sdk/core/abort-controller/src/AbortSignal.ts @@ -1,3 +1,7 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +// eslint-disable-next-line @typescript-eslint/triple-slash-reference /// type AbortEventListener = (this: AbortSignalLike, ev?: any) => any; diff --git a/sdk/core/abort-controller/src/aborter.ts b/sdk/core/abort-controller/src/aborter.ts index 20ebe21376c4..be655bbc6387 100644 --- a/sdk/core/abort-controller/src/aborter.ts +++ b/sdk/core/abort-controller/src/aborter.ts @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + // Changes to Aborter // * Rename Aborter to AbortSignal // * Remove withValue and getValue - async context should be solved differently/wholistically, not tied to cancellation diff --git a/sdk/core/abort-controller/src/shims-public.d.ts b/sdk/core/abort-controller/src/shims-public.d.ts index 7ef8e860aa31..002bec375f33 100644 --- a/sdk/core/abort-controller/src/shims-public.d.ts +++ b/sdk/core/abort-controller/src/shims-public.d.ts @@ -1,2 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + // forward declaration of Event in case DOM libs are not present. interface Event {} diff --git a/sdk/core/abort-controller/test/aborter.spec.ts b/sdk/core/abort-controller/test/aborter.spec.ts index b42fcfbf379a..1df60b318475 100644 --- a/sdk/core/abort-controller/test/aborter.spec.ts +++ b/sdk/core/abort-controller/test/aborter.spec.ts @@ -1,22 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + import * as assert from "assert"; import { AbortController, AbortSignal, AbortError } from "../src/aborter"; describe("AbortController", () => { function doAsyncOperation(aborter: AbortSignal, runningTimeinMs: number = 100): Promise { const s = Date.now(); - return new Promise((res, rej) => { + return new Promise((resolve, reject) => { // check status every 10 ms. const handle = setInterval(() => { // check if we're aborted. if (aborter.aborted) { clearInterval(handle); - return rej(new AbortError()); + return reject(new AbortError()); } // if we're completed, resolve. if (Date.now() - s > runningTimeinMs) { clearInterval(handle); - return res(); + return resolve(); } // else, continue trying. @@ -34,7 +37,7 @@ describe("AbortController", () => { const response = doAsyncOperation(aborter); controller.abort(); try { - let rs = await response; + const rs = await response; console.log("got result", rs); assert.fail(); } catch (err) { @@ -48,7 +51,7 @@ describe("AbortController", () => { const response = doAsyncOperation(aborter, 500); setTimeout(() => controller.abort(), 50); try { - let r = await response; + const r = await response; console.log("got, r", r); assert.fail(); } catch (err) { @@ -83,7 +86,7 @@ describe("AbortController", () => { it("should invoke abort listener callbacks when aborting", async () => { const controller = new AbortController(); const aborter = controller.signal; - let s: string[] = []; + const s: string[] = []; try { aborter.addEventListener("abort", () => { s.push("aborted"); From 2e254d5ba71711ab4f5c4c6f6c2c381e85c5e31d Mon Sep 17 00:00:00 2001 From: deyaaeldeen Date: Wed, 16 Sep 2020 10:53:33 -0400 Subject: [PATCH 02/14] update linting scripts --- sdk/core/abort-controller/package.json | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/sdk/core/abort-controller/package.json b/sdk/core/abort-controller/package.json index 3c74d4b858c2..695ec000a353 100644 --- a/sdk/core/abort-controller/package.json +++ b/sdk/core/abort-controller/package.json @@ -19,8 +19,8 @@ "integration-test:browser": "echo skipped", "integration-test:node": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "lint:fix": "eslint -c ../../../.eslintrc.json \"src/**/*.ts\" \"test/**/*.ts\" --fix --fix-type [problem,suggestion]", - "lint": "eslint -c ../../../.eslintrc.json package.json api-extractor.json src test --ext .ts", + "lint:fix": "eslint -c ../../../.eslintrc.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]", + "lint": "eslint -c ../../../.eslintrc.json api-extractor.json src test --ext .ts -f html -o template-lintReport.html || exit 0", "pack": "npm pack 2>&1", "prebuild": "npm run clean", "pretest": "npm run build:test", @@ -42,26 +42,17 @@ "README.md", "LICENSE" ], - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git" + "engines": { + "node": ">=8.0.0" }, - "keywords": [ - "azure", - "aborter", - "abortsignal", - "cancellation", - "node.js", - "typescript", - "javascript", - "browser" - ], + "repository": "github:Azure/azure-sdk-for-js", + "keywords": ["azure", "aborter", "abortsignal", "cancellation", "node.js", "typescript", "javascript", "browser", "cloud"], "author": "Microsoft Corporation", "license": "MIT", "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/abort-controller", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/abort-controller/README.md", "sideEffects": false, "dependencies": { "tslib": "^2.0.0" From a779bf74419fc1d5106d35fff6a03c2b0c70b2fc Mon Sep 17 00:00:00 2001 From: deyaaeldeen Date: Wed, 16 Sep 2020 10:53:44 -0400 Subject: [PATCH 03/14] formatting --- sdk/core/abort-controller/package.json | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sdk/core/abort-controller/package.json b/sdk/core/abort-controller/package.json index 695ec000a353..b1f91c49d57f 100644 --- a/sdk/core/abort-controller/package.json +++ b/sdk/core/abort-controller/package.json @@ -46,7 +46,17 @@ "node": ">=8.0.0" }, "repository": "github:Azure/azure-sdk-for-js", - "keywords": ["azure", "aborter", "abortsignal", "cancellation", "node.js", "typescript", "javascript", "browser", "cloud"], + "keywords": [ + "azure", + "aborter", + "abortsignal", + "cancellation", + "node.js", + "typescript", + "javascript", + "browser", + "cloud" + ], "author": "Microsoft Corporation", "license": "MIT", "bugs": { From 1661829c058fc48b7663f771d953da48106d3431 Mon Sep 17 00:00:00 2001 From: deyaaeldeen Date: Wed, 16 Sep 2020 11:03:21 -0400 Subject: [PATCH 04/14] fix linting errors --- sdk/core/abort-controller/api-extractor.json | 4 ++-- sdk/core/abort-controller/package.json | 8 ++++---- sdk/core/abort-controller/rollup.base.config.js | 2 +- sdk/core/abort-controller/src/{aborter.ts => index.ts} | 0 sdk/core/abort-controller/test/aborter.spec.ts | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) rename sdk/core/abort-controller/src/{aborter.ts => index.ts} (100%) diff --git a/sdk/core/abort-controller/api-extractor.json b/sdk/core/abort-controller/api-extractor.json index 263e349ba659..ba7606c34c2c 100644 --- a/sdk/core/abort-controller/api-extractor.json +++ b/sdk/core/abort-controller/api-extractor.json @@ -1,6 +1,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "types/src/aborter.d.ts", + "mainEntryPointFilePath": "types/src/abort-controller.d.ts", "docModel": { "enabled": true }, @@ -11,7 +11,7 @@ "dtsRollup": { "enabled": true, "untrimmedFilePath": "", - "publicTrimmedFilePath": "./types/aborter.d.ts" + "publicTrimmedFilePath": "./types/abort-controller.d.ts" }, "messages": { "tsdocMessageReporting": { diff --git a/sdk/core/abort-controller/package.json b/sdk/core/abort-controller/package.json index b1f91c49d57f..2bf5243bbd5e 100644 --- a/sdk/core/abort-controller/package.json +++ b/sdk/core/abort-controller/package.json @@ -4,7 +4,7 @@ "version": "1.0.1", "description": "Microsoft Azure SDK for JavaScript - Aborter", "main": "./dist/index.js", - "module": "./dist-esm/src/aborter.js", + "module": "dist-esm/src/index.js", "scripts": { "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit", "build:es6": "tsc -p tsconfig.json", @@ -19,8 +19,8 @@ "integration-test:browser": "echo skipped", "integration-test:node": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "lint:fix": "eslint -c ../../../.eslintrc.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]", - "lint": "eslint -c ../../../.eslintrc.json api-extractor.json src test --ext .ts -f html -o template-lintReport.html || exit 0", + "lint:fix": "eslint -c ../../../.eslintrc.json package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]", + "lint": "eslint -c ../../../.eslintrc.json package.json api-extractor.json src test --ext .ts", "pack": "npm pack 2>&1", "prebuild": "npm run clean", "pretest": "npm run build:test", @@ -31,7 +31,7 @@ "unit-test:node": "cross-env TS_NODE_FILES=true TS_NODE_COMPILER_OPTIONS=\"{\\\"module\\\": \\\"commonjs\\\"}\" mocha --require ts-node/register --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace --no-timeouts test/*.spec.ts", "unit-test": "npm run unit-test:node && npm run unit-test:browser" }, - "types": "./types/src/aborter.d.ts", + "types": "./types/src/abort-controller.d.ts", "engine": { "node": ">=8.0.0" }, diff --git a/sdk/core/abort-controller/rollup.base.config.js b/sdk/core/abort-controller/rollup.base.config.js index b86b97b12ecd..ee3203a27837 100644 --- a/sdk/core/abort-controller/rollup.base.config.js +++ b/sdk/core/abort-controller/rollup.base.config.js @@ -10,7 +10,7 @@ import sourcemaps from "rollup-plugin-sourcemaps"; const pkg = require("./package.json"); const depNames = Object.keys(pkg.dependencies); -const input = "./dist-esm/src/aborter.js"; +const input = "./dist-esm/src/index.js"; const production = process.env.NODE_ENV === "production"; export function nodeConfig(test = false) { diff --git a/sdk/core/abort-controller/src/aborter.ts b/sdk/core/abort-controller/src/index.ts similarity index 100% rename from sdk/core/abort-controller/src/aborter.ts rename to sdk/core/abort-controller/src/index.ts diff --git a/sdk/core/abort-controller/test/aborter.spec.ts b/sdk/core/abort-controller/test/aborter.spec.ts index 1df60b318475..a60f914adb65 100644 --- a/sdk/core/abort-controller/test/aborter.spec.ts +++ b/sdk/core/abort-controller/test/aborter.spec.ts @@ -2,7 +2,7 @@ // Licensed under the MIT license. import * as assert from "assert"; -import { AbortController, AbortSignal, AbortError } from "../src/aborter"; +import { AbortController, AbortSignal, AbortError } from "../src"; describe("AbortController", () => { function doAsyncOperation(aborter: AbortSignal, runningTimeinMs: number = 100): Promise { From 2e064fe70c50e71923f6d2eb28f6833f421e12a9 Mon Sep 17 00:00:00 2001 From: deyaaeldeen Date: Wed, 16 Sep 2020 11:19:38 -0400 Subject: [PATCH 05/14] fixes --- sdk/core/abort-controller/api-extractor.json | 2 +- sdk/core/abort-controller/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/core/abort-controller/api-extractor.json b/sdk/core/abort-controller/api-extractor.json index ba7606c34c2c..8265070b9a1f 100644 --- a/sdk/core/abort-controller/api-extractor.json +++ b/sdk/core/abort-controller/api-extractor.json @@ -1,6 +1,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "types/src/abort-controller.d.ts", + "mainEntryPointFilePath": "types/src/index.d.ts", "docModel": { "enabled": true }, diff --git a/sdk/core/abort-controller/package.json b/sdk/core/abort-controller/package.json index 2bf5243bbd5e..06d5a3ac60ee 100644 --- a/sdk/core/abort-controller/package.json +++ b/sdk/core/abort-controller/package.json @@ -38,7 +38,7 @@ "files": [ "dist/", "dist-esm/src/", - "types/src", + "types/abort-controller.d.ts", "README.md", "LICENSE" ], From aa839c22b8b2b5a40082369414316475e2e4bf8b Mon Sep 17 00:00:00 2001 From: deyaaeldeen Date: Wed, 16 Sep 2020 11:42:03 -0400 Subject: [PATCH 06/14] fix --- sdk/core/abort-controller/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/core/abort-controller/package.json b/sdk/core/abort-controller/package.json index 06d5a3ac60ee..bba6f28dbed6 100644 --- a/sdk/core/abort-controller/package.json +++ b/sdk/core/abort-controller/package.json @@ -31,7 +31,7 @@ "unit-test:node": "cross-env TS_NODE_FILES=true TS_NODE_COMPILER_OPTIONS=\"{\\\"module\\\": \\\"commonjs\\\"}\" mocha --require ts-node/register --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace --no-timeouts test/*.spec.ts", "unit-test": "npm run unit-test:node && npm run unit-test:browser" }, - "types": "./types/src/abort-controller.d.ts", + "types": "./types/abort-controller.d.ts", "engine": { "node": ">=8.0.0" }, From a0a847e60cdec6ec70a93da39d93a596f9afc8b0 Mon Sep 17 00:00:00 2001 From: deyaaeldeen Date: Wed, 16 Sep 2020 12:22:19 -0400 Subject: [PATCH 07/14] run api-extractor --- sdk/core/abort-controller/package.json | 2 +- sdk/core/abort-controller/review/abort-controller.api.md | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sdk/core/abort-controller/package.json b/sdk/core/abort-controller/package.json index bba6f28dbed6..adfc22920c52 100644 --- a/sdk/core/abort-controller/package.json +++ b/sdk/core/abort-controller/package.json @@ -8,7 +8,7 @@ "scripts": { "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit", "build:es6": "tsc -p tsconfig.json", - "build:nodebrowser": "rollup -c 2>&1", + "build:nodebrowser": "rollup -c 2>&1 && api-extractor run --local", "build:test": "rollup -c rollup.test.config.js 2>&1", "build": "npm run build:es6 && npm run build:nodebrowser", "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", diff --git a/sdk/core/abort-controller/review/abort-controller.api.md b/sdk/core/abort-controller/review/abort-controller.api.md index 2b646496a2dd..bcde2db7e892 100644 --- a/sdk/core/abort-controller/review/abort-controller.api.md +++ b/sdk/core/abort-controller/review/abort-controller.api.md @@ -9,7 +9,7 @@ export class AbortController { constructor(parentSignals?: AbortSignalLike[]); constructor(...parentSignals: AbortSignalLike[]); abort(): void; - readonly signal: AbortSignal; + get signal(): AbortSignal; static timeout(ms: number): AbortSignal; } @@ -21,10 +21,11 @@ export class AbortError extends Error { // @public export class AbortSignal implements AbortSignalLike { constructor(); - readonly aborted: boolean; + get aborted(): boolean; addEventListener(_type: "abort", listener: (this: AbortSignalLike, ev: any) => any): void; - static readonly none: AbortSignal; - onabort?: (ev?: Event) => any; + dispatchEvent(_event: Event): boolean; + static get none(): AbortSignal; + onabort: ((ev?: Event) => any) | null; removeEventListener(_type: "abort", listener: (this: AbortSignalLike, ev: any) => any): void; } From 6b853dd43fe47654903876ca7cdd21af61d71d15 Mon Sep 17 00:00:00 2001 From: deyaaeldeen Date: Wed, 16 Sep 2020 15:49:21 -0400 Subject: [PATCH 08/14] include the shim files in shipped files --- sdk/core/abort-controller/package.json | 1 + sdk/core/abort-controller/{src => }/shims-public.d.ts | 0 sdk/core/abort-controller/src/AbortSignal.ts | 2 +- 3 files changed, 2 insertions(+), 1 deletion(-) rename sdk/core/abort-controller/{src => }/shims-public.d.ts (100%) diff --git a/sdk/core/abort-controller/package.json b/sdk/core/abort-controller/package.json index adfc22920c52..dd2933959e83 100644 --- a/sdk/core/abort-controller/package.json +++ b/sdk/core/abort-controller/package.json @@ -38,6 +38,7 @@ "files": [ "dist/", "dist-esm/src/", + "shims-public.d.ts", "types/abort-controller.d.ts", "README.md", "LICENSE" diff --git a/sdk/core/abort-controller/src/shims-public.d.ts b/sdk/core/abort-controller/shims-public.d.ts similarity index 100% rename from sdk/core/abort-controller/src/shims-public.d.ts rename to sdk/core/abort-controller/shims-public.d.ts diff --git a/sdk/core/abort-controller/src/AbortSignal.ts b/sdk/core/abort-controller/src/AbortSignal.ts index 7894842ecced..4c15c3e60bc3 100644 --- a/sdk/core/abort-controller/src/AbortSignal.ts +++ b/sdk/core/abort-controller/src/AbortSignal.ts @@ -2,7 +2,7 @@ // Licensed under the MIT license. // eslint-disable-next-line @typescript-eslint/triple-slash-reference -/// +/// type AbortEventListener = (this: AbortSignalLike, ev?: any) => any; const listenersMap = new WeakMap(); From 3a98df714b6273eb5869e9aff90b65e35c250cdf Mon Sep 17 00:00:00 2001 From: deyaaeldeen Date: Wed, 16 Sep 2020 16:20:50 -0400 Subject: [PATCH 09/14] use the unrolledup type declarations --- sdk/core/abort-controller/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/core/abort-controller/package.json b/sdk/core/abort-controller/package.json index dd2933959e83..6253a951362b 100644 --- a/sdk/core/abort-controller/package.json +++ b/sdk/core/abort-controller/package.json @@ -31,7 +31,7 @@ "unit-test:node": "cross-env TS_NODE_FILES=true TS_NODE_COMPILER_OPTIONS=\"{\\\"module\\\": \\\"commonjs\\\"}\" mocha --require ts-node/register --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace --no-timeouts test/*.spec.ts", "unit-test": "npm run unit-test:node && npm run unit-test:browser" }, - "types": "./types/abort-controller.d.ts", + "types": "./types/src/index.d.ts", "engine": { "node": ">=8.0.0" }, @@ -39,7 +39,7 @@ "dist/", "dist-esm/src/", "shims-public.d.ts", - "types/abort-controller.d.ts", + "types/**", "README.md", "LICENSE" ], From e1b6a12b471aafcd64573a341eec28f4d61d43f5 Mon Sep 17 00:00:00 2001 From: deyaaeldeen Date: Wed, 16 Sep 2020 16:43:39 -0400 Subject: [PATCH 10/14] do not lint package.json --- sdk/core/abort-controller/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/core/abort-controller/package.json b/sdk/core/abort-controller/package.json index 6253a951362b..b8f2fcd2d488 100644 --- a/sdk/core/abort-controller/package.json +++ b/sdk/core/abort-controller/package.json @@ -19,8 +19,8 @@ "integration-test:browser": "echo skipped", "integration-test:node": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "lint:fix": "eslint -c ../../../.eslintrc.json package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]", - "lint": "eslint -c ../../../.eslintrc.json package.json api-extractor.json src test --ext .ts", + "lint:fix": "eslint -c ../../../.eslintrc.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]", + "lint": "eslint -c ../../../.eslintrc.json api-extractor.json src test --ext .ts", "pack": "npm pack 2>&1", "prebuild": "npm run clean", "pretest": "npm run build:test", From fb4b659695f307faf6103557c954039d2f4b7fc2 Mon Sep 17 00:00:00 2001 From: deyaaeldeen Date: Fri, 18 Sep 2020 13:04:38 -0400 Subject: [PATCH 11/14] still lint package.json --- sdk/core/abort-controller/.eslintrc.json | 7 +++++++ sdk/core/abort-controller/package.json | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 sdk/core/abort-controller/.eslintrc.json diff --git a/sdk/core/abort-controller/.eslintrc.json b/sdk/core/abort-controller/.eslintrc.json new file mode 100644 index 000000000000..e71d23ff6f57 --- /dev/null +++ b/sdk/core/abort-controller/.eslintrc.json @@ -0,0 +1,7 @@ +{ + "plugins": ["@azure/azure-sdk"], + "extends": ["plugin:@azure/azure-sdk/azure-sdk-base"], + "rules": { + "@azure/azure-sdk/ts-package-json-types": "off" + } +} diff --git a/sdk/core/abort-controller/package.json b/sdk/core/abort-controller/package.json index b8f2fcd2d488..d62e42a93e1c 100644 --- a/sdk/core/abort-controller/package.json +++ b/sdk/core/abort-controller/package.json @@ -19,8 +19,8 @@ "integration-test:browser": "echo skipped", "integration-test:node": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "lint:fix": "eslint -c ../../../.eslintrc.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]", - "lint": "eslint -c ../../../.eslintrc.json api-extractor.json src test --ext .ts", + "lint:fix": "eslint -c .eslintrc.json package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]", + "lint": "eslint -c .eslintrc.json package.json api-extractor.json src test --ext .ts", "pack": "npm pack 2>&1", "prebuild": "npm run clean", "pretest": "npm run build:test", From e25024e9ddb3b2e1352504be97f26860013bc14f Mon Sep 17 00:00:00 2001 From: deyaaeldeen Date: Sat, 19 Sep 2020 17:50:07 -0400 Subject: [PATCH 12/14] remove the call to api-extractor from the npm build script --- sdk/core/abort-controller/package.json | 2 +- .../abort-controller/review/abort-controller.api.md | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/sdk/core/abort-controller/package.json b/sdk/core/abort-controller/package.json index d62e42a93e1c..97d289aa4d94 100644 --- a/sdk/core/abort-controller/package.json +++ b/sdk/core/abort-controller/package.json @@ -8,7 +8,7 @@ "scripts": { "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit", "build:es6": "tsc -p tsconfig.json", - "build:nodebrowser": "rollup -c 2>&1 && api-extractor run --local", + "build:nodebrowser": "rollup -c 2>&1", "build:test": "rollup -c rollup.test.config.js 2>&1", "build": "npm run build:es6 && npm run build:nodebrowser", "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", diff --git a/sdk/core/abort-controller/review/abort-controller.api.md b/sdk/core/abort-controller/review/abort-controller.api.md index bcde2db7e892..4eaac226487a 100644 --- a/sdk/core/abort-controller/review/abort-controller.api.md +++ b/sdk/core/abort-controller/review/abort-controller.api.md @@ -9,7 +9,7 @@ export class AbortController { constructor(parentSignals?: AbortSignalLike[]); constructor(...parentSignals: AbortSignalLike[]); abort(): void; - get signal(): AbortSignal; + readonly signal: AbortSignal; static timeout(ms: number): AbortSignal; } @@ -21,11 +21,10 @@ export class AbortError extends Error { // @public export class AbortSignal implements AbortSignalLike { constructor(); - get aborted(): boolean; + readonly aborted: boolean; addEventListener(_type: "abort", listener: (this: AbortSignalLike, ev: any) => any): void; - dispatchEvent(_event: Event): boolean; - static get none(): AbortSignal; - onabort: ((ev?: Event) => any) | null; + static readonly none: AbortSignal; + onabort?: (ev?: Event) => any; removeEventListener(_type: "abort", listener: (this: AbortSignalLike, ev: any) => any): void; } @@ -39,4 +38,4 @@ export interface AbortSignalLike { // (No @packageDocumentation comment for this package) -``` +``` \ No newline at end of file From e4337b56645b32905b55fe2b9c229b143e2cd8bd Mon Sep 17 00:00:00 2001 From: deyaaeldeen Date: Sat, 19 Sep 2020 17:52:22 -0400 Subject: [PATCH 13/14] simplify eslint commands --- sdk/core/abort-controller/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/core/abort-controller/package.json b/sdk/core/abort-controller/package.json index 97d289aa4d94..7e70cdcdcabe 100644 --- a/sdk/core/abort-controller/package.json +++ b/sdk/core/abort-controller/package.json @@ -19,8 +19,8 @@ "integration-test:browser": "echo skipped", "integration-test:node": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "lint:fix": "eslint -c .eslintrc.json package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]", - "lint": "eslint -c .eslintrc.json package.json api-extractor.json src test --ext .ts", + "lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]", + "lint": "eslint package.json api-extractor.json src test --ext .ts", "pack": "npm pack 2>&1", "prebuild": "npm run clean", "pretest": "npm run build:test", From 9b69013ab657efa4e2cb018540bbc5872c51b5a6 Mon Sep 17 00:00:00 2001 From: deyaaeldeen Date: Sat, 19 Sep 2020 17:53:45 -0400 Subject: [PATCH 14/14] only ship src types --- sdk/core/abort-controller/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/core/abort-controller/package.json b/sdk/core/abort-controller/package.json index 7e70cdcdcabe..d5958c96cf0b 100644 --- a/sdk/core/abort-controller/package.json +++ b/sdk/core/abort-controller/package.json @@ -39,7 +39,7 @@ "dist/", "dist-esm/src/", "shims-public.d.ts", - "types/**", + "types/src", "README.md", "LICENSE" ],