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

Autofix on safe and format does not work #4

Open
nexusstar opened this issue Jul 18, 2020 · 6 comments
Open

Autofix on safe and format does not work #4

nexusstar opened this issue Jul 18, 2020 · 6 comments
Assignees
Labels
question Further information is requested

Comments

@nexusstar
Copy link

I have set in my cocConfig file

    "stylelintplus.autoFixOnSave": true,
    "stylelintplus.autoFixOnFormat": true,

But neither of them autofixes anything.
Can I debug this somehow?

@bmatcuk
Copy link
Owner

bmatcuk commented Jul 25, 2020

Hi @nexusstar, sorry for the slow reply. I just tested locally and both options seem to be working for me. If you run :CocInfo, do you see that stylelintplus has started? Are there any errors?

@bmatcuk bmatcuk self-assigned this Jul 25, 2020
@bmatcuk bmatcuk added the question Further information is requested label Jul 25, 2020
@caifara
Copy link

caifara commented Jan 14, 2021

I have the same problem, but do encounter an error while trying to save:

2021-01-14T09:48:54.258 ERROR (pid:60698) [language-client-client] - _h [Error]: Request textDocument/willSaveWaitUntil failed with message: No configuration provided for /Users/xxxx/Documents/projecten/brightbook/app/javascript/styles/tailwind.pcss
    at Ey (/Users/xxxx/.vim/plugged/coc.nvim/build/index.js:22:224)
    at In (/Users/xxxx/.vim/plugged/coc.nvim/build/index.js:21:12525)
    at Immediate.<anonymous> (/Users/xxxx/.vim/plugged/coc.nvim/build/index.js:21:12376)
    at processImmediate (internal/timers.js:456:21) {
  code: -32603,
  data: undefined
}

@bmatcuk
Copy link
Owner

bmatcuk commented Jan 16, 2021

Hi @caifara - that error is coming from stylelint itself. Sounds like you either haven't created a configuration file, or stylelint can't find it. See this issue: stylelint/stylelint#3625

@timtyrrell
Copy link

timtyrrell commented Feb 4, 2021

Seems like I have the same issue. If I run CocCommand stylelintplus.applyAutoFixes it works but not if I save or format.

Oh, I just found out why. Looks I had to remove scss from this array: "coc.preferences.formatOnSaveFiletypes". Might be a good README item 🤔

@bmatcuk
Copy link
Owner

bmatcuk commented Feb 6, 2021

Oh, interesting... do you have coc-css installed? If so, do you have "scss.validate": false in your coc-settings.json?

@timtyrrell
Copy link

Assuming you mean me, I do. I also have the following which are related to styles or formatting, in case it helps:

  "css.validate": false,
  "less.validate": false,
  "scss.validate": false,
  "wxss.validate": false,
  "stylelintplus.filetypes": [
    "scss"
  ],
  "stylelintplus.autoFixOnSave": true,
  "cssmodules.camelCase": true,
  "cssmodules.hintName": "cssmodule",
  "eslint.autoFixOnSave": true,
  "eslint.validate": [
    "javascript",
    "javascriptreact",
    "typescript",
    "typescriptreact"
  ],
  "eslint.probe": [
    "javascript",
    "javascriptreact",
    "typescript",
    "typescriptreact"
  ],
  "coc.preferences.formatOnSaveFiletypes": [
    "json",
    "javascript",
    "javascriptreact",
    "typescript",
    "typescriptreact",
    "vimwiki",
    "markdown",
    "sass"
  ],
  "prettier.requireConfig": true,
  "prettier.onlyUseLocalVersion": true,

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

No branches or pull requests

4 participants