Skip to content

Commit

Permalink
[eslint-plugin] remove legacy configs (Azure#31203)
Browse files Browse the repository at this point in the history
Now that we have moved to ESLint v9, classic configs are no longer used.
This PR removes them.
  • Loading branch information
jeremymeng authored Sep 25, 2024
1 parent 9fcee80 commit 4abda1b
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 302 deletions.
184 changes: 0 additions & 184 deletions common/tools/eslint-plugin-azure-sdk/src/configs/azure-sdk-base.ts

This file was deleted.

49 changes: 0 additions & 49 deletions common/tools/eslint-plugin-azure-sdk/src/configs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ import eslintCustomized from "./eslint-customized";
import markdownCustomized from "./markdown-customized";
import azureSdkCustomized from "./azure-sdk-customized";

// to keep compat with old .eslintrc style usage
import rootConfig from "./azure-sdk-base";

function recommended(plugin: FlatConfig.Plugin, options: { typeChecked: boolean }) {
return typescriptEslint.config(
{
Expand Down Expand Up @@ -54,52 +51,6 @@ function recommended(plugin: FlatConfig.Plugin, options: { typeChecked: boolean
export default (plugin: FlatConfig.Plugin) => ({
recommended: recommended(plugin, { typeChecked: false }),
recommendedTypeChecked: recommended(plugin, { typeChecked: true }),
"recommended-legacy": {
plugins: ["@azure/azure-sdk"],
env: {
node: true,
},
parser: "@typescript-eslint/parser",
rules: {
"@azure/azure-sdk/github-source-headers": "error",
"@azure/azure-sdk/ts-apiextractor-json-types": "error",
"@azure/azure-sdk/ts-apisurface-standardized-verbs": "error",
"@azure/azure-sdk/ts-apisurface-supportcancellation": "error",
"@azure/azure-sdk/ts-config-include": "error",
"@azure/azure-sdk/ts-doc-internal": "error",
"@azure/azure-sdk/ts-doc-internal-private-member": "warn",
"@azure/azure-sdk/ts-error-handling": "off",
"@azure/azure-sdk/ts-modules-only-named": "error",
"@azure/azure-sdk/ts-naming-drop-noun": "error",
"@azure/azure-sdk/ts-naming-options": "error",
"@azure/azure-sdk/ts-naming-subclients": "error",
"@azure/azure-sdk/ts-no-const-enums": "warn",
"@azure/azure-sdk/ts-no-window": "error",
"@azure/azure-sdk/ts-package-json-author": "error",
"@azure/azure-sdk/ts-package-json-bugs": "error",
"@azure/azure-sdk/ts-package-json-engine-is-present": "error",
"@azure/azure-sdk/ts-package-json-files-required": "error",
"@azure/azure-sdk/ts-package-json-homepage": "error",
"@azure/azure-sdk/ts-package-json-keywords": "error",
"@azure/azure-sdk/ts-package-json-license": "error",
"@azure/azure-sdk/ts-package-json-main-is-cjs": "error",
"@azure/azure-sdk/ts-package-json-module": "error",
"@azure/azure-sdk/ts-package-json-name": "error",
"@azure/azure-sdk/ts-package-json-repo": "error",
"@azure/azure-sdk/ts-package-json-required-scripts": "error",
"@azure/azure-sdk/ts-package-json-sdktype": "error",
"@azure/azure-sdk/ts-package-json-sideeffects": "error",
"@azure/azure-sdk/ts-package-json-types": "error",
"@azure/azure-sdk/ts-pagination-list": "error",
"@azure/azure-sdk/ts-use-interface-parameters": "warn",
"@azure/azure-sdk/ts-use-promises": "error",
"@azure/azure-sdk/ts-versioning-semver": "error",
},
settings: {
main: "src/index.ts",
},
},
"azure-sdk-base": rootConfig,
internal: typescriptEslint.config(
{
ignores: ["**/generated/**", "**/*.config.{js,cjs,mjs,ts,cts,mts}"],
Expand Down
69 changes: 0 additions & 69 deletions common/tools/eslint-plugin-azure-sdk/tests/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,75 +157,6 @@ describe("plugin", (): void => {
it("recommended should be a member of configs", (): void => {
assert.property(configs, "recommended", "recommended is not a member of configs");
});
const recommendedLegacy = configs["recommended-legacy"];
describe("plugins", (): void => {
it("plugins should be a member of recommended", (): void => {
assert.property(recommendedLegacy, "plugins", "plugins is not a member of recommended");
});
const plugins = recommendedLegacy.plugins;
it("plugins should be an array", (): void => {
assert.isArray(plugins, "plugins is not an array");
});
it("plugins should contain '@azure/azure-sdk'", (): void => {
assert.include(
plugins,
"@azure/azure-sdk",
"plugins does not contain '@azure/azure-sdk'",
);
});
});
describe("env", (): void => {
it("env should be a member of recommended", (): void => {
assert.property(recommendedLegacy, "env", "env is not a member of recommended");
});
const env = recommendedLegacy.env;
it("env should be an object", (): void => {
assert.isObject(env, "env is not an object");
});
});
describe("parser", (): void => {
it("parser should be a member of recommended", (): void => {
assert.property(recommendedLegacy, "parser", "parser is not a member of recommmended");
});
const parser = recommendedLegacy.parser;
it("parser should be set to '@typescript-eslint/parser'", (): void => {
assert.strictEqual(
parser,
"@typescript-eslint/parser",
"parser is not set to '@typescript-eslint/parser'",
);
});
});
describe("rules", (): void => {
it("rules should be a member of recommended", (): void => {
assert.property(recommendedLegacy, "rules", "rules is not a member of recommended");
});
const rules = recommendedLegacy.rules;
it("rules should contain settings for every supported rule", (): void => {
ruleList.forEach((rule: string): void => {
assert.property(
rules,
`@azure/azure-sdk/${rule}`,
`rules does not contain a setting for ${rule}`,
);
});
});
});
describe("settings", (): void => {
it("settings should be a member of recommended-legacy", (): void => {
assert.property(recommendedLegacy, "settings", "settings is not a member of recommended");
});
const settings = recommendedLegacy.settings;
describe("main", (): void => {
it("main should be a member of settings", (): void => {
assert.property(settings, "main", "main is not a member of settings");
});
const main = settings.main;
it("main should be set to 'src/index.ts'", (): void => {
assert.strictEqual(main, "src/index.ts", "main is not set to 'src/index.ts'");
});
});
});
});
});
});

0 comments on commit 4abda1b

Please sign in to comment.