diff --git a/CHANGELOG.md b/CHANGELOG.md index b76d0f1..c9eb316 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 1.5.0 + +- Support async formatters ([#17](https://github.com/nabla/vite-plugin-eslint/pull/17)) +- Add `.svelte` to default shouldLint regex + ## 1.4.2 Add vite@4 to peer dependency range diff --git a/README.md b/README.md index 98460fa..a6d4f13 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ Note: the `fix` option is only supported from `1.3.4` ### shouldLint - Type: `(path: string) => boolean` -- Default: `(path) => path.match(/\/src\/[^?]*\.(vue|m?[jt]sx?)$/)` +- Default: `(path) => path.match(/\/src\/[^?]*\.(vue|svelte|m?[jt]sx?)$/)` You can use `DEBUG=eslint node_modules/.bin/vite` to debug this option (available in `1.4.0`) @@ -46,4 +46,4 @@ You can use `DEBUG=eslint node_modules/.bin/vite` to debug this option (availabl - Type: `string` -If provided, the value is passed to `eslint.loadFormatter`. Default to a custom format with one line per warning/error. Use `stylish` to get a CRA like output. +If provided, the value is passed to `eslint.loadFormatter`. Default to a custom format with one line per warning/error. Use `stylish` to get a CRA like output. Async formatters are supported in `1.5.0`. diff --git a/package.json b/package.json index dc0e7ae..2d2d830 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@nabla/vite-plugin-eslint", "description": "Plugs ESLint into Vite dev server", - "version": "1.4.2", + "version": "1.5.0", "license": "MIT", "author": "Arnaud Barré (https://github.com/ArnaudBarre)", "main": "src/index.js", diff --git a/src/index.js b/src/index.js index d86a44e..88644de 100644 --- a/src/index.js +++ b/src/index.js @@ -6,7 +6,7 @@ const { normalizePath } = require("vite"); module.exports = function eslintPlugin(options = {}) { const { eslintOptions = {}, - shouldLint = (path) => path.match(/\/src\/[^?]*\.(vue|m?[jt]sx?)$/), + shouldLint = (path) => path.match(/\/src\/[^?]*\.(vue|svelte|m?[jt]sx?)$/), formatter, } = options;