From 9f454f84a636b6a511fa28d81496f0e6573b13d5 Mon Sep 17 00:00:00 2001 From: Ben Zhang <42699471+bzhang0@users.noreply.github.com> Date: Mon, 22 Nov 2021 11:18:22 -0800 Subject: [PATCH] [Linter] Added ```sort-imports``` rule with "warning" (#18730) * add rules * delete sdk/monitor/ monitor-query max-warnings * fix wording of sort-imports rule output --- common/tools/eslint-plugin-azure-sdk/.eslintrc.json | 3 ++- .../eslint-plugin-azure-sdk/src/configs/azure-sdk-base.ts | 1 + sdk/monitor/monitor-query/package.json | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/common/tools/eslint-plugin-azure-sdk/.eslintrc.json b/common/tools/eslint-plugin-azure-sdk/.eslintrc.json index dfae6b14fee3..adbbaefa9d32 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": "warn" } } diff --git a/common/tools/eslint-plugin-azure-sdk/src/configs/azure-sdk-base.ts b/common/tools/eslint-plugin-azure-sdk/src/configs/azure-sdk-base.ts index a742e20d0eeb..041ac20e6877 100644 --- a/common/tools/eslint-plugin-azure-sdk/src/configs/azure-sdk-base.ts +++ b/common/tools/eslint-plugin-azure-sdk/src/configs/azure-sdk-base.ts @@ -56,6 +56,7 @@ export default { "no-var": "error", "one-var-declaration-per-line": "error", "prefer-const": "error", + "sort-imports": "warn", "spaced-comment": ["error", "always", { markers: ["/"] }], "space-infix-ops": ["error", { int32Hint: false }], "use-isnan": "error", diff --git a/sdk/monitor/monitor-query/package.json b/sdk/monitor/monitor-query/package.json index 5d4cd1fe9126..c31f5cf92514 100644 --- a/sdk/monitor/monitor-query/package.json +++ b/sdk/monitor/monitor-query/package.json @@ -62,7 +62,7 @@ "integration-test:node": "nyc mocha -r esm --require source-map-support/register --slow 5000 --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}/*.spec.js\"", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "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 --format unix --ext .ts --max-warnings 0", + "lint": "eslint package.json api-extractor.json src test --format unix --ext .ts", "pack": "npm pack 2>&1", "test:browser": "npm run build:test && npm run integration-test:browser", "test:node": "npm run build:test && npm run integration-test:node",