From 9cfe960ef071d99616cd10f216d1dc1007062543 Mon Sep 17 00:00:00 2001 From: Deyaaeldeen Almahallawi Date: Tue, 22 Sep 2020 21:16:45 -0400 Subject: [PATCH] [Core paging] Update linting scripts and auto linting (#11274) * [Core paging] Update linting scripts and auto linting * formatting changes * addressing Jeff's comments * fixes * turn sideEffects back on * adding comments to address Ramya's feedback * a typo * adding dist-esm/index.js back * Update sdk/core/core-paging/.eslintrc.json Co-authored-by: Ramya Rao * remove dist-esm/src from files in package.json Co-authored-by: Ramya Rao --- sdk/core/core-paging/.eslintrc.json | 17 +++++++++ sdk/core/core-paging/package.json | 35 +++++++++---------- sdk/core/core-paging/src/index.ts | 3 ++ .../3.1/{corePaging.d.ts => core-paging.d.ts} | 0 .../{corePaging.d.ts => core-paging.d.ts} | 0 5 files changed, 37 insertions(+), 18 deletions(-) create mode 100644 sdk/core/core-paging/.eslintrc.json rename sdk/core/core-paging/types/3.1/{corePaging.d.ts => core-paging.d.ts} (100%) rename sdk/core/core-paging/types/latest/{corePaging.d.ts => core-paging.d.ts} (100%) diff --git a/sdk/core/core-paging/.eslintrc.json b/sdk/core/core-paging/.eslintrc.json new file mode 100644 index 000000000000..dc6bd6af2766 --- /dev/null +++ b/sdk/core/core-paging/.eslintrc.json @@ -0,0 +1,17 @@ +{ + "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" + } +} diff --git a/sdk/core/core-paging/package.json b/sdk/core/core-paging/package.json index 584d6ae5079b..85a84a37d342 100644 --- a/sdk/core/core-paging/package.json +++ b/sdk/core/core-paging/package.json @@ -1,10 +1,6 @@ { "name": "@azure/core-paging", - "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.1.3", "description": "Core types for paging async iterable iterators", @@ -14,10 +10,12 @@ ], "keywords": [ "microsoft", - "clientruntime" + "clientruntime", + "azure", + "cloud" ], - "main": "./dist-esm/index.js", - "types": "./types/latest/corePaging.d.ts", + "main": "dist-esm/index.js", + "types": "./types/latest/core-paging.d.ts", "typesVersions": { "<3.6": { "types/latest/*": [ @@ -26,20 +24,20 @@ } }, "files": [ - "types/latest/corePaging.d.ts", + "types/latest/core-paging.d.ts", "types/3.1", - "dist-esm/**/*.js", + "dist-esm/index.js", "LICENSE", "README.md" ], - "license": "MIT", - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/core-paging", - "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-paging/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", @@ -52,8 +50,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 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", @@ -69,6 +67,7 @@ "@azure/core-asynciterator-polyfill": "^1.0.0" }, "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-paging/src/index.ts b/sdk/core/core-paging/src/index.ts index 92cf181b580d..7a8bd71de8a8 100644 --- a/sdk/core/core-paging/src/index.ts +++ b/sdk/core/core-paging/src/index.ts @@ -1 +1,4 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + import "@azure/core-asynciterator-polyfill"; diff --git a/sdk/core/core-paging/types/3.1/corePaging.d.ts b/sdk/core/core-paging/types/3.1/core-paging.d.ts similarity index 100% rename from sdk/core/core-paging/types/3.1/corePaging.d.ts rename to sdk/core/core-paging/types/3.1/core-paging.d.ts diff --git a/sdk/core/core-paging/types/latest/corePaging.d.ts b/sdk/core/core-paging/types/latest/core-paging.d.ts similarity index 100% rename from sdk/core/core-paging/types/latest/corePaging.d.ts rename to sdk/core/core-paging/types/latest/core-paging.d.ts