hudochenkov / stylelint-order

A plugin pack of order related linting rules for Stylelint.
MIT License
916 stars 61 forks source link

`properties-order: null` causes: Unknown severity: "ignore" #164

Closed snebjorn closed 1 year ago

snebjorn commented 2 years ago

Turning properties-order off by setting it to null

"rules": {
  "order/properties-order": null
}

causes this error to be thrown when something is not sorted correctly.

Error: Unknown severity: "ignore"
    at ~\myproject\node_modules\stylelint\lib\formatters\stringFormatter.js:288:12
    at Array.reduce (<anonymous>)
    at stringFormatter (~\myproject\node_modules\stylelint\lib\formatters\stringFormatter.js:258:19)
    at Object.apply (~\myproject\node_modules\import-lazy\index.js:16:20)
    at prepareReturnValue (~\myproject\node_modules\stylelint\lib\prepareReturnValue.js:52:23)
    at standalone (~\myproject\node_modules\stylelint\lib\standalone.js:271:17)

A workaround is to

"rules": {
  "order/properties-order": [[], { "severity": "warning" }]
}

Also see

order doesn't seem to have this issue.

"rules": {
  "order/order": null
}

It's common practice in stylelint to set something to null to disable it. Please fix this error for when order/properties-order is set to null

hudochenkov commented 2 years ago

Could you make a repository with reproducible issue?

snebjorn commented 2 years ago

I'll cook something up :) Gimmi a few days

maxming2333 commented 1 year ago

I also encountered this problem, order/properties-order using null to disable is invalid, css file still prompts order/properties-order error

"rules": {
  "order/properties-order": null
}

Please ask the maintainer to fix this issue

hudochenkov commented 1 year ago

If you use stylelint-config-rational-order you need to switch to something else. It's very outdated package and uses very old stylelint and stylelint-order: https://github.com/constverum/stylelint-config-rational-order/blob/843a487338a25de246fd2d346fd1caf63f1de8a5/package.json#L32-L35

snebjorn commented 1 year ago

I was able to reproduce the error in a minimal setup. See setup in the playground (note the playground fails because of the error)

It is indeed caused by stylelint-config-rational-order