Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-loader

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-loader - npm Package Compare versions

Comparing version 1.6.2 to 1.6.3

5

CHANGELOG.md

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

# 1.6.3 - 2017-02-22
- Fixed: ignore cache when eslint rules have changed
([#151](https://github.com/MoOx/eslint-loader/pull/151) - @wrakky)
# 1.6.2 - 2017-02-22

@@ -2,0 +7,0 @@

21

index.js

@@ -11,2 +11,3 @@ var eslint = require("eslint")

var engines = {}
var rules = {}
var cache = null

@@ -33,2 +34,7 @@ var cachePath = null

// get engine
var configHash = objectHash(config)
var engine = engines[configHash]
var rulesHash = rules[configHash]
var res

@@ -38,4 +44,13 @@ // If cache is enable and the data are the same as in the cache, just

if (config.cache) {
// just get rules hash once per engine for performance reasons
if (!rulesHash) {
rulesHash = objectHash(engine.getConfigForFile(resourcePath))
rules[configHash] = rulesHash
}
var inputMD5 = crypto.createHash("md5").update(input).digest("hex")
if (cache[resourcePath] && cache[resourcePath].hash === inputMD5) {
if (
cache[resourcePath] &&
cache[resourcePath].hash === inputMD5 &&
cache[resourcePath].rules === rulesHash
) {
res = cache[resourcePath].res

@@ -47,4 +62,3 @@ }

if (!res) {
var configHash = objectHash(config)
res = engines[configHash].executeOnText(input, resourcePath, true)
res = engine.executeOnText(input, resourcePath, true)

@@ -55,2 +69,3 @@ // Save new results in the cache

hash: inputMD5,
rules: rulesHash,
res: res,

@@ -57,0 +72,0 @@ }

2

package.json
{
"name": "eslint-loader",
"version": "1.6.2",
"version": "1.6.3",
"description": "eslint loader (for webpack)",

@@ -5,0 +5,0 @@ "keywords": [

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