sh-waqar / stylelint-declaration-use-variable

A stylelint custom rule to check the use of scss variable on declaration.
MIT License
82 stars 18 forks source link

display error in line color: inherit; #28

Open mykola-shkut opened 5 years ago

mykola-shkut commented 5 years ago

stylelint could you tell how to fix?

fuhlig commented 5 years ago

If you added color to the properties array (see docs), you can add inherit to the ignoreValues array (see docs).

Example:

'sh-waqar/declaration-use-variable': [
    [
    '/color/'
    {
        ignoreValues: [
        'inherit'
        ]
    }
]
daddyj commented 4 years ago

Unfortunately this doesn't work for me, i have pasted the example configuration from the docs. Anyone still experiencing this? I am working with .scss content, could there be a relation?

I am using: stylelint@13.3.2 stylelint-declaration-use-variable@1.7.2

daddyj commented 4 years ago

Ok, fixed the issue by reading the Readme more precisely :D

the properties and the secondaryOption must be wrapped in an array - so the following respects all properties and ignoreValues:

    'sh-waqar/declaration-use-variable': [
      [
        '/color/',
        'background',
        'background-color',
        { ignoreValues: ['inherit'] },
      ],
    ],

IMHO this issue can therefore be closed.

daddyj commented 4 years ago

If you added color to the properties array (see docs), you can add inherit to the ignoreValues array (see docs).

Example:

'sh-waqar/declaration-use-variable': [
    [
    '/color/'
    {
        ignoreValues: [
        'inherit'
        ]
    }
]

@fuhlig Your configuration should display a syntax error because you are missing a closing bracket ] at the bottom. Then everything should work as expected.

kepi0809 commented 4 years ago

this should work


        'sh-waqar/declaration-use-variable': [
            [
                '/color/',
                { ignoreValues: ['inherit'] },
            ],
        ],
fuhlig commented 3 years ago

Issue can be closed, thanks :)