webpack-contrib/stylelint-webpack-plugin

[1.2.1] No files matching the pattern were found (LESS files)

Opened this issue ยท 2 comments

  • Operating System: Windows 10
  • Node Version: 12.14.1
  • NPM Version: 6.13.6
  • webpack Version: 4.41.2 (using Vue-Cli)
  • stylelint-webpack-plugin Version: 1.2.1

If it helps we are also using:

  • less: 3.10.3
  • less-loader: 5.0.0
  • vue: 2.6.11
  • vue-property-decorator: 8.2.2
  • vue-router: 3.1.3
  • vuex: 3.1.2
  • @vue/cli: 4.1.2
  • @vue/cli-plugin-babel: 4.1.2
  • @vue/cli-plugin-e2e-cypress: 4.1.2
  • @vue/cli-plugin-eslint: 4.1.2
  • @vue/cli-plugin-typescript: 4.1.2
  • @vue/cli-plugin-unit-mocha: 4.1.2
  • @vue/cli-service: 4.1.2
  • stylelint: 13.0.0
  • stylelint-config-standard: 19.0.0
  • stylelint-processor-arbitrary-tags: 0.1.0
  • stylelint-webpack-plugin: 1.2.1
  • typescript: 3.7.4
  • vue-template-compiler: 2.6.11

Expected Behavior

When I change one of our .less files, should correctly lint our files.

Actual Behavior

Instead, when it compiles the first time, reports no errors, but when changing a file and hot-reloading, I see the following:

 WAIT  Compiling...

98% after emitting StylelintWebpackPlugin

 ERROR  Failed to compile with 1 errors

 error 

No files matching the pattern "<redacted_path_to_less_file>" were found.

Type checking in progress...
No type errors found
Version: typescript 3.7.4
Time: 35274ms

Code

// we are not using a webpack.config.js file, but rather a vue.config.js file
// vue.config.js
const StylelintPlugin = require('stylelint-webpack-plugin');

module.exports = {
  configureWebpack: {
    entry: './src/entry.ts',
    plugins: [
      new StylelintPlugin({
        files: ['src/assets/less/**/*.less', 'src/assets/less/**/*.css'],
        lintDirtyModulesOnly: true,
        syntax: 'less',
      }),
    ],
  },
  chainWebpack: (config) => {
    config.devtool('source-map');
  },
  devServer: {
    open: process.platform === 'darwin',
    host: '0.0.0.0',
    port: 8080,
    https: false,
    hotOnly: false,
  },
  parallel: true,
  lintOnSave: 'error',
};

How Do We Reproduce?

This is reproducible by simply creating a new Vue project using the Vue CLI and making sure to use the options for using TypeScript and LESS.

I don't think TypeScript is causing the issue, it just seems this is something specific to the fact that we are using LESS files and not CSS, I say this because I am aware that this other issue nuxt-modules/stylelint#33 has been fixed with the recent 1.2.1 release, so this is the only different thing I can think of!

Thank you so much for the help!

@ytmagalhaes resolved on v1.2.2

@ricardogobbosouza can confirm this has fixed the problem! Thank you for the quick fix ๐Ÿ˜„ ๐Ÿ‘