diff --git a/lib/reference/properties.cjs b/lib/reference/properties.cjs index ba102496c2..0299d9e3d4 100644 --- a/lib/reference/properties.cjs +++ b/lib/reference/properties.cjs @@ -15,7 +15,6 @@ const acceptCustomIdentsProperties = new Set([ 'list-style-type', ]); -/** @type {import('stylelint').ShorthandToResetToInitialProperty} */ const shorthandToResetToInitialProperty = new Map([ [ 'border', @@ -29,6 +28,7 @@ const shorthandToResetToInitialProperty = new Map([ ]), ], [ + /** @see https://www.w3.org/TR/css-fonts-4/#font-prop */ 'font', new Set([ // prettier-ignore diff --git a/lib/reference/properties.mjs b/lib/reference/properties.mjs index bf9eee7ed7..c1547e3e8e 100644 --- a/lib/reference/properties.mjs +++ b/lib/reference/properties.mjs @@ -11,7 +11,6 @@ export const acceptCustomIdentsProperties = new Set([ 'list-style-type', ]); -/** @type {import('stylelint').ShorthandToResetToInitialProperty} */ export const shorthandToResetToInitialProperty = new Map([ [ 'border', @@ -25,6 +24,7 @@ export const shorthandToResetToInitialProperty = new Map([ ]), ], [ + /** @see https://www.w3.org/TR/css-fonts-4/#font-prop */ 'font', new Set([ // prettier-ignore diff --git a/lib/rules/declaration-block-no-shorthand-property-overrides/index.cjs b/lib/rules/declaration-block-no-shorthand-property-overrides/index.cjs index 6b54258591..ec62ccdade 100644 --- a/lib/rules/declaration-block-no-shorthand-property-overrides/index.cjs +++ b/lib/rules/declaration-block-no-shorthand-property-overrides/index.cjs @@ -5,6 +5,7 @@ const eachDeclarationBlock = require('../../utils/eachDeclarationBlock.cjs'); const report = require('../../utils/report.cjs'); const ruleMessages = require('../../utils/ruleMessages.cjs'); +const uniteSets = require('../../utils/uniteSets.cjs'); const validateOptions = require('../../utils/validateOptions.cjs'); const vendor = require('../../utils/vendor.cjs'); const properties = require('../../reference/properties.cjs'); @@ -43,7 +44,7 @@ const rule = (primary) => { properties.shorthandToResetToInitialProperty ).get(unprefixedProp); // see microsoft/TypeScript#57228 - const union = new Set([...(subProperties ?? []), ...(resettables ?? [])]); + const union = uniteSets(subProperties ?? [], resettables ?? []); declarations.set(prop.toLowerCase(), prop); diff --git a/lib/rules/declaration-block-no-shorthand-property-overrides/index.mjs b/lib/rules/declaration-block-no-shorthand-property-overrides/index.mjs index 805be88f17..eb3b8ef83e 100644 --- a/lib/rules/declaration-block-no-shorthand-property-overrides/index.mjs +++ b/lib/rules/declaration-block-no-shorthand-property-overrides/index.mjs @@ -1,6 +1,7 @@ import eachDeclarationBlock from '../../utils/eachDeclarationBlock.mjs'; import report from '../../utils/report.mjs'; import ruleMessages from '../../utils/ruleMessages.mjs'; +import uniteSets from '../../utils/uniteSets.mjs'; import validateOptions from '../../utils/validateOptions.mjs'; import vendor from '../../utils/vendor.mjs'; @@ -43,7 +44,7 @@ const rule = (primary) => { shorthandToResetToInitialProperty ).get(unprefixedProp); // see microsoft/TypeScript#57228 - const union = new Set([...(subProperties ?? []), ...(resettables ?? [])]); + const union = uniteSets(subProperties ?? [], resettables ?? []); declarations.set(prop.toLowerCase(), prop); diff --git a/types/stylelint/index.d.mts b/types/stylelint/index.d.mts index e41a98829f..61d0c025ca 100644 --- a/types/stylelint/index.d.mts +++ b/types/stylelint/index.d.mts @@ -40,7 +40,6 @@ export { RuleSeverity, Severity, ShorthandProperties, - ShorthandToResetToInitialProperty, StylelintPostcssResult, Utils, Warning, diff --git a/types/stylelint/index.d.ts b/types/stylelint/index.d.ts index 7b6c5c2d5c..11fccc4c68 100644 --- a/types/stylelint/index.d.ts +++ b/types/stylelint/index.d.ts @@ -681,10 +681,6 @@ declare namespace stylelint { | 'text-emphasis' | 'transition'; - type ImplicitResetters = Extract; - /** @internal */ - export type ShorthandToResetToInitialProperty = ReadonlyMap>; - /** @internal */ export type LonghandSubPropertiesOfShorthandProperties = ReadonlyMap< ShorthandProperties,