I'm trying to use rollup for the first time and I can't figure out why I get this error :
TypeError: eslint is not a function
I previously installed rollup (v1.1.0) then eslint npm install rollup-plugin-eslint
(v5.0.0)
here is my rollup.config.js
import babel from 'rollup-plugin-babel';
import eslint from 'rollup-plugin-eslint';
export default {
input: 'src/main.js',
output: {
format: 'iife',
file: 'build/js/main.min.js',
name: 'main'
},
plugins: [
eslint({
exclude: [
'src/styles/**',
]
}),
babel({
exclude: 'node_modules/**',
}),
],
}
When I use ./node_modules/.bin/rollup -c
I get this error TypeError: eslint is not a function
. (NB : rollup is working fine with only babel)
However it works if I use npm run lint
adding this code in package.json
"scripts": {
"lint": "eslint src/**"
}
What do I do wrong with the rollup configuration ? Thanks for your help
Try changing:
- import eslint from 'rollup-plugin-eslint';
+ import { eslint } from 'rollup-plugin-eslint';
Release notes for v5.0.0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With