Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
294 changes: 290 additions & 4 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions common/tools/eslint-plugin-azure-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"integration-test:browser": "echo skipped",
"integration-test:node": "echo skipped",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"unit-test:node": "mocha --require source-map-support/register --require ts-node/register --timeout 10000 --full-trace tests/**/*.ts",
"unit-test:node": "cross-env VITE_CJS_IGNORE_WARNING=true vitest",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you happen to know why we're seeing this warning? The linked page has some debugging tricks like running with VITE_CJS_TRACE

I have not tried any of it yet, mostly just curious if we can avoid this env var (and the dependency on cross-env) with a small tweak somewhere

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maorleger we are seeing these because the CJS support for vite as noted here

"unit-test:browser": "echo skipped",
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
"test": "npm run clean && npm run build:test && npm run unit-test"
Expand All @@ -60,6 +60,7 @@
},
"prettier": "./prettier.json",
"peerDependencies": {
"@eslint/eslintrc": "^3.0.2",
"@typescript-eslint/eslint-plugin": "~5.57.0",
"@typescript-eslint/parser": "~5.57.0",
"eslint": "^8.50.0",
Expand All @@ -76,24 +77,23 @@
"glob": "^9.0.0",
"json-schema": "^0.4.0",
"typescript": "~5.3.3",
"tslib": "^2.2.0"
"tslib": "^2.6.2"
},
"devDependencies": {
"@types/chai": "^4.1.6",
"@types/json-schema": "^7.0.6",
"@types/mocha": "^10.0.0",
"@types/node": "^18.0.0",
"@typescript-eslint/eslint-plugin": "~5.57.0",
"@typescript-eslint/experimental-utils": "~5.57.0",
"@typescript-eslint/parser": "~5.57.0",
"chai": "^4.2.0",
"@typescript-eslint/rule-tester": "^7.3.0",
"@vitest/coverage-istanbul": "^1.4.0",
"cross-env": "^7.0.3",
"eslint": "^8.50.0",
"mocha": "^10.0.0",
"eslint-plugin-markdown": "~3.0.0",
"prettier": "^3.2.5",
"rimraf": "^3.0.0",
"rimraf": "^5.0.5",
"source-map-support": "^0.5.9",
"typescript": "~5.3.3",
"eslint-plugin-markdown": "~3.0.0",
"ts-node": "^10.0.0"
"vitest": "^1.4.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function getPackageMetadata(node: Property): {
const nodeValue = node.value as Literal;
const packageName = nodeValue.value as string;
// Check if there is a sub scope i.e @azure-rest
const [_, subScope] = packageName.match(/^@azure(-[a-z]+)?\//) ?? [];
const [, subScope] = packageName.match(/^@azure(-[a-z]+)?\//) ?? [];

return {
nodeValue,
Expand Down
3 changes: 1 addition & 2 deletions common/tools/eslint-plugin-azure-sdk/tests/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
* @author Arpan Laha
*/

import { describe, it } from "mocha";
import { assert } from "chai";
import { describe, it, assert } from "vitest";
import plugin from "../src";

/**
Expand Down
14 changes: 14 additions & 0 deletions common/tools/eslint-plugin-azure-sdk/tests/ruleTester.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import * as vitest from "vitest";
import { RuleTester } from "@typescript-eslint/rule-tester";

RuleTester.afterAll = vitest.afterAll;

// If you are not using vitest with globals: true (https://vitest.dev/config/#globals):
RuleTester.it = vitest.it;
RuleTester.itOnly = vitest.it.only;
RuleTester.describe = vitest.describe;

export { RuleTester };
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import { RuleTester } from "eslint";
import { RuleTester } from "../ruleTester";
import rule from "../../src/rules/github-source-headers";

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @author Will Temple
*/

import { RuleTester } from "eslint";
import { RuleTester } from "../ruleTester";
import rule from "../../src/rules/ts-apiextractor-json-types";

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Arpan Laha
*/

import { RuleTester } from "eslint";
import { RuleTester } from "../ruleTester";
import rule from "../../src/rules/ts-apisurface-standardized-verbs";

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Arpan Laha
*/

import { RuleTester } from "eslint";
import { RuleTester } from "../ruleTester";
import rule from "../../src/rules/ts-apisurface-supportcancellation";

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Wei Jun Tan
*/

import { RuleTester } from "eslint";
import { RuleTester } from "../ruleTester";
import rule from "../../src/rules/ts-config-include";

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Hamsa Shankar
*/

import { RuleTester } from "eslint";
import { RuleTester } from "../ruleTester";
import rule from "../../src/rules/ts-doc-internal-private-member";

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Arpan Laha
*/

import { RuleTester } from "eslint";
import { RuleTester } from "../ruleTester";
import rule from "../../src/rules/ts-doc-internal";

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Arpan Laha
*/

import { RuleTester } from "eslint";
import { RuleTester } from "../ruleTester";
import rule from "../../src/rules/ts-error-handling";

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Arpan Laha
*/

import { RuleTester } from "eslint";
import { RuleTester } from "../ruleTester";
import rule from "../../src/rules/ts-modules-only-named";

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Arpan Laha
*/

import { RuleTester } from "eslint";
import { RuleTester } from "../ruleTester";
import rule from "../../src/rules/ts-naming-drop-noun";

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Arpan Laha
*/

import { RuleTester } from "eslint";
import { RuleTester } from "../ruleTester";
import rule from "../../src/rules/ts-naming-options";

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Arpan Laha
*/

import { RuleTester } from "eslint";
import { RuleTester } from "../ruleTester";
import rule from "../../src/rules/ts-naming-subclients";

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Arpan Laha
*/

import { RuleTester } from "eslint";
import { RuleTester } from "../ruleTester";
import rule from "../../src/rules/ts-no-const-enums";

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Maor Leger
*/

import { RuleTester } from "eslint";
import { RuleTester } from "../ruleTester";
import rule from "../../src/rules/ts-no-window";

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Arpan Laha
*/

import { RuleTester } from "eslint";
import { RuleTester } from "../ruleTester";
import rule from "../../src/rules/ts-package-json-author";

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Arpan Laha
*/

import { RuleTester } from "eslint";
import { RuleTester } from "../ruleTester";
import rule from "../../src/rules/ts-package-json-bugs";

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

"use strict";

import { RuleTester } from "eslint";
import { RuleTester } from "../ruleTester";
import rule, { LTS } from "../../src/rules/ts-package-json-engine-is-present";

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Arpan Laha
*/

import { RuleTester } from "eslint";
import { RuleTester } from "../ruleTester";
import rule from "../../src/rules/ts-package-json-files-required";

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Arpan Laha
*/

import { RuleTester } from "eslint";
import { RuleTester } from "../ruleTester";
import rule from "../../src/rules/ts-package-json-homepage";

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Arpan Laha
*/

import { RuleTester } from "eslint";
import { RuleTester } from "../ruleTester";
import rule from "../../src/rules/ts-package-json-keywords";

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Arpan Laha
*/

import { RuleTester } from "eslint";
import { RuleTester } from "../ruleTester";
import rule from "../../src/rules/ts-package-json-license";

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Arpan Laha
*/

import { RuleTester } from "eslint";
import { RuleTester } from "../ruleTester";
import rule from "../../src/rules/ts-package-json-main-is-cjs";

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Arpan Laha
*/

import { RuleTester } from "eslint";
import { RuleTester } from "../ruleTester";
import rule from "../../src/rules/ts-package-json-module";

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Arpan Laha
*/

import { RuleTester } from "eslint";
import { RuleTester } from "../ruleTester";
import rule from "../../src/rules/ts-package-json-name";

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Arpan Laha
*/

import { RuleTester } from "eslint";
import { RuleTester } from "../ruleTester";
import rule from "../../src/rules/ts-package-json-repo";

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Arpan Laha
*/

import { RuleTester } from "eslint";
import { RuleTester } from "../ruleTester";
import rule from "../../src/rules/ts-package-json-required-scripts";

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Ben Zhang
*/

import { RuleTester } from "eslint";
import { RuleTester } from "../ruleTester";
import rule from "../../src/rules/ts-package-json-sdktype";

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Arpan Laha
*/

import { RuleTester } from "eslint";
import { RuleTester } from "../ruleTester";
import rule from "../../src/rules/ts-package-json-sideeffects";

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Arpan Laha
*/

import { RuleTester } from "eslint";
import { RuleTester } from "../ruleTester";
import rule from "../../src/rules/ts-package-json-types";

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Arpan Laha
*/

import { RuleTester } from "eslint";
import { RuleTester } from "../ruleTester";
import rule from "../../src/rules/ts-pagination-list";

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Arpan Laha
*/

import { RuleTester } from "eslint";
import { RuleTester } from "../ruleTester";
import rule from "../../src/rules/ts-use-interface-parameters";

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Arpan Laha
*/

import { RuleTester } from "eslint";
import { RuleTester } from "../ruleTester";
import rule from "../../src/rules/ts-use-promises";

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Arpan Laha
*/

import { RuleTester } from "eslint";
import { RuleTester } from "../ruleTester";
import rule from "../../src/rules/ts-versioning-semver";

//------------------------------------------------------------------------------
Expand Down
Loading