robinloeffel / esbuild-plugin-eslint

Lint your esbuild bundles with eslint. 🧐
https://npmjs.com/esbuild-plugin-eslint
MIT License
7 stars 7 forks source link

Processing unwanted node_modules #2

Closed YPetremann closed 2 years ago

YPetremann commented 2 years ago

esbuild-plugin-esling makes eslint process node_modules, which can get annoying if some modules depends on internal eslint linter plugins (like react-dom) or doesn't follow defined codestyle. ignoring files with eslint makes ignoring messages which are annoyingly hard to remove.

Pull request fixes #1 by adding a glob patterns config to filter files to process before eslint call for each file.

talks2much commented 2 years ago

@robinloeffel This plugin is tooo naive and I don't think it yet ready to be on the production. It seems it slows down esbuild output. Also paths are not configurable (what if I want to lint .vue or css?). I wonder why didn't you use .onEnd callback with paths configurable (or it can track paths even automatically). Anyway, I highly appreciate any thoughts..

robinloeffel commented 2 years ago

In https://github.com/robinloeffel/esbuild-plugin-eslint/commit/e05473583ab02dba37d622ad393231f70b500cdf I've fixed a handful of issues, including the one you both are addressing. It now ignores node_modules completely, you may define your own filter for esbuild, which allows you to lint .vue files or whatever else you please, and I've moved the work that ESLint does out of the onLoad and into the onEnd hook. Thanks for you guys' feedback!