fi3ework / vite-plugin-checker

💬 Vite plugin that provide checks of TypeScript, ESLint, vue-tsc, Stylelint and more.
https://vite-plugin-checker.netlify.app
MIT License
965 stars 84 forks source link

Stylelint errors does not cause vite build to fail #312

Open skrebergene opened 5 months ago

skrebergene commented 5 months ago

Describe the bug

When building for production (vite build) errors from ESLint are shown, and causes the build to fail. Stylelint errors are not shown in the output, and does not cause the build to fail.

Reproduction

I am using vite-plugin-checker with the following configuration in vite.config.ts:

checker({
      eslint: {
        lintCommand: 'eslint "./src/**/*.{ts,tsx,json}"'
      },
      stylelint: {
        lintCommand: "stylelint ./src/**/*.scss"
      }
    })

Here are som relevant npm versjons:

"vite": "^5.2.8",
"vite-plugin-checker": "^0.6.4",
"stylelint": "^14.16.1",
"eslint": "^8.56.0",

Expected behavior

I would expect that errors from both ESLint and Stylelint should cause vite build to fail. I would also expect errors to be shown in the build output for both ESLint and Stylelint.

System Info

System:
    OS: macOS 14.2.1
    CPU: (16) arm64 Apple M3 Max
    Memory: 1.53 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 21.7.1 - /opt/homebrew/bin/node
    npm: 10.5.0 - /opt/homebrew/bin/npm
  Browsers:
    Chrome: 123.0.6312.106
    Safari: 17.2.1
  npmPackages:
    vite-plugin-checker: ^0.6.4 => 0.6.4

Additional context

Errors for both ESLint and Stylelint are shown in the output when running vite (dev mode), so the errors seem to propagate correctly to the plugin.

Validations

jhoermann commented 2 months ago

Could you provide an example repo @skrebergene? I tested it locally with the stylelint playground and everything works as expected.

skrebergene commented 2 months ago

Here you go @jhoermann: https://github.com/skrebergene/vite-plugin-checker-issue-demo

After some more digging it seems like the issue is related to the folder hierarchy. Checker runs stylelint validation, it just skips some files under certain circumstances.

It is worth noting that the bug is present for the most recent package versions as well (see the updated_packages branch)

marcel-enorm commented 1 day ago

Is there a fix for this? Running into same issue.