Skip to content

Commit cdec711

Browse files
committed
perf: update some rules messageArgs
1 parent 3d26b39 commit cdec711

35 files changed

+135
-267
lines changed
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
import type { RegExpLike } from '../../utils'
22
import type { RuleConfig } from '../rule-config'
33

4-
export interface AnnotationNoUnknownSecondaryOptions {
5-
/**
6-
* Specify which annotations to ignore.
7-
*/
8-
ignoreAnnotations?: RegExpLike[]
9-
10-
message?: string | ((annotation: string) => string)
11-
}
124
export type AnnotationNoUnknownOptions = RuleConfig<
135
true,
14-
AnnotationNoUnknownSecondaryOptions
6+
{
7+
/**
8+
* Specify which annotations to ignore.
9+
*/
10+
ignoreAnnotations?: RegExpLike[]
11+
12+
message?: string | ((annotation: string) => string)
13+
}
1514
>
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
import type { AtRules } from '../../types'
22
import type { RuleConfig } from '../rule-config'
33

4-
export type AtRuleAllowedListPrimaryOptions = AtRules[] | string[]
5-
export interface AtRuleAllowedListSecondaryOptions {
6-
message?: string | ((atRule: string) => string)
7-
}
8-
94
export type AtRuleAllowedListOptions = RuleConfig<
10-
AtRuleAllowedListPrimaryOptions,
11-
AtRuleAllowedListSecondaryOptions
5+
AtRules[] | string[],
6+
{
7+
message?: string | ((atRule: string) => string)
8+
}
129
>
Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
import type { AtRules } from '../../types'
22
import type { RuleConfig } from '../rule-config'
33

4-
export type AtRuleDisallowedListPrimaryOptions = AtRules[] | string[]
5-
6-
export interface AtRuleDisallowedListSecondaryOptions {
7-
message?: string | ((atRule: string) => string)
8-
}
9-
104
export type AtRuleDisallowedListOptions = RuleConfig<
11-
AtRuleDisallowedListPrimaryOptions,
12-
AtRuleDisallowedListSecondaryOptions
5+
AtRules[] | string[],
6+
{
7+
message?: string | ((atRule: string) => string)
8+
}
139
>

src/rules/stylelint/at-rule-empty-line-before.d.ts

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,12 @@ import type { AtRules } from '../../types'
22
import type { LiteralUnion } from '../../utils'
33
import type { RuleConfig } from '../rule-config'
44

5-
export type AtRuleEmptyLineBeforePrimaryOptions = 'always' | 'never'
6-
7-
export type AtRuleEmptyLineBeforeExcept = LiteralUnion<'after-same-name' | 'inside-block' | 'blockless-after-same-name-blockless' | 'blockless-after-blockless' | 'first-nested'>
8-
9-
export type AtRuleEmptyLineBeforeExceptIgnore = LiteralUnion<'after-comment' | 'first-nested' | 'inside-block' | 'blockless-after-same-name-blockless' | 'blockless-after-blockless'>
10-
11-
export interface AtRuleEmptyLineBeforeSecondaryOptions {
12-
except?: AtRuleEmptyLineBeforeExcept[]
13-
ignore?: AtRuleEmptyLineBeforeExceptIgnore[]
14-
ignoreAtRules?: AtRules[]
15-
message?: string | ((atRule: string) => string)
16-
}
17-
185
export type AtRuleEmptyLineBeforeOptions = RuleConfig<
19-
AtRuleEmptyLineBeforePrimaryOptions,
20-
AtRuleEmptyLineBeforeSecondaryOptions
6+
'always' | 'never',
7+
{
8+
except?: LiteralUnion<'after-same-name' | 'inside-block' | 'blockless-after-same-name-blockless' | 'blockless-after-blockless' | 'first-nested'>[]
9+
ignore?: LiteralUnion<'after-comment' | 'first-nested' | 'inside-block' | 'blockless-after-same-name-blockless' | 'blockless-after-blockless'>[]
10+
ignoreAtRules?: AtRules[]
11+
message?: string | ((atRule: string) => string)
12+
}
2113
>
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import type { RuleConfig } from '../rule-config'
22

3-
export interface AtRuleNoUnknownSecondaryOptions {
4-
ignoreAtRules?: (string | RegExp)[]
5-
message?: string | ((atRule: string) => string)
6-
}
7-
83
export type AtRuleNoUnknownOptions = RuleConfig<
94
true,
10-
AtRuleNoUnknownSecondaryOptions
5+
{
6+
ignoreAtRules?: (string | RegExp)[]
7+
message?: string | ((atRule: string) => string)
8+
}
119
>
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import type { RuleConfig } from '../rule-config'
22

3-
export interface AtRuleNoVendorPrefixSecondaryOptions {
4-
message: string | ((atRule: string) => string)
5-
}
6-
73
export type AtRuleNoVendorPrefixOptions = RuleConfig<
84
true,
9-
AtRuleNoVendorPrefixSecondaryOptions
5+
{
6+
message: string | ((atRule: string) => string)
7+
}
108
>
Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
import type { AtRules, CSSPropertiesMap } from '../../types'
22
import type { RuleConfig } from '../rule-config'
33

4-
export type AtRulePropertyRequiredListPrimaryOptions =
5-
| Record<AtRules, CSSPropertiesMap | CSSPropertiesMap[]>
6-
7-
export interface AtRulePropertyRequiredListSecondaryOptions {
8-
message?: string | ((atRule: string, property: string) => string)
9-
}
10-
114
export type AtRulePropertyRequiredListOptions = RuleConfig<
12-
AtRulePropertyRequiredListPrimaryOptions,
13-
AtRulePropertyRequiredListSecondaryOptions
5+
Record<AtRules, CSSPropertiesMap | CSSPropertiesMap[]>,
6+
{
7+
message?: string | ((atRule: string, property: string) => string)
8+
}
149
>
Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
import type { RuleConfig } from '../rule-config'
22

3-
export type BlockNoEmptyIgnore = 'comments'
4-
5-
export interface BlockNoEmptySecondaryOptions {
6-
ignore?: BlockNoEmptyIgnore[]
7-
message?: string | ((block: string) => string)
8-
}
9-
103
export type BlockNoEmptyOptions = RuleConfig<
114
true,
12-
BlockNoEmptySecondaryOptions
5+
{
6+
ignore?: ('comments')[]
7+
message?: string | ((block: string) => string)
8+
}
139
>
Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
import type { RuleConfig } from '../rule-config'
22

3-
export type ColorFunctionNatationPrimaryOptions = 'modern' | 'legacy'
4-
5-
type ColorFunctionNatationIgnore = 'with-var-inside'
6-
7-
export interface ColorFunctionNatationSecondaryOptions {
8-
ignore?: ColorFunctionNatationIgnore[]
9-
message?: string | ((primary: string) => string)
10-
}
11-
123
export type ColorFunctionNatationOptions = RuleConfig<
13-
ColorFunctionNatationPrimaryOptions,
14-
ColorFunctionNatationSecondaryOptions
4+
'modern' | 'legacy',
5+
{
6+
ignore?: ('with-var-inside')[]
7+
message?: string | ((primary: string) => string)
8+
}
159
>
Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
import type { RuleConfig } from '../rule-config'
22

3-
export type ColorHexAlphaPrimaryOptions = 'always' | 'never'
4-
5-
export interface ColorHexAlphaSecondaryOptions {
6-
message?: string | ((hex: string) => string)
7-
}
8-
93
export type ColorHexAlphaOptions = RuleConfig<
10-
ColorHexAlphaPrimaryOptions,
11-
ColorHexAlphaSecondaryOptions
4+
'always' | 'never',
5+
{
6+
message?: string | ((hex: string) => string)
7+
}
128
>

0 commit comments

Comments
 (0)