From 30a17b99951a19b932482028ab3b3f713acf7c7c Mon Sep 17 00:00:00 2001 From: deyaaeldeen Date: Wed, 16 Sep 2020 12:02:14 -0400 Subject: [PATCH 1/4] update linting scripts --- .../core-asynciterator-polyfill/package.json | 32 +++++++++---------- .../core-asynciterator-polyfill/src/index.ts | 3 ++ 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/sdk/core/core-asynciterator-polyfill/package.json b/sdk/core/core-asynciterator-polyfill/package.json index 36a3713b63ff..5dcdff5f1645 100644 --- a/sdk/core/core-asynciterator-polyfill/package.json +++ b/sdk/core/core-asynciterator-polyfill/package.json @@ -1,10 +1,6 @@ { "name": "@azure/core-asynciterator-polyfill", - "author": { - "name": "Microsoft Corporation", - "email": "azsdkteam@microsoft.com", - "url": "https://github.com/Azure/azure-sdk-for-js" - }, + "author": "Microsoft Corporation", "sdk-type": "client", "version": "1.0.1", "description": "Polyfill for IE/Node 8 for Symbol.asyncIterator", @@ -14,22 +10,25 @@ ], "keywords": [ "microsoft", - "clientruntime" + "clientruntime", + "azure", + "cloud" ], - "main": "./dist-esm/index.js", + "main": "dist/index.js", "files": [ "dist-esm/**/*.js", "README.md", - "LICENSE" + "LICENSE", + "dist" ], - "license": "MIT", - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/core-asynciterator-polyfill", - "repository": { - "type": "git", - "url": "git@github.com:Azure/azure-sdk-for-js.git" + "engines": { + "node": ">=8.0.0" }, + "license": "MIT", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/core-asynciterator-polyfill/README.md", + "repository": "github:Azure/azure-sdk-for-js", "bugs": { - "url": "http://github.com/Azure/azure-sdk-for-js/issues" + "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, "scripts": { "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit", @@ -42,8 +41,8 @@ "integration-test:browser": "echo skipped", "integration-test:node": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "lint": "eslint -c ../../.eslintrc.old.json src --ext .ts -f html -o template-lintReport.html || exit 0", - "lint:fix": "eslint \"src/**/*.ts\" -c ../../.eslintrc.old.json --fix --fix-type [problem,suggestion]", + "lint": "eslint -c ../../../.eslintrc.json package.json src --ext .ts", + "lint:fix": "eslint -c ../../../.eslintrc.json src --ext .ts --fix --fix-type [problem,suggestion]", "pack": "npm pack 2>&1", "prebuild": "npm run clean", "test:browser": "npm run build:test && npm run unit-test:browser && npm run integration-test:browser", @@ -56,6 +55,7 @@ "sideEffects": true, "private": false, "devDependencies": { + "@azure/eslint-plugin-azure-sdk": "^3.0.0", "@types/node": "^8.0.0", "@typescript-eslint/eslint-plugin": "^2.0.0", "@typescript-eslint/parser": "^2.0.0", diff --git a/sdk/core/core-asynciterator-polyfill/src/index.ts b/sdk/core/core-asynciterator-polyfill/src/index.ts index 594527e5d36c..61bf2ec0c040 100644 --- a/sdk/core/core-asynciterator-polyfill/src/index.ts +++ b/sdk/core/core-asynciterator-polyfill/src/index.ts @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + if (typeof Symbol === undefined || !(Symbol as any).asyncIterator) { (Symbol as any).asyncIterator = Symbol.for("Symbol.asyncIterator"); } From 766157781f886ee60e302c15675ccfe80daf41c0 Mon Sep 17 00:00:00 2001 From: deyaaeldeen Date: Wed, 16 Sep 2020 16:52:30 -0400 Subject: [PATCH 2/4] edits --- sdk/core/core-asynciterator-polyfill/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/core/core-asynciterator-polyfill/package.json b/sdk/core/core-asynciterator-polyfill/package.json index 5dcdff5f1645..ed743e0a17ee 100644 --- a/sdk/core/core-asynciterator-polyfill/package.json +++ b/sdk/core/core-asynciterator-polyfill/package.json @@ -14,7 +14,7 @@ "azure", "cloud" ], - "main": "dist/index.js", + "main": "./dist-esm/index.js", "files": [ "dist-esm/**/*.js", "README.md", @@ -41,7 +41,7 @@ "integration-test:browser": "echo skipped", "integration-test:node": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "lint": "eslint -c ../../../.eslintrc.json package.json src --ext .ts", + "lint": "eslint -c ../../../.eslintrc.json src --ext .ts", "lint:fix": "eslint -c ../../../.eslintrc.json src --ext .ts --fix --fix-type [problem,suggestion]", "pack": "npm pack 2>&1", "prebuild": "npm run clean", From 9b2da6ff421448438ef0fc70367d92faeba159ff Mon Sep 17 00:00:00 2001 From: deyaaeldeen Date: Mon, 21 Sep 2020 14:05:10 -0400 Subject: [PATCH 3/4] turn off relevant rules and lint package.json back --- sdk/core/core-asynciterator-polyfill/package.json | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sdk/core/core-asynciterator-polyfill/package.json b/sdk/core/core-asynciterator-polyfill/package.json index ed743e0a17ee..3805e4503039 100644 --- a/sdk/core/core-asynciterator-polyfill/package.json +++ b/sdk/core/core-asynciterator-polyfill/package.json @@ -16,10 +16,9 @@ ], "main": "./dist-esm/index.js", "files": [ - "dist-esm/**/*.js", + "dist-esm/index.js", "README.md", - "LICENSE", - "dist" + "LICENSE" ], "engines": { "node": ">=8.0.0" @@ -41,8 +40,8 @@ "integration-test:browser": "echo skipped", "integration-test:node": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "lint": "eslint -c ../../../.eslintrc.json src --ext .ts", - "lint:fix": "eslint -c ../../../.eslintrc.json src --ext .ts --fix --fix-type [problem,suggestion]", + "lint": "eslint package.json src --ext .ts", + "lint:fix": "eslint package.json src --ext .ts --fix --fix-type [problem,suggestion]", "pack": "npm pack 2>&1", "prebuild": "npm run clean", "test:browser": "npm run build:test && npm run unit-test:browser && npm run integration-test:browser", From d17cbc7722bc5cc6871159a5dfbd93ae1ea1157a Mon Sep 17 00:00:00 2001 From: deyaaeldeen Date: Mon, 21 Sep 2020 14:06:08 -0400 Subject: [PATCH 4/4] adding .eslintrc.json --- .../.eslintrc.json | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 sdk/core/core-asynciterator-polyfill/.eslintrc.json diff --git a/sdk/core/core-asynciterator-polyfill/.eslintrc.json b/sdk/core/core-asynciterator-polyfill/.eslintrc.json new file mode 100644 index 000000000000..6008d0c1297c --- /dev/null +++ b/sdk/core/core-asynciterator-polyfill/.eslintrc.json @@ -0,0 +1,19 @@ +{ + "plugins": ["@azure/azure-sdk"], + "extends": ["plugin:@azure/azure-sdk/azure-sdk-base"], + "rules": { + // `package.json`'s sideEffects has to be true because this package loads a + // polyfill. + "@azure/azure-sdk/ts-package-json-sideeffects": "off", + // this package does not have a module in `dist` because the directory does + // not exist. + "@azure/azure-sdk/ts-package-json-main-is-cjs": "off", + // this package does not export a module. + "@azure/azure-sdk/ts-package-json-module": "off", + // this package does not create a `dist` directory to be included in `files` + // list in `package.json`. + "@azure/azure-sdk/ts-package-json-files-required": "off", + // this package does not have type declaration file. + "@azure/azure-sdk/ts-package-json-types": "off" + } +}