bmatcuk/coc-stylelintplus

config file not found

Opened this issue · 6 comments

I have a .stylelintrc file with the following contents in my project root directory:

{
  "extends": "stylelint-config-sass-guidelines",
  "rules": {
    "max-nesting-depth": 4,
    "indentation": "tab",
    "number-leading-zero": null,
  },
  "fix": "true"
}

If I run stylelint from the command line, it works as expected, for example (I have stylelint installed locally in the project):

❱ npm run stylelint

> react_miniapp@1.0.0 stylelint
> stylelint ./src/**/*.scss

src/scss/style.scss
 19:14  ✖  Missed semicolon  CssSyntaxError

But when I open an scss file with nvim, stylelint is not working. If I do CocCommand workspace.showOutput I get the following error:

[Info  - 4:10:28 PM] stylelint running in node v16.18.0
Error when trying to validate file:///home/skylite/react-miniapp/src/scss/style.scss Error: No rules found within configuration. Have you provided a "rules" property?
    at module.exports (/home/skylite/react-miniapp/node_modules/stylelint/lib/utils/configurationError.js:11:49)
    at augmentConfigFull (/home/skylite/react-miniapp/node_modules/stylelint/lib/augmentConfig.js:119:9)
    at async isPathIgnored (/home/skylite/react-miniapp/node_modules/stylelint/lib/isPathIgnored.js:25:17)
    at async lintSource (/home/skylite/react-miniapp/node_modules/stylelint/lib/lintSource.js:37:20)
    at async Function.standalone [as lint] (/home/skylite/react-miniapp/node_modules/stylelint/lib/standalone.js:129:26)
    at async Object.lint (/home/skylite/configs/.config/coc/extensions/node_modules/coc-stylelintplus/node_modules/stylelint-lsp/dist/settings.js:68:28)
    at async validate (/home/skylite/configs/.config/coc/extensions/node_modules/coc-stylelintplus/node_modules/stylelint-lsp/dist/validate.js:37:36)
    at async /home/skylite/configs/.config/coc/extensions/node_modules/coc-stylelintplus/node_modules/stylelint-lsp/dist/validate.js:116:13 {
  code: 78
}

This worked perfectly before with the same setup but now the issue exists on both my linux and macos systems. (all plugins and coc is up to date, nvim version is v0.8.0)

I'm getting the same thing here, making this extension completely unusable 😭

[Info  - 3:35:55 PM] stylelint running in node v14.19.3
Error when trying to validate file:///Users/danielslee/Code/readme.io/readme.repo/packages/react/src/routes/Dash/Project/DocsEditor/useMiniSidebar/index.module.scss Error: No rules found within configuration. Have you provided a "rules" property?
    at module.exports (/Users/danielslee/Code/readme.io/readme.repo/node_modules/stylelint/lib/utils/configurationError.js:11:49)
    at augmentConfigFull (/Users/danielslee/Code/readme.io/readme.repo/node_modules/stylelint/lib/augmentConfig.js:119:9)
    at async isPathIgnored (/Users/danielslee/Code/readme.io/readme.repo/node_modules/stylelint/lib/isPathIgnored.js:25:17)
    at async lintSource (/Users/danielslee/Code/readme.io/readme.repo/node_modules/stylelint/lib/lintSource.js:37:20)
    at async Function.standalone [as lint] (/Users/danielslee/Code/readme.io/readme.repo/node_modules/stylelint/lib/standalone.js:130:26)
    at async Object.lint (/Users/danielslee/.config/coc/extensions/node_modules/coc-stylelintplus/node_modules/stylelint-lsp/dist/settings.js:68:28)
    at async validate (/Users/danielslee/.config/coc/extensions/node_modules/coc-stylelintplus/node_modules/stylelint-lsp/dist/validate.js:37:36)
    at async /Users/danielslee/.config/coc/extensions/node_modules/coc-stylelintplus/node_modules/stylelint-lsp/dist/validate.js:116:13 {
  code: 78
}

I thought it maybe b/c I'm on an older Node version, but seeing that you're on v16, seems unrelated to that.

This was working perfectly for me too up until about a month or two ago.

:version
NVIM v0.8.1
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by brew@HMBRW-A-001-M1-004.local

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.8.1/share/nvim"

Run :checkhealth for more info

Anybody know of any alternative stylelint lsp's for neovim? This one seems totally unmaintained and wondering if there are any other options

@dannobytes @skylite21 Hi. I have encountered the same problem. Have you not found a solution? I used to have everything working as it should, but recently I decided to rebuild my config for nvim from scratch and now my linting is not working

@mr-scrpt I ended up uninstalling coc-stylelintplus and went back to coc-stylelint. Formatting works if you have sometning like this in your coc-config.json:

"[javascript][html][jsx][css][sass][python]": {
  "coc.preferences.formatOnSave": true
},
"[javascript][html][jsx][css][sass][python]": {
  "coc.preferences.formatOnSave": true
},

Unfortunately, that does not work. I've never been able to get coc-stylelint to do anything in vim for me.

@bmatcuk Are you still maintaining this package at all or can provide any pointers to troubleshoot its in ability to locate the stylelint.config.js file?