Socket
Socket
Sign inDemoInstall

vite-plugin-eslint

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-plugin-eslint - npm Package Compare versions

Comparing version 1.8.0 to 1.8.1

0

dist/index.d.ts

@@ -0,0 +0,0 @@ import { Plugin } from 'vite';

2

dist/index.js

@@ -1,1 +0,1 @@

"use strict";var m=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var F=(i,e)=>{for(var a in e)m(i,a,{get:e[a],enumerable:!0})},b=(i,e,a,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of L(e))!P.call(i,t)&&t!==a&&m(i,t,{get:()=>e[t],enumerable:!(n=w(e,t))||n.enumerable});return i};var j=i=>b(m({},"__esModule",{value:!0}),i);var R={};F(R,{default:()=>S});module.exports=j(R);var E=require("path"),v=require("@rollup/pluginutils");var g="vite-plugin-eslint";var h=require("fs");function y(i){return i.split("?",2)[0]}function O(i){return!(0,h.existsSync)(i)}function x(i){let{eslintPath:e,lintOnStart:a,include:n,exclude:t,formatter:c,emitWarning:u,emitError:l,failOnWarning:p,failOnError:o,...s}=i;return s}async function f(i){return i.then(e=>[null,e]).catch(e=>[e,void 0])}async function d(i,e,a,n,t,c){let[u,l]=await f(e.lintFiles(a));if(u)return Promise.reject(u);let p=l.some(r=>r.warningCount>0),o=l.some(r=>r.errorCount>0),s=t(l);if(n.fix&&l){let[r]=await f(c(l));if(r)return Promise.reject(r)}if(p&&n.emitWarning){let r=typeof s=="string"?s:await s;n.failOnWarning?i.error(r):i.warn(r)}if(o&&n.emitError){let r=typeof s=="string"?s:await s;n.failOnError?i.error(r):console.log(r)}return Promise.resolve()}function S(i={}){let e,a,n,t,c,u=new Set;return{name:g,async configResolved(l){t=Object.assign({lintOnStart:!1,include:["**/*.js","**/*.jsx","**/*.ts","**/*.tsx","**/*.vue","**/*.svelte"],exclude:["node_modules"],cacheLocation:(0,E.resolve)(l.cacheDir,".eslintcache"),formatter:"stylish",emitWarning:!0,emitError:!0,failOnWarning:!1,failOnError:!0,errorOnUnmatchedPattern:!1},i)},async buildStart(){let[l,p]=await f(import(t.eslintPath??"eslint"));if(l)this.error("Failed to import ESLint, do you install or configure eslintPath?");else{let o=x(t);switch(e=new p.ESLint(o),c=p.ESLint.outputFixes,a=(0,v.createFilter)(t.include,t.exclude),typeof t.formatter){case"string":n=(await e.loadFormatter(t.formatter)).format;break;case"function":n=t.formatter;default:break}if(t.lintOnStart&&t.include){this.warn("LintOnStart is turned on, and it will check for all matching files.");let[s]=await f(d(this,e,t.include,t,n,c));s&&this.error(s.message)}}},async transform(l,p){let o=y(p),s=O(o);if(s&&u.has(o)&&u.delete(o),!a(o)||await e.isPathIgnored(o)||s)return null;t.cache&&u.add(o);let[r]=await f(d(this,e,t.cache?Array.from(u):o,t,n,c));return r&&this.error(r.message),null}}}0&&(module.exports={});
"use strict";var m=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var F=(i,e)=>{for(var a in e)m(i,a,{get:e[a],enumerable:!0})},b=(i,e,a,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of L(e))!P.call(i,t)&&t!==a&&m(i,t,{get:()=>e[t],enumerable:!(n=w(e,t))||n.enumerable});return i};var j=i=>b(m({},"__esModule",{value:!0}),i);var R={};F(R,{default:()=>S});module.exports=j(R);var E=require("path"),v=require("@rollup/pluginutils");var g="vite-plugin-eslint";var h=require("fs");function y(i){return i.split("?",2)[0]}function O(i){return!(0,h.existsSync)(i)}function x(i){let{eslintPath:e,lintOnStart:a,include:n,exclude:t,formatter:c,emitWarning:u,emitError:l,failOnWarning:p,failOnError:o,...s}=i;return s}async function f(i){return i.then(e=>[null,e]).catch(e=>[e,void 0])}async function d(i,e,a,n,t,c){let[u,l]=await f(e.lintFiles(a));if(u)return Promise.reject(u);let p=l.some(r=>r.warningCount>0),o=l.some(r=>r.errorCount>0),s=t(l);if(n.fix&&l){let[r]=await f(c(l));if(r)return Promise.reject(r)}if(p&&n.emitWarning){let r=typeof s=="string"?s:await s;n.failOnWarning?i.error(r):i.warn(r)}if(o&&n.emitError){let r=typeof s=="string"?s:await s;n.failOnError?i.error(r):console.log(r)}return Promise.resolve()}function S(i={}){let e,a,n,t,c,u=new Set;return{name:g,async configResolved(l){t=Object.assign({lintOnStart:!1,include:["**/*.js","**/*.jsx","**/*.ts","**/*.tsx","**/*.vue","**/*.svelte"],exclude:["**/node_modules/**"],cacheLocation:(0,E.resolve)(l.cacheDir,".eslintcache"),formatter:"stylish",emitWarning:!0,emitError:!0,failOnWarning:!1,failOnError:!0,errorOnUnmatchedPattern:!1},i)},async buildStart(){let[l,p]=await f(import(t.eslintPath??"eslint"));if(l)this.error("Failed to import ESLint, do you install or configure eslintPath?");else{let o=x(t);switch(e=new p.ESLint(o),c=p.ESLint.outputFixes,a=(0,v.createFilter)(t.include,t.exclude),typeof t.formatter){case"string":n=(await e.loadFormatter(t.formatter)).format;break;case"function":n=t.formatter;default:break}if(t.lintOnStart&&t.include){this.warn("LintOnStart is turned on, and it will check for all matching files.");let[s]=await f(d(this,e,t.include,t,n,c));s&&this.error(s.message)}}},async transform(l,p){let o=y(p),s=O(o);if(s&&u.has(o)&&u.delete(o),!a(o)||await e.isPathIgnored(o)||s)return null;t.cache&&u.add(o);let[r]=await f(d(this,e,t.cache?Array.from(u):o,t,n,c));return r&&this.error(r.message),null}}}0&&(module.exports={});
{
"name": "vite-plugin-eslint",
"version": "1.8.0",
"version": "1.8.1",
"description": "ESLint plugin for vite.",

@@ -57,3 +57,3 @@ "author": "Xiang Gao",

"typescript": "^4.7.4",
"vite": "^3.0.5"
"vite": "^3.0.8"
},

@@ -60,0 +60,0 @@ "peerDependencies": {

@@ -64,3 +64,3 @@ # vite-plugin-eslint

- Type: `string | string[]`
- Default: `/\.(jsx?|tsx?|vue|svelte)$/`
- Default: `['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx', '**/*.vue', '**/*.svelte']`

@@ -72,3 +72,3 @@ A single file, or array of files, to include when linting.

- Type: `string | string[]`
- Default: `[node_modules]`
- Default: `['**/node_modules/**']`

@@ -75,0 +75,0 @@ A single file, or array of files, to exclude when linting.

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc