epiphany/node_modules/stylelint-declaration-strict-value/docs/modules/lib_validation.md
2023-12-09 22:48:07 -08:00

8.3 KiB

stylelint-declaration-strict-value - v1.9.2 / lib/validation

Module: lib/validation

Table of contents

Functions

Functions

customExpected

customExpected(typesMessage, value, property, customMessage): string

Build custom expected message for stylelint report.

internal

Parameters

Name Type Description
typesMessage string An expected types message for stylelint report.
value string The CSS declaration's value.
property string The CSS declaration's property.
customMessage string A custom message to be delivered upon error interpolated with ${types}, ${value} and ${property}.

Returns

string

Returns a custom expected message for stylelint report.

Defined in

lib/validation.ts:241


expected

expected(typesMessage, value, property): string

Build expected message for stylelint report.

internal

Parameters

Name Type Description
typesMessage string An expected types message for stylelint report.
value string The CSS declaration's value.
property string The CSS declaration's property.

Returns

string

Returns an expected message for stylelint report.

Defined in

lib/validation.ts:222


expectedTypes

expectedTypes(types): string

Build expected message for stylelint report.

internal

Parameters

Name Type Description
types ExpectedType | ExpectedTypes Either variable, function and/or keyword.

Returns

string

Returns an expected types message for stylelint report.

Defined in

lib/validation.ts:195


failedToFix

failedToFix(error, value, property): string

Build failed-to-fix message for stylelint report.

internal

Parameters

Name Type Description
error unknown An expression to throw.
value string The CSS declaration's value.
property string The CSS declaration's property.

Returns

string

Returns an failed-to-fix message for stylelint report.

Defined in

lib/validation.ts:265


getAutoFixFunc

getAutoFixFunc(autoFixFunc, disableFix?, contextFix?): null | AutoFixFunc

Get the auto-fix function either by a function directly or from a source file.

internal

Parameters

Name Type Description
autoFixFunc AutoFixFuncConfig A JavaScript function or a module path to resolve it, also from cwd.
disableFix? boolean -
contextFix? boolean -

Returns

null | AutoFixFunc

Returns the auto-fix function if found, else null.

Defined in

lib/validation.ts:410


getIgnoredKeywords

getIgnoredKeywords(ignoreKeywords, property): null | IgnoreValueList

Get the correct ignored keywords for a specific CSS declaration's property out of a complex ignoreKeywords config hash or array.

internal

Parameters

Name Type Description
ignoreKeywords IgnoreValueConfig The keyword/-s to ignore.
property string The specific CSS declaration's property of the current iteration.

Returns

null | IgnoreValueList

Returns ignored keywords for a specific CSS property, or null.

Defined in

lib/validation.ts:359


getIgnoredValues

getIgnoredValues(ignoreValues, property): null | IgnoreValueList

Get the correct ignored values for a specific CSS declaration's property out of a complex ignoreValues config hash or array.

internal

Parameters

Name Type Description
ignoreValues IgnoreValueConfig The values/-s to ignore.
property string The specific CSS declaration's property of the current iteration.

Returns

null | IgnoreValueList

Returns ignored values for a specific CSS property, or null.

Defined in

lib/validation.ts:385


getIgnoredVariablesOrFunctions

getIgnoredVariablesOrFunctions(ignoreVariablesOrFunctions, property): boolean

Get the correct ignored variable or function for a specific CSS declaration's property out of a complex ignoreVariablesOrFunctions config hash or boolean.

internal

Parameters

Name Type Description
ignoreVariablesOrFunctions IgnoreVariableOrFunctionConfig The variables or functions to ignore.
property string The specific CSS declaration's property of the current iteration.

Returns

boolean

Returns ignored variable or function for a specific CSS property.

Defined in

lib/validation.ts:327


getTypes

getTypes(config, property): ExpectedTypes

Get configured types for stylelint report message.

internal

Parameters

Name Type Description
config SecondaryOptions The secondary stylelint-plugin config.
property string The specific CSS declaration's property of the current iteration.

Returns

ExpectedTypes

Returns a list of configured types.

Defined in

lib/validation.ts:286


validOptions

validOptions(actual): boolean

Validate optional secondary options of stylelint plugin config.

internal

Parameters

Name Type Description
actual SecondaryOptions The actual config to validate.

Returns

boolean

Returns true if secondary options are valid, else false.

Defined in

lib/validation.ts:93


validProperties

validProperties(actual): actual is IgnoreValue | IgnoreValueList

Validate primary options of stylelint plugin config.

internal

Parameters

Name Type Description
actual unknown The actual config to validate.

Returns

actual is IgnoreValue | IgnoreValueList

Returns true if primary options are valid, else false.

Defined in

lib/validation.ts:39