0.0.2 • Published 1 year ago

esbuild-plugin-linter v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

esbuild-plugin-linter

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

Lint your esbuild bundles with eslint. 🧐

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

How

yarn add esbuild-plugin-linter --dev
const { build } = require('esbuild');
const eslint = require('esbuild-plugin-linter');

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 property. The most important options are:

filter

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

Instructs esbuild what files to look at. Only files matching this pattern will be looked at.

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