neoclide/coc-stylelint

support for .js files

Closed this issue · 3 comments

Supported file types are:
css
wxss
scss
less
postcss
sugarss
vue

Would it support javascript (js) files? I'm thinking of css-in-js ala styled-components.

It would be nice to have support for checking css via coc while in a JS file.

Thanks.

Let me know when stylelint have such kind of feature.

I believe detecting errors should be possible via styled components plugin. Not sure about the fixing them though.

Let me know when stylelint have such kind of feature.

it's already work.
Please add stylelint.filetypes extension array parameter to coc config.
I need js extension support too.

https://43081j.com/2019/03/using-stylelint-with-lit
https://github.com/styled-components/stylelint-processor-styled-components

stylelintrc.js:

module.exports = {
  extends: [
    'stylelint-config-recommended',
    'stylelint-config-styled-components',
  ],
  plugins: [
    'stylelint-order',
  ],
  processors: [
    [
      'stylelint-processor-styled-components',
      {
        moduleName: 'lit-element',
        importName: 'css',
        strict: true,
        ignoreFiles: [
          '**/*.css',
        ],
      },
    ],
  ],
};