一覧へ戻る
nikolay-borzov/rollup-plugin-eslint-bundle(新しいタブで開きます)
主要言語: JavaScript
Rollup plugin to lint (and fix) bundled code with ESLint.
- star 数
- 4
- watcher 数
- 1
- fork 数
- 0
- issue 数
- 0
- 最終更新
- 2023/12/18
主要言語: JavaScript
Rollup plugin to lint (and fix) bundled code with ESLint.
🍣 A Rollup plugin to lint and fix bundled code with ESLint.
This plugin requires an Node.js v20.x, Rollup v4.x and ESLint v8.x
npm i -D rollup-plugin-eslint-bundle
// 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()
| Description | |
|---|---|
eslintOptions |
ESLint class options object |
throwOnWarning |
boolean (Default: false)If true, will throw an error if any ESLint warnings were found. |
throwOnError |
boolean (Default: false)If true, will throw an error if any ESLint errors were found. |
formatter |
string (Default: undefined)Value to be passed to eslint.loadFormatter() |
MIT License (MIT)
If you find a bug or think about enhancement, feel free to contribute and submit an issue or a pull request.