esbuild-plugin-eslint-hybrid
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

ESBUILD-PLUGIN-ESLINT-HYBRID

Created this package, since the original esbuild-plugin-eslint only supports ESM well. It is not very convenient to use it with commonjs module/packages.

This package is mostly based on esbuild-plugin-eslint. Very thankful for the author's great work.

latest version on npm Lint Test Release npm downloads a month required node version esbuild peer dep eslint peer dep package license

Lint your code when bundling with esbuild using eslint. 🧐

Nicely integrates the most recent version of eslint into an esbuild plugin.

How

yarn add esbuild-plugin-eslint-hybrid eslint --dev
import { build } from 'esbuild';
import eslint from 'esbuild-plugin-eslint-hybrid';

await build({
  // ...
  plugins: [
    eslint({ /* config */ })
  ]
});
const { build } = require('esbuild');
const eslint = require('esbuild-plugin-eslint-hybrid').default;

await build({
  // ...
  plugins: [
    eslint({ /* config */ })
  ]
});

Config

This plugin respects your ESLint configuration as per default. It also takes a configuration object intended for the ESLint constructor with the addition of a filter, throwOnError, and throwOnWarning property. The most important options are:

filter

Type: RegExp
Default: /\.(?:jsx?|tsx?|vue|svelte)$/
Used by: esbuild
Reference: esbuild.github.io

Tells esbuild what files to look at. Only files matching this pattern will be handled by the plugin.

throwOnError

Type: boolean
Default: false
Used by: The plugin itself

Instructs the plugin to forward errors found by ESLint to esbuild and throw an error.

throwOnWarning

Type: boolean
Default: false
Used by: The plugin itself

Instructs the plugin to forward warnings found by ESLint to esbuild and throw an error.

fix

Type: boolean
Default: false
Used by: eslint
Reference: eslint.org (options.fix)

Controls whether to enable or disable the autofix feature of ESLint.

useEslintrc

Type: boolean
Default: true
Used by: eslint
Reference: eslint.org (options.useEslintrc)

If set to false, ESLint will not respect any configuration files it finds.

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i esbuild-plugin-eslint-hybrid

Weekly Downloads

24

Version

1.0.4

License

MIT

Unpacked Size

11.6 kB

Total Files

8

Last publish

Collaborators

  • hsuehic2023