@rollup/plugin-eslint and vue compat issue
See original GitHub issueIs your feature request related to a problem? Please describe.
@rollup/plugin-eslint correctly lints .vue files but also generates linting errors for virtual css files generated from SFCs.
Here is a repro starting from @vitejs/app vue https://github.com/matias-capeletto/vite-rollup-plugin-eslint
Errors during build
C:\vite-rollup-plugin-eslint\index.html
13:8 error clear vue/comment-directive
C:\vite-rollup-plugin-eslint\vite\dynamic-import-polyfill
37:3 error '__VITE_IS_MODERN__' is not defined no-undef
C:\vite-rollup-plugin-eslint\src\App.vue?vue&type=style&index=0&lang.css
2:1 error Parsing error: Unexpected character '#'
C:\vite-rollup-plugin-eslint\src\components\HelloWorld.vue?vue&type=style&index=0&scoped=true&lang.css
2:3 error Parsing error: Unexpected token {
During dev, only the last two are reported.
I tried using { ...eslint(), enforce: 'pre' }
but it didn’t help. From the reported error, eslint may be interpreting that HelloWorld.vue?vue&type=style&index=0&scoped=true&lang.css
is a .vue
file instead of a .css
Additional context
vite version: 2.0.0-beta.29 Operating System: Windows 10 Home, 10.0.18363 N/A Build 18363 Node version: v15.5.0 Package manager and version: yarn v1.22.10
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (8 by maintainers)
Top Results From Across the Web
Vite Rollup Plugins
A list of rollup plugins compatibility for Vite. ... Verify entry point and all imported files with ESLint. compatible.
Read more >rollup-plugin-vue2 | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >getboarded-functionality - npm package - Snyk
What is getboarded-functionality? BootstrapVue, with over 40 plugins and more than 75 custom components, provides one of the most comprehensive ...
Read more >Plugins - Vite
Before searching for a Vite or Compatible Rollup plugin, check out the Features Guide. ... Provides Vue 3 JSX support (via dedicated Babel...
Read more >@rollup/plugin-eslint - npm
Verify entry point and all imported files with ESLint. Latest version: 9.0.1, last published: 2 months ago.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I just tried using
@rollup/plugin-eslint
with thereact-ts
template, and it was linting the compiled files instead of the source files. Addingenforce: 'pre'
fixed it.Btw we should link to your site in the rollup plugin compat section!