Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config file not found #35

Open
skylite21 opened this issue Nov 13, 2022 · 6 comments
Open

config file not found #35

skylite21 opened this issue Nov 13, 2022 · 6 comments

Comments

@skylite21
Copy link

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

> [email protected] 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)

@dannobytes
Copy link

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 [email protected]

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

@dannobytes
Copy link

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

@mr-scrpt
Copy link

@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

@skylite21
Copy link
Author

@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
},

@dannobytes
Copy link

"[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.

@dannobytes
Copy link

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants