GithubHelp home page GithubHelp logo

vite-plugin-eslint2's Introduction

Hi there. I'm ModyQyW. 👋🏻

I'm a front-end developer using Vue and React (mostly Vue 😝). I'm also a TypeScript full-stack developer (mostly CRUD 🤣). I keep learning to make myself better. You can check out my GitHub profile, my website, or my resume to learn more about me.

Please consider sponsor me if you think my work are valuable. 🤩

Please consider hire me for your project and pay me by the hour if you find some of my work experience may do a great help. 🥹

ModyQyW's github stats ModyQyW's Top Langs

vite-plugin-eslint2's People

Contributors

modyqyw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vite-plugin-eslint2's Issues

设置 lintInWorker 为 true 后启动报错

描述问题

image

复现

https://stackblitz.com/edit/vitejs-vite-g1uayf

系统信息

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 16.14.2 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 7.17.0 - /usr/local/bin/npm

使用的包管理器

npm

核对

  • 遵循我们的 行为准则
  • 检查是否已经有一个报告相同错误的问题,以避免重复创建。
  • 这是一个具体的错误。请开启 GitHub 讨论你的疑问。
  • 所提供的复现是这个问题的 最小复现

fix option is not documented

I'm moving from vite-eslint-plugin and I was looking at the options wondering where the fix option was. Found it in the exemple, but it's not documented under options

V3 roadmap

I am preparing v3 and I want your opinions and suggestions.

Async mode default

Maybe in v3, or in v4.

This plugin lints files synchronously for now and slows down Vite a lot. Vite means quick in French but this plugin breaks the meaning.

I want to add async mode and make it the default mode. This can make the plugin faster, without slowing down Vite. However, the async mode will most likely no longer stop the serve or build process. Since errors and warnings can be found in the IDE while developing, I don't think this is a serious problem.

In the meantime, you may want vite-plugin-checker.

Apply during serve default

Done

This plugin is invoked for both serve and build for now. Since almost everyone uses this plugin during serve, it is meaningless to apply this plugin during build.

cacheLocation update

Done

To be more out of box, cacheLocation defaults to .eslintcache.

Support vite@4

Done

See Vite 4 discussion. Support vite@3 if possible, but drop vite@2.

Support eslint@9

Maybe in a minor version since eslint@9 is not released

See eslint discussion Complete rewrite of ESLint. Support eslint@8 and eslint@7 if possible.

Require node >= 14.18

Done

See Node.js realease schedule.

ESM default

Done

node >= 14.18 has full support for esm. Can remove esm bundle banner too.

ESLint doesn't work with flat config

Describe the bug

ESLint introduced a new configuration format eslint.config.js (flat config). With the new format, an error is thrown when starting the application:

node:internal/event_target:1012
  process.nextTick(() => { throw err; });
                           ^
Error: No ESLint configuration found in \src\stories\_utils\docs.
    at CascadingConfigArrayFactory._finalizeConfigArray (\node_modules\@eslint\eslintrc\dist\eslintrc.cjs:3977:19)
    at CascadingConfigArrayFactory.getConfigArrayForFile (\node_modules\@eslint\eslintrc\dist\eslintrc.cjs:3768:21)
    at FileEnumerator._iterateFilesRecursive (\node_modules\eslint\lib\cli-engine\file-enumerator.js:473:52)
    at _iterateFilesRecursive.next (<anonymous>)
    at FileEnumerator._iterateFilesRecursive (\node_modules\eslint\lib\cli-engine\file-enumerator.js:495:33)
    at _iterateFilesRecursive.next (<anonymous>)
    at FileEnumerator._iterateFilesRecursive (\node_modules\eslint\lib\cli-engine\file-enumerator.js:495:33)
    at _iterateFilesRecursive.next (<anonymous>)
    at FileEnumerator._iterateFilesRecursive (\node_modules\eslint\lib\cli-engine\file-enumerator.js:495:33)
    at _iterateFilesRecursive.next (<anonymous>)
Emitted 'error' event on Worker instance at:
    at [kOnErrorMessage] (node:internal/worker:300:10)
    at [kOnMessage] (node:internal/worker:311:37)
    at MessagePort.<anonymous> (node:internal/worker:212:57)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:737:20)
    at exports.emitMessage (node:internal/per_context/messageport:23:28)
    at [kOnExit] (node:internal/worker:278:5)
    at Worker.<computed>.onexit (node:internal/worker:209:20) {
  messageTemplate: 'no-config-found',
  messageData: {
    directoryPath: 'src\\stories\\_utils\\docs'
  }

Running ESLint directly via CLI works with the new config. The checker plugin worked properly before migrating to the new ESLint config.

Expected behavior

ESLint should run without an error and the eslint.config.js file should be used.

The ESLint class used by this plugin doesn't support the new flat config. For the flat config the FlatESLint class must be used which is only exported via eslint/use-at-your-own-risk entrypoint: https://eslint.org/blog/2022/08/new-config-system-part-3/#using-flat-config-with-the-eslint-class

Cache is broken.

Describe the bug

Same as in gxmari007/vite-plugin-eslint#11, this extension also suffers from the same problem.

The previous owner solved it by making the cache optionally available. Since this is a striking problem to me, I've disabled the cache. Would be good to have a feedback from you about this. Maybe you've already been working on it and I'm just seeing it wrongly somehow ..?

Reproduction

I've not yet managed to create a well-defined repo around this, but you should be able to refer any details from the link above.

System Info

System:
    OS: macOS 13.2
    CPU: (4) x64 Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz
    Memory: 57.21 MB / 8.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 14.21.3 - ~/.nvm/versions/node/v14.21.3/bin/node
    npm: 6.14.18 - ~/.nvm/versions/node/v14.21.3/bin/npm
  Browsers:
    Chrome: 111.0.5563.110
    Safari: 16.3

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Svelte example

I use React and Vue mostly and know little about Svelte. Also, I have no more time to learn about Svelte. Welcome PR. :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.