@nabla/vite-plugin-eslint
Advanced tools
Comparing version 1.0.1 to 1.1.0
10
index.js
@@ -6,4 +6,6 @@ const chalk = require("chalk"); | ||
module.exports = function eslintPlugin(options = {}) { | ||
const { eslintOptions = {}, shouldLint = (path) => path.match(/\.[jt]sx?$/) } = | ||
options; | ||
const { | ||
eslintOptions = {}, | ||
shouldLint = (path) => path.match(/\.[jt]sx?$/), | ||
} = options; | ||
const eslint = new ESLint({ cache: true, ...eslintOptions }); | ||
@@ -17,3 +19,5 @@ | ||
if (path.includes("/src/") && shouldLint(path)) { | ||
eslint.lintFiles(path).then(([report]) => { | ||
eslint.isPathIgnored(path).then(async (ignored) => { | ||
if (ignored) return; | ||
const [report] = await eslint.lintFiles(path); | ||
report.messages.forEach((m) => { | ||
@@ -20,0 +24,0 @@ const prettyPath = path.slice(path.indexOf("/src/") + 1); |
{ | ||
"name": "@nabla/vite-plugin-eslint", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "Plugs ESLint into Vite dev server", |
@@ -33,3 +33,3 @@ # @nabla/vite-plugin-eslint | ||
- Type: `ESLint.Options` | ||
- Type: [ESLint.Options](https://eslint.org/docs/developer-guide/nodejs-api#-new-eslintoptions) | ||
- Default: `{ cache: true }` | ||
@@ -36,0 +36,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
65080
41