File tree Expand file tree Collapse file tree 5 files changed +448
-340
lines changed Expand file tree Collapse file tree 5 files changed +448
-340
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## 1.6.0
4+
5+ - Add vite@5 to peer dependency range
6+ - Fix error when using ` errorOnUnmatchedPattern: false `
7+ - Update plugin name from ` eslint ` to ` vite-plugin-eslint ` to avoid confusion in case of errors reported by Vite
8+
39## 1.5.0
410
511- Support async formatters ([ #17 ] ( https://github.com/nabla/vite-plugin-eslint/pull/17 ) )
Original file line number Diff line number Diff line change 11{
22 "name" : " @nabla/vite-plugin-eslint" ,
33 "description" : " Plugs ESLint into Vite dev server" ,
4- "version" : " 1.5 .0" ,
4+ "version" : " 1.6 .0" ,
55 "license" : " MIT" ,
66 "author" : " Arnaud Barré (https://github.com/ArnaudBarre)" ,
77 "main" : " src/index.js" ,
2222 "chalk" : " ^4"
2323 },
2424 "peerDependencies" : {
25- "vite" : " ^2 || ^3 || ^4" ,
25+ "vite" : " ^2 || ^3 || ^4 || ^5 " ,
2626 "eslint" : " *"
2727 },
2828 "devDependencies" : {
29- "eslint" : " ^8.20 .0" ,
30- "prettier" : " ^2.7.1 " ,
31- "vite" : " ^3 .0.2 "
29+ "eslint" : " ^8.53 .0" ,
30+ "prettier" : " 3.0.3 " ,
31+ "vite" : " ^5 .0.0 "
3232 }
3333}
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ module.exports = function eslintPlugin(options = {}) {
1313 let worker ; // Don't initialize worker for builds
1414
1515 return {
16- name : "eslint" ,
16+ name : "vite-plugin- eslint" ,
1717 apply : "serve" ,
1818 transform ( _code , id ) {
1919 const path = normalizePath ( id ) ;
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ parentPort.on("message", (path) => {
1515 . then ( async ( ignored ) => {
1616 if ( ignored ) return ;
1717 const [ report ] = await eslint . lintFiles ( path ) ;
18+ if ( ! report ) return ; // Can be empty with errorOnUnmatchedPattern: false
1819 if ( report . output !== undefined ) await fs . writeFile ( path , report . output ) ;
1920 if ( report . messages . length === 0 ) return ;
2021 if ( formatterPromise ) {
@@ -27,8 +28,8 @@ parentPort.on("message", (path) => {
2728 const rule = m . ruleId ? ` ${ m . ruleId } ` : "" ;
2829 console . log (
2930 `${ location } : ${ chalk [ m . severity === 2 ? "red" : "yellow" ] (
30- m . message
31- ) } ${ rule } `
31+ m . message ,
32+ ) } ${ rule } `,
3233 ) ;
3334 } ) ;
3435 }
@@ -38,8 +39,8 @@ parentPort.on("message", (path) => {
3839 // Can happen when the file is deleted or moved
3940 console . log (
4041 `${ chalk . yellow ( `[eslint] File not found` ) } ${ chalk . dim (
41- e . messageData . pattern
42- ) } `
42+ e . messageData . pattern ,
43+ ) } `,
4344 ) ;
4445 } else {
4546 // Otherwise log the full error
You can’t perform that action at this time.
0 commit comments