@stylelint-types/stylelint-scss 6.1.0 → 6.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/rules/at-import-partial-extension-allowed-list.d.ts +5 -0
- package/lib/rules/at-import-partial-extension-disallowed-list.d.ts +5 -0
- package/lib/rules/at-mixin-no-risky-nesting-selector.d.ts +3 -0
- package/lib/rules/declaration-property-value-no-unknown.d.ts +31 -0
- package/lib/rules/load-partial-extension.d.ts +5 -0
- package/lib/rules/property-no-unknown.d.ts +10 -0
- package/lib/types.d.ts +89 -0
- package/package.json +9 -10
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { CSSPropertiesMap, RuleConfig } from 'stylelint-define-config'
|
|
2
|
+
|
|
3
|
+
export type DeclarationPropertyValueNoUnknownOptions = RuleConfig<
|
|
4
|
+
true,
|
|
5
|
+
{
|
|
6
|
+
/**
|
|
7
|
+
* Ignore the specified property and value pairs.
|
|
8
|
+
* Keys in the object indicate property names.
|
|
9
|
+
* If a string in the object is surrounded with `"/"`,
|
|
10
|
+
* it's interpreted as a regular expression.
|
|
11
|
+
*
|
|
12
|
+
* For example, `"/.+/"` matches any strings.
|
|
13
|
+
*/
|
|
14
|
+
ignoreProperties?: Record<CSSPropertiesMap, (string | RegExp)[] | string | RegExp>
|
|
15
|
+
/**
|
|
16
|
+
* Extend or alter the properties syntax dictionary.
|
|
17
|
+
* [CSS Value Definition Syntax](https://github.com/csstree/csstree/blob/master/docs/definition-syntax.md) is used to define a value's syntax.
|
|
18
|
+
* If a definition starts with `|` it is added to the [existing definition value](https://csstree.github.io/docs/syntax/) if any.
|
|
19
|
+
*/
|
|
20
|
+
propertiesSyntax?: Record<CSSPropertiesMap, string>
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Extend or alter the types syntax dictionary.
|
|
24
|
+
* [CSS Value Definition Syntax](https://github.com/csstree/csstree/blob/master/docs/definition-syntax.md) is used to define a value's syntax.
|
|
25
|
+
* If a definition starts with `|` it is added to the [existing definition value](https://csstree.github.io/docs/syntax/) if any.
|
|
26
|
+
*
|
|
27
|
+
* Types are something like a preset which allows you to reuse a definition across other definitions. So, you'll likely want to also use the `propertiesSyntax` option when using this option.
|
|
28
|
+
*/
|
|
29
|
+
typesSyntax?: Record<string, string>
|
|
30
|
+
}
|
|
31
|
+
>
|
|
@@ -4,8 +4,18 @@ export type PropertyNoUnknownOptions = RuleConfig<
|
|
|
4
4
|
true,
|
|
5
5
|
{
|
|
6
6
|
ignoreProperties?: (string | RegExp)[]
|
|
7
|
+
/**
|
|
8
|
+
* Skips checking properties of the given selectors against this rule.
|
|
9
|
+
*/
|
|
7
10
|
ignoreSelectors?: (string | RegExp)[]
|
|
11
|
+
/**
|
|
12
|
+
* Ignores properties nested within specified at-rules.
|
|
13
|
+
*/
|
|
8
14
|
ignoreAtRules?: (AtRules | RegExpLike)[]
|
|
15
|
+
/**
|
|
16
|
+
* If `true`, this rule will check vendor-prefixed properties.
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
9
19
|
checkPrefixed?: boolean
|
|
10
20
|
}
|
|
11
21
|
>
|
package/lib/types.d.ts
CHANGED
|
@@ -64,6 +64,11 @@ import type { SelectorNoRedundantNestingSelectorOptions } from './rules/selector
|
|
|
64
64
|
import type { SelectorNoUnionClassNameOptions } from './rules/selector-no-union-class-name'
|
|
65
65
|
import type { SelectorNestCombinatorsOptions } from './rules/selector-nest-combinators'
|
|
66
66
|
import type { NoUnusedPrivateMembersOptions } from './rules/no-unused-private-members'
|
|
67
|
+
import type { AtImportPartialExtensionAllowedListOptions } from './rules/at-import-partial-extension-allowed-list'
|
|
68
|
+
import type { AtImportPartialExtensionDisallowedListOptions } from './rules/at-import-partial-extension-disallowed-list'
|
|
69
|
+
import type { AtMixinNoRiskyNestingSelectorOptions } from './rules/at-mixin-no-risky-nesting-selector'
|
|
70
|
+
import type { LoadPartialExtensionOptions } from './rules/load-partial-extension'
|
|
71
|
+
import type { DeclarationPropertyValueNoUnknownOptions } from './rules/declaration-property-value-no-unknown'
|
|
67
72
|
|
|
68
73
|
export interface Extends {
|
|
69
74
|
'stylelint-config-standard-scss': void
|
|
@@ -181,6 +186,8 @@ interface RuleOptions {
|
|
|
181
186
|
'scss/at-if-no-null': AtIfNoNullOptions
|
|
182
187
|
|
|
183
188
|
/**
|
|
189
|
+
* @deprecated Use `load-partial-extension` instead, and will be removed in '7.0'.
|
|
190
|
+
*
|
|
184
191
|
* Require or disallow extension in `@import` commands.
|
|
185
192
|
*
|
|
186
193
|
* The rule ignores [cases](https://sass-lang.com/documentation/at-rules/import) when Sass considers an `@import` command just a plain CSS import:
|
|
@@ -207,6 +214,8 @@ interface RuleOptions {
|
|
|
207
214
|
'scss/at-import-no-partial-leading-underscore': AtImportNoPartialLeadingUnderscoreOptions
|
|
208
215
|
|
|
209
216
|
/**
|
|
217
|
+
* @deprecated Use `at-import-partial-extension-disallowed-list` instead, and will be removed in '7.0'.
|
|
218
|
+
*
|
|
210
219
|
* Specify a blacklist of disallowed file extensions for partial names in `@import` commands.
|
|
211
220
|
*
|
|
212
221
|
* The rule ignores [cases](https://sass-lang.com/documentation/at-rules/import) when Sass considers an `@import` command just a plain CSS import:
|
|
@@ -220,6 +229,8 @@ interface RuleOptions {
|
|
|
220
229
|
'scss/at-import-partial-extension-blacklist': AtImportPartialExtensionBlacklistOptions
|
|
221
230
|
|
|
222
231
|
/**
|
|
232
|
+
* @deprecated Use `at-import-partial-extension-allowed-list` instead, and will be removed in '7.0'.
|
|
233
|
+
*
|
|
223
234
|
* Specify a whitelist of allowed file extensions for partial names in `@import` commands.
|
|
224
235
|
*
|
|
225
236
|
* The rule ignores [cases](https://sass-lang.com/documentation/at-rules/import) when Sass considers an `@import` command just a plain CSS import:
|
|
@@ -232,6 +243,32 @@ interface RuleOptions {
|
|
|
232
243
|
*/
|
|
233
244
|
'scss/at-import-partial-extension-whitelist': AtImportPartialExtensionWhitelistOptions
|
|
234
245
|
|
|
246
|
+
/**
|
|
247
|
+
* Specify a whitelist of allowed file extensions for partial names in `@import` commands.
|
|
248
|
+
*
|
|
249
|
+
* The rule ignores [cases](https://sass-lang.com/documentation/at-rules/import) when Sass considers an `@import` command just a plain CSS import:
|
|
250
|
+
* - If the file’s extension is `.css`.
|
|
251
|
+
* - If the filename begins with `http://` (or any other protocol).
|
|
252
|
+
* - If the filename is a `url()`.
|
|
253
|
+
* - If the `@import` has any media queries.
|
|
254
|
+
*
|
|
255
|
+
* @see [at-import-partial-extension-allowed-list](https://github.com/stylelint-scss/stylelint-scss/blob/master/src/rules/at-import-partial-extension-allowed-list)
|
|
256
|
+
*/
|
|
257
|
+
'scss/at-import-partial-extension-allowed-list': AtImportPartialExtensionAllowedListOptions
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Specify a blacklist of disallowed file extensions for partial names in `@import` commands.
|
|
261
|
+
*
|
|
262
|
+
* The rule ignores [cases](https://sass-lang.com/documentation/at-rules/import) when Sass considers an `@import` command just a plain CSS import:
|
|
263
|
+
* - If the file’s extension is `.css`.
|
|
264
|
+
* - If the filename begins with `http://` (or any other protocol).
|
|
265
|
+
* - If the filename is a `url()`.
|
|
266
|
+
* - If the `@import` has any media queries.
|
|
267
|
+
*
|
|
268
|
+
* @see [at-import-partial-extension-disallowed-list](https://github.com/stylelint-scss/stylelint-scss/blob/master/src/rules/at-import-partial-extension-disallowed-list)
|
|
269
|
+
*/
|
|
270
|
+
'scss/at-import-partial-extension-disallowed-list': AtImportPartialExtensionDisallowedListOptions
|
|
271
|
+
|
|
235
272
|
/**
|
|
236
273
|
* Require named parameters in at-mixin call rule.
|
|
237
274
|
*
|
|
@@ -239,6 +276,22 @@ interface RuleOptions {
|
|
|
239
276
|
*/
|
|
240
277
|
'scss/at-mixin-named-arguments': AtMixinNamedArgumentsOptions
|
|
241
278
|
|
|
279
|
+
/**
|
|
280
|
+
* Disallow risky nesting selectors within a mixin.
|
|
281
|
+
*
|
|
282
|
+
* If a mixin contains a parent selector within another style rule,
|
|
283
|
+
* and is used in a nested context, the output selector may include the outermost
|
|
284
|
+
* parent selector in an unexpected way.
|
|
285
|
+
*
|
|
286
|
+
* This only occurs when a parent selector meets all of the following conditions:
|
|
287
|
+
* - Is within a `@mixin` rule.
|
|
288
|
+
* - Is nested within another style rule.
|
|
289
|
+
* - Is not positioned at the beginning of a complex selector.
|
|
290
|
+
*
|
|
291
|
+
* @see [at-mixin-no-risky-nesting-selector](https://github.com/stylelint-scss/stylelint-scss/blob/master/src/rules/at-mixin-no-risky-nesting-selector)
|
|
292
|
+
*/
|
|
293
|
+
'scss/at-mixin-no-risky-nesting-selector': AtMixinNoRiskyNestingSelectorOptions
|
|
294
|
+
|
|
242
295
|
/**
|
|
243
296
|
* Require or disallow parentheses in argumentless `@mixin` calls.
|
|
244
297
|
*
|
|
@@ -344,6 +397,27 @@ interface RuleOptions {
|
|
|
344
397
|
*/
|
|
345
398
|
'scss/declaration-nested-properties': DeclarationNestedPropertiesOptions
|
|
346
399
|
|
|
400
|
+
/**
|
|
401
|
+
* Disallow unknown values for properties within declarations.
|
|
402
|
+
*
|
|
403
|
+
* This rule considers values for properties defined within the CSS specifications to be known. You can use the `propertiesSyntax` and `typesSyntax` secondary options to extend the syntax.
|
|
404
|
+
*
|
|
405
|
+
* This rule is only appropriate for CSS. You should not turn it on for CSS-like languages, such as Sass or Less, as they have their own syntaxes.
|
|
406
|
+
*
|
|
407
|
+
* This rule is experimental with some false negatives that we'll patch in minor releases.
|
|
408
|
+
*
|
|
409
|
+
* It sometimes overlaps with:
|
|
410
|
+
* - [`color-no-invalid-hex`](https://github.com/stylelint-scss/stylelint-scss/blob/master/src/rules/color-no-invalid-hex/README.md)
|
|
411
|
+
* - [`function-no-unknown`](https://github.com/stylelint-scss/stylelint-scss/blob/master/src/rules/function-no-unknown/README.md)
|
|
412
|
+
* - [`string-no-newline`](https://github.com/stylelint-scss/stylelint-scss/blob/master/src/rules/string-no-newline/README.md)
|
|
413
|
+
* - [`unit-no-unknown`](https://github.com/stylelint-scss/stylelint-scss/blob/master/src/rules/unit-no-unknown/README.md)
|
|
414
|
+
*
|
|
415
|
+
* If duplicate problems are flagged, you can turn off the corresponding rule.
|
|
416
|
+
*
|
|
417
|
+
* @see [declaration-property-value-no-unknown](https://github.com/stylelint-scss/stylelint-scss/blob/master/src/rules/declaration-property-value-no-unknown)
|
|
418
|
+
*/
|
|
419
|
+
'scss/declaration-property-value-no-unknown': DeclarationPropertyValueNoUnknownOptions
|
|
420
|
+
|
|
347
421
|
/**
|
|
348
422
|
* Disallow `/*`-comments.
|
|
349
423
|
*
|
|
@@ -572,6 +646,21 @@ interface RuleOptions {
|
|
|
572
646
|
*/
|
|
573
647
|
'scss/load-no-partial-leading-underscore': LoadNoPartialLeadingUnderscoreOptions
|
|
574
648
|
|
|
649
|
+
/**
|
|
650
|
+
* Require or disallow extension in `@import`, `@use`, `@forward`, and `[meta.load-css]` commands.
|
|
651
|
+
*
|
|
652
|
+
* The [`fix` option](https://stylelint.io/user-guide/usage/options#fix) can automatically fix all of the problems reported by this rule only when `"never"` is given.
|
|
653
|
+
*
|
|
654
|
+
* The rule ignores [cases](https://sass-lang.com/documentation/at-rules/import) when Sass considers an `@import` command just a plain CSS import:
|
|
655
|
+
* - If the file’s extension is `.css`.
|
|
656
|
+
* - If the filename begins with `http://` (or any other protocol).
|
|
657
|
+
* - If the filename is a `url()`.
|
|
658
|
+
* - If the `@import` has any media queries.
|
|
659
|
+
*
|
|
660
|
+
* @see [load-partial-extension](https://github.com/stylelint-scss/stylelint-scss/blob/master/src/rules/load-partial-extension)
|
|
661
|
+
*/
|
|
662
|
+
'scss/load-partial-extension': LoadPartialExtensionOptions
|
|
663
|
+
|
|
575
664
|
/**
|
|
576
665
|
* Require quoted keys in Sass maps.
|
|
577
666
|
*
|
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stylelint-types/stylelint-scss",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.
|
|
5
|
-
"packageManager": "pnpm@8.15.3",
|
|
4
|
+
"version": "6.5.0",
|
|
6
5
|
"description": "TypeScript definitions for stylelint-define-config",
|
|
7
6
|
"author": "pengzhanbo <volodymyr@foxmail.com> (https://github.com/pengzhanbo)",
|
|
8
7
|
"license": "MIT",
|
|
@@ -52,14 +51,14 @@
|
|
|
52
51
|
}
|
|
53
52
|
},
|
|
54
53
|
"devDependencies": {
|
|
55
|
-
"@pengzhanbo/eslint-config": "^1.
|
|
56
|
-
"bumpp": "^9.
|
|
57
|
-
"conventional-changelog-cli": "^
|
|
58
|
-
"eslint": "^
|
|
59
|
-
"stylelint": "^16.2
|
|
60
|
-
"stylelint-define-config": "^1.
|
|
61
|
-
"stylelint-scss": "^6.
|
|
62
|
-
"typescript": "^5.
|
|
54
|
+
"@pengzhanbo/eslint-config": "^1.12.0",
|
|
55
|
+
"bumpp": "^9.5.1",
|
|
56
|
+
"conventional-changelog-cli": "^5.0.0",
|
|
57
|
+
"eslint": "^9.9.0",
|
|
58
|
+
"stylelint": "^16.8.2",
|
|
59
|
+
"stylelint-define-config": "^1.6.0",
|
|
60
|
+
"stylelint-scss": "^6.5.0",
|
|
61
|
+
"typescript": "^5.5.4"
|
|
63
62
|
},
|
|
64
63
|
"scripts": {
|
|
65
64
|
"lint": "eslint .",
|