Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rollup-plugin-eslint-bundle

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-eslint-bundle

Rollup plugin to verify (and fix) bundled code with ESLint

  • 7.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
177
increased by30.15%
Maintainers
1
Weekly downloads
 
Created
Source

NPM version install size build JavaScript Style Guide npm type definitions

rollup-plugin-eslint-bundle

🍣 A Rollup plugin to lint and fix bundled code with ESLint.

Requirements

This plugin requires an LTS Node version (v14.13.1+), Rollup v2.x and ESLint >=8.x

Install

npm i -D rollup-plugin-eslint-bundle

Usage

// rollup.config.js ESM
import { rollup } from 'rollup';
import { eslintBundle } from 'rollup-plugin-eslint-bundle';

const root = path.dirname(url.fileURLToPath(import.meta.url))

export default {
  input: path.resolve(root, './main.js'),

  plugins: [
    eslintBundle({
      eslintOptions: {
        fix: true,
      },
      throwOnWarning: true,
      throwOnError: true,
      formatter: 'compact'
    }),
  ],

  output: {
    file: path.resolve(root, './dist/bundle.js'),
    format: 'es',
  },
};

// Rollup JavaScript API
import { rollup } from 'rollup';
import { eslintBundle } from 'rollup-plugin-eslint-bundle';

// ...

const bundle = await rollup.rollup({
  input: 'main.js',
  plugins: [
    eslintBundle({
      eslintOptions: {
        fix: true,
      },
      throwOnWarning: true,
      throwOnError: true,
      formatter: 'compact'
    })
  ]
});

await bundle.write({
  file: 'dist/bundle.js',
  format: 'es',
});

await bundle.close();

Options

eslintOptions

ESLint class options object.

throwOnWarning

Type: boolean

Default: false

If true, will throw an error if any warnings were found.

throwOnError

Type: boolean

Default: false

If true, will throw an error if any errors were found.

formatter

Type: string

Default: undefined

Value to be passed to eslint.loadFormatter()

License

MIT License (MIT)

Contributing

If you find a bug or think about enhancement, feel free to contribute and submit an issue or a pull request.

Keywords

FAQs

Package last updated on 08 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc