Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove all rulesets #927

Merged
merged 14 commits into from
Jul 16, 2024
9 changes: 9 additions & 0 deletions .chronus/changes/no-all-rulsets-2024-4-28-17-4-14.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
changeKind: fix
packages:
- "@azure-tools/typespec-azure-core"
- "@azure-tools/typespec-azure-resource-manager"
---

Remove explicit `all` rulesets
41 changes: 1 addition & 40 deletions packages/typespec-azure-core/src/linter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { authRequiredRule } from "./rules/auth-required.js";
import { byosRule } from "./rules/byos.js";
import { casingRule } from "./rules/casing.js";
import { compositionOverInheritanceRule } from "./rules/composition-over-inheritance.js";
import { friendlyNameRule } from "./rules/friendly-name.js";
timotheeguerin marked this conversation as resolved.
Show resolved Hide resolved
import { knownEncodingRule } from "./rules/known-encoding.js";
import { longRunningOperationsRequirePollingOperation } from "./rules/lro-polling-operation.js";
import { noClosedLiteralUnionRule } from "./rules/no-closed-literal-union.js";
Expand Down Expand Up @@ -73,47 +72,9 @@ const rules = [
export const $linter = defineLinter({
rules,
ruleSets: {
all: {
enable: {
[`@azure-tools/typespec-azure-core/${apiVersionRule.name}`]: true,
[`@azure-tools/typespec-azure-core/${authRequiredRule.name}`]: true,
[`@azure-tools/typespec-azure-core/${operationIdRule.name}`]: true,
[`@azure-tools/typespec-azure-core/${bodyArrayRule.name}`]: true,
[`@azure-tools/typespec-azure-core/${byosRule.name}`]: true,
[`@azure-tools/typespec-azure-core/${casingRule.name}`]: true,
[`@azure-tools/typespec-azure-core/${compositionOverInheritanceRule.name}`]: true,
[`@azure-tools/typespec-azure-core/${spreadDiscriminatedModelRule.name}`]: true,
[`@azure-tools/typespec-azure-core/${preferCsvCollectionFormatRule.name}`]: true,
[`@azure-tools/typespec-azure-core/${knownEncodingRule.name}`]: true,
[`@azure-tools/typespec-azure-core/${useStandardOperations.name}`]: true,
[`@azure-tools/typespec-azure-core/${noErrorStatusCodesRule.name}`]: true,
[`@azure-tools/typespec-azure-core/${noNullableRule.name}`]: true,
[`@azure-tools/typespec-azure-core/${noOffsetDateTimeRule.name}`]: true,
[`@azure-tools/typespec-azure-core/${noRpcPathParamsRule.name}`]: true,
[`@azure-tools/typespec-azure-core/${noExplicitRoutesResourceOps.name}`]: true,
[`@azure-tools/typespec-azure-core/${noResponseBodyRule.name}`]: true,
[`@azure-tools/typespec-azure-core/${preventFormatUse.name}`]: true,
[`@azure-tools/typespec-azure-core/${preventMultipleDiscriminator.name}`]: true,
[`@azure-tools/typespec-azure-core/${preventRestLibraryInterfaces.name}`]: true,
[`@azure-tools/typespec-azure-core/${preventUnknownType.name}`]: true,
[`@azure-tools/typespec-azure-core/${recordTypeRule.name}`]: true,
[`@azure-tools/typespec-azure-core/${responseSchemaMultiStatusCodeRule.name}`]: true,
[`@azure-tools/typespec-azure-core/${propertyNameRule.name}`]: true,
[`@azure-tools/typespec-azure-core/${rpcOperationRequestBodyRule.name}`]: true,
[`@azure-tools/typespec-azure-core/${requireDocumentation.name}`]: true,
[`@azure-tools/typespec-azure-core/${requireKeyVisibility.name}`]: true,
[`@azure-tools/typespec-azure-core/${longRunningOperationsRequirePollingOperation.name}`]:
true,
[`@azure-tools/typespec-azure-core/${useStandardNames.name}`]: true,
[`@azure-tools/typespec-azure-core/${friendlyNameRule.name}`]: true,
[`@azure-tools/typespec-azure-core/${noEnumRule.name}`]: true,
[`@azure-tools/typespec-azure-core/${noClosedLiteralUnionRule.name}`]: true,
},
extends: ["@typespec/http/all"],
},
"canonical-versioning": {
enable: {
[`@azure-tools/typespec-azure-core/${nonBreakingVersioningRule.name}`]: false,
[`@azure-tools/typespec-azure-core/${nonBreakingVersioningRule.name}`]: true,
},
},
},
Expand Down
19 changes: 0 additions & 19 deletions packages/typespec-azure-resource-manager/src/linter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,6 @@ const rules = [
unsupportedTypeRule,
];

const allRulesEnabled = Object.fromEntries(
rules.map((rule) => [`@azure-tools/typespec-azure-resource-manager/${rule.name}`, true])
);

export const $linter = defineLinter({
rules,
ruleSets: {
markcowl marked this conversation as resolved.
Show resolved Hide resolved
all: {
extends: [
"@azure-tools/typespec-azure-core/all",
"@azure-tools/typespec-azure-core/canonical-versioning",
],
enable: {
...allRulesEnabled,
},
disable: {
[`@azure-tools/typespec-azure-core/bad-record-type`]:
"This clashes with the ARM `no-record` rule.",
},
},
},
});
Loading