Skip to content

Commit fe45ded

Browse files
committed
feat: add reportUnscopedDisables option
1 parent cca29af commit fe45ded

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/config/index.d.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { CustomSyntax, Formatter, FormatterType, Rule, Severity } from 'stylelint'
1+
import type { ConfigRuleSettings, CustomSyntax, DisableOptions, Formatter, FormatterType, Rule, Severity } from 'stylelint'
22
import type { Rules } from '../rules'
33
import type { LiteralUnion } from '../utils'
44
import type { KnownCustomSyntax } from './customSyntax'
@@ -24,6 +24,8 @@ export interface Override extends Omit<StylelintConfig, 'overrides'> {
2424
name?: string
2525
}
2626

27+
export type DisableSettings = ConfigRuleSettings<boolean, DisableOptions>
28+
2729
/**
2830
* Stylelint configuration
2931
* @see [Stylelint configuration](https://stylelint.io/user-guide/configure)
@@ -122,21 +124,28 @@ export interface StylelintConfig {
122124
*
123125
* @see [Report descriptionless disables](https://stylelint.io/user-guide/options#reportdescriptionlessdisables)
124126
*/
125-
reportDescriptionlessDisables?: boolean
127+
reportDescriptionlessDisables?: DisableSettings
126128

127129
/**
128130
* Report `stylelint-disable` comments that don't match rules that are specified in the configuration object.
129131
*
130132
* @see [Report invalid scope disables](https://stylelint.io/user-guide/options#reportinvalidscopedisables)
131133
*/
132-
reportInvalidScopeDisables?: boolean
134+
reportInvalidScopeDisables?: DisableSettings
133135

134136
/**
135137
* Report stylelint-disable comments that don't match any lints that need to be disabled.
136138
*
137139
* @see [Report needless disables](https://stylelint.io/user-guide/options#reportneedlessdisables)
138140
*/
139-
reportNeedlessDisables?: boolean
141+
reportNeedlessDisables?: DisableSettings
142+
143+
/**
144+
* Report configuration comments that are not scoped to at least one rule.
145+
*
146+
* @see [Report unscoped disables](https://stylelint.io/user-guide/options#reportunscopeddisables)
147+
*/
148+
reportUnscopedDisables?: DisableSettings
140149

141150
/**
142151
* You can set the default severity level for all rules that do not have a severity specified in their secondary options.

0 commit comments

Comments
 (0)