1 line
38 KiB
Text
1 line
38 KiB
Text
|
{"version":3,"file":"index.esm.js","sources":["../src/defaults.ts","../src/lib/validation.ts","../src/index.ts"],"sourcesContent":["import type { Node, Root } from 'stylelint/node_modules/postcss';\n\n/**\n * Rule Name.\n */\nexport const ruleName = 'scale-unlimited/declaration-strict-value';\n\n/**\n * A hash of CSS properties to ignore variables or functions.\n */\nexport interface IgnoreVariableOrFunctionHash {\n [key: string]: boolean;\n}\n/**\n * Possible config for `ignoreVariables` and `ignoreFunctions` option.\n */\nexport type IgnoreVariableOrFunctionConfig =\n | boolean\n | IgnoreVariableOrFunctionHash;\n/**\n * A Regular Expression string to match a CSS property or value.\n */\nexport type RegExpString = string;\n/**\n * A CSS value to be ignored.\n */\nexport type IgnoreValue = number | string | RegExpString;\n/**\n * A list of CSS values to be ignored.\n */\nexport type IgnoreValueList = Array<IgnoreValue>;\n/**\n * A hash of CSS properties with ignored values.\n * - `''` key applies to all configured CSS properties.\n * - key can also be a Regular Expression string.\n */\nexport interface IgnoreValueHash {\n '': IgnoreValue | IgnoreValueList;\n [CSSPropertyName: string]: IgnoreValue | IgnoreValueList;\n // [CSSPropertyName: TRegExpString]: TIgnoreValue | TIgnoreValueList;\n}\n/**\n * @internal\n */\nexport const isIIgnoreValueHash = (\n key: unknown,\n value: unknown\n): key is IgnoreValueHash =>\n typeof key === 'object' && Object.hasOwnProperty.call(key, value);\n/**\n * Possible config for `ignoreValues` and ~~`ignoreKeywords`~~ option.\n */\nexport type IgnoreValueConfig =\n | null\n | IgnoreValue\n | IgnoreValueList\n | IgnoreValueHash;\n/**\n * Result of CSS value validation.\n */\nexport interface DeclarationStrictValueResult {\n /**\n * Whether or not variable is valid.\n */\n validVar: boolean;\n\n /**\n * Whether or not function is valid.\n */\n validFunc: boolean;\n\n /**\n * Whether or not keyword is valid.\n */\n validKeyword: boolean;\n\n /**\n * Whether or not value is valid.\n */\n validValue: boolean;\n\n /**\n * Longhand CSS Property, if expanded.\n */\n longhandProp?: string;\n\n /**\n * Longhand CSS value, if expanded.\n */\n longhandValue?: string;\n}\n/**\n * A autofix function.\n */\nexport type AutoFixFunc = (\n node: Node,\n result: DeclarationStrictValueResult,\n root: Root,\n config: SecondaryOptions\n) => string;\n/**\n * Path to autofix function module.\n */\nexport type AutoFixModule = string;\n/**\n * Possible config for `autoFixFunc` option.\n */\nexport type AutoFixFuncConfig = null | undefined | AutoFixModule | AutoFixFunc;\n\n/**\n * Plugin secondary options.\n */\nexport interface SecondaryOptions {\n /**\n * Whether or not to ignore variables.\n *\n * @defaultValue true\n */\n ignoreVariables?: IgnoreVariableOrFunctionConfig;\n\n /**\n * Whether or not to ignore function.\n *\n * @defaultValue true\n */\n ignoreFunctions?: IgnoreVariableOrFunctionConfig;\n\n /**\n * An ignored keywords config.\n *\n * @defaultValue null\n * @deprecated use `ignoreValues` option.\n */\n ignoreKeywords?: IgnoreValueConfig;\n\n /**\n * An ignored values config.\n *\n * @defaultValue null\n */\n ignoreValues?: IgnoreValueConfig;\n\n /**\n * Whether or not to expand shorthand CSS properties.\n *\n * @defaultValue false\n */\n expandShorthand?: boolean;\n\n /**\n * Whether or not to expand longhand CSS properties recursivly - this is only useful for the `border` property.\n *\n * @defaultValue false\n */\n recurseLonghand?: boolean;\n\n /**\n * Adjust severity of the rule, `'warning'` or `'error'` (default).\n *\n * @defaultValue 'error'\n */\n severity?: string;\n\n /**\n * A custom message when a rule is violated, interpolated with `${types}`, `${value}` and `${property}`.\n *\n * @defaultValue undefined\n */\n message?: string;\n\n /**\n * Don't auto-fix if `--fix` option is applied.\n *\n * @defaultValue false\n */\n disableFix?: boolean;\n\n /*
|