neoclide / coc-stylelint

Stylelint language server extension for coc.nvim
44 stars 3 forks source link

bug: Undefined rule function-calc-no-invalid #11

Open brandonkal opened 4 years ago

brandonkal commented 4 years ago

I'm not sure why this is happening in coc-stylelint VSCode and the stylelint CLI do not report this. function-calc-no-invalid is also a core stylelint rule.

https://stylelint.io/user-guide/rules/function-calc-no-invalid

{
  "processors": ["stylelint-processor-styled-components"],
  "extends": [
    "stylelint-config-standard",
    "stylelint-config-prettier",
    "stylelint-config-styled-components"
  ],
  "rules": {
    "no-descending-specificity": null,
    "comment-empty-line-before": null
  }
}

I get this when opening a js file with javascript.jsx syntax with styled-components. Cannot provide the JS source code, but it should be easy to reproduce.

ralvez commented 4 years ago

I can confirm the error. I'm running on ArchLinux, with nvim 0.43 I've installed stylelint as per stylelint user guide: npm install --save-dev stylelint stylelint-config-standard then my .styllintrc has:

{
  "extends": "stylelint-config-standard",
  "rules":  {
    "indentation": 4,
    "color-hex-case": "upper",
  }
}

The warning pop up when I open a .js file as well as with .css files

nexusstar commented 4 years ago

I am experiencing this too [coc.nvim] stylelint: Undefined rule function-calc-no-invalid

I am running Manjaro and using:

## versions
vim version: NVIM v0.4.3
node version: v14.0.0
coc.nvim version: 0.0.78-3f305ac739
term: xterm-256color
platform: linux

Stylelint config is:

{
    "extends": "stylelint-config-standard",
    "plugins": [
        "stylelint-order",
        "stylelint-itcss"
    ],
    "rules": {
        "indentation": 4
    }
}
jryom commented 4 years ago

One workaround is to use stylelint via diagnostic-languageserver instead. Has worked flawlessly for me.

oncomouse commented 4 years ago

I'm seeing this error, too. It only appeared after I updated to the newest version of stylelint-config-recommended. The rule that's showing up as an error is a new rule added in stylelint 10. I suspect there's an old version of stylelint being invoked by coc-stylelint.

fffed commented 4 years ago

I suspect there's an old version of stylelint being invoked by coc-stylelint.

oncomouse is right, coc-stylelint depends on "stylelint-vscode": "^7.0.0-6" and stylelint-vscode has "stylelint": "9.2.1". And it looks like stylelint-vscode isn't relevant any more ((

Romez commented 4 years ago

Works fine: https://developer.aliyun.com/mirror/npm/package/coc-stylelintplus