Skip to content

Commit

Permalink
code review #1
Browse files Browse the repository at this point in the history
  • Loading branch information
Mouvedia committed Apr 17, 2024
1 parent ccbc604 commit 1564f4c
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/reference/properties.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const acceptCustomIdentsProperties = new Set([
'list-style-type',
]);

/** @type {import('stylelint').ShorthandToResetToInitialProperty} */
const shorthandToResetToInitialProperty = new Map([
[
'border',
Expand All @@ -29,6 +28,7 @@ const shorthandToResetToInitialProperty = new Map([
]),
],
[
/** @see https://www.w3.org/TR/css-fonts-4/#font-prop */
'font',
new Set([
// prettier-ignore
Expand Down
2 changes: 1 addition & 1 deletion lib/reference/properties.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export const acceptCustomIdentsProperties = new Set([
'list-style-type',
]);

/** @type {import('stylelint').ShorthandToResetToInitialProperty} */
export const shorthandToResetToInitialProperty = new Map([
[
'border',
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -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);

Expand Down
1 change: 0 additions & 1 deletion types/stylelint/index.d.mts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export {
RuleSeverity,
Severity,
ShorthandProperties,
ShorthandToResetToInitialProperty,
StylelintPostcssResult,
Utils,
Warning,
Expand Down
4 changes: 0 additions & 4 deletions types/stylelint/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -681,10 +681,6 @@ declare namespace stylelint {
| 'text-emphasis'
| 'transition';

type ImplicitResetters = Extract<ShorthandProperties, 'border' | 'flex' | 'font'>;
/** @internal */
export type ShorthandToResetToInitialProperty = ReadonlyMap<ImplicitResetters, Set<string>>;

/** @internal */
export type LonghandSubPropertiesOfShorthandProperties = ReadonlyMap<
ShorthandProperties,
Expand Down

0 comments on commit 1564f4c

Please sign in to comment.