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

Checker doesn't cancel build when using with vite-tsconfig-paths #268

Open
2 tasks done
pksunkara opened this issue Aug 14, 2023 · 2 comments
Open
2 tasks done

Checker doesn't cancel build when using with vite-tsconfig-paths #268

pksunkara opened this issue Aug 14, 2023 · 2 comments

Comments

@pksunkara
Copy link

Describe the bug

When vite-tsconfig-paths is not used, this plugin works as described and cancels the build if it finds an issue (eslint issue in the example).

yarn run v1.22.19
$ vite build
vite v4.4.9 building for production...

/home/pksunkara/Coding/automa/advisory/packages/fullstack/assets/index.ts
  4:1  error  Delete `⏎`  prettier/prettier

✖ 1 problem (1 error, 0 warnings)
  1 error and 0 warnings potentially fixable with the `--fix` option.

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

But when vite-tsconfig-paths is used, the files are still built even though the issue wasn't fixed.

yarn run v1.22.19
$ vite build
vite v4.4.9 building for production...
✓ 8 modules transformed.
dist/asset-manifest.json            0.84 kB │ gzip: 0.24 kB
dist/assets/index-c47d2b75.css      7.45 kB │ gzip: 2.22 kB
dist/assets/index-3cfb730f.js       0.71 kB │ gzip: 0.40 kB
✓ built in 399ms

/home/pksunkara/Coding/automa/advisory/packages/fullstack/assets/index.ts
  4:1  error  Delete `⏎`  prettier/prettier

✖ 1 problem (1 error, 0 warnings)
  1 error and 0 warnings potentially fixable with the `--fix` option.

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Reproduction

In vite.config.ts:

export default defineConfig({
  plugins: [
    checker({
      typescript: true,
      eslint: {
        lintCommand: 'eslint assets',
      },
    }),
    tsconfigPaths(),
  ],
});

Expected behavior

Assets should not be built even when vite-tsconfig-paths is used

System Info

System:
    OS: Linux 6.4 Arch Linux
    CPU: (24) x64 AMD Ryzen 9 5900X 12-Core Processor
    Memory: 112.94 GB / 125.72 GB
    Container: Yes
    Shell: 3.6.1 - /bin/fish
  Binaries:
    Node: 18.16.0 - /usr/bin/node
    Yarn: 1.22.19 - /usr/bin/yarn
    npm: 9.8.0 - /usr/bin/npm

Additional context

I would have made a fix myself but I don't have enough context on what's causing this. 😞

Validations

  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
@philipgriffin
Copy link

I believe this is related to #287 - for which I have a PR up to fix at #288.

@pksunkara
Can you check if setting typescript to false makes your build correctly cancel if you have an ESLint error?

@pksunkara
Copy link
Author

Doesn't seem to help. Especially after I upgraded vite to v5.

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

2 participants