Skip to content

Commit

Permalink
Add .svelte to default shouldLint regex [publish]
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudBarre committed Dec 22, 2022
1 parent 9306001 commit 951110a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ 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`)

### formatter

- 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`.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 951110a

Please sign in to comment.