eslint-plugin-no-secrets
Advanced tools
Comparing version 0.5.4 to 0.6.4
14
index.js
@@ -66,3 +66,3 @@ const { | ||
//flatten | ||
tokens = [].concat.apply([],tokens); | ||
tokens = [].concat.apply([], tokens); | ||
}); | ||
@@ -73,3 +73,3 @@ return tokens; | ||
function checkEntropy(value) { | ||
value = ignoreCase ? value.toLowerCase():value; | ||
value = ignoreCase ? value.toLowerCase() : value; | ||
const tokens = splitIntoTokens(value); | ||
@@ -130,3 +130,13 @@ return tokens | ||
} | ||
}, | ||
processors: { | ||
".json": { | ||
preprocess(text) { | ||
return [`var json = ${text}`]; | ||
}, | ||
postprocess(messages, fileName) { | ||
return messages[0]; | ||
} | ||
} | ||
} | ||
}; |
{ | ||
"name": "eslint-plugin-no-secrets", | ||
"version": "0.5.4", | ||
"version": "0.6.4", | ||
"description": "An eslint rule that searches for potential secrets/keys in code", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "node tests/lib/rules/no-secrets.js" | ||
"test": "node tests/lib/rules/no-secrets.js && mocha \"staging/**/*.spec.js\"", | ||
"test:staging": "mocha \"staging/**/*.spec.js\"" | ||
}, | ||
@@ -23,4 +24,6 @@ "keywords": [ | ||
"devDependencies": { | ||
"eslint-plugin-self": "^1.2.0", | ||
"eslint5": "npm:eslint@^5.16.0", | ||
"eslint6": "npm:eslint@^6.8.0" | ||
"eslint6": "npm:eslint@^6.8.0", | ||
"mocha": "^7.1.0" | ||
}, | ||
@@ -33,4 +36,4 @@ "peerDependencies": { | ||
"npm": ">=6.9.0", | ||
"node":">=10.0.0" | ||
"node": ">=10.0.0" | ||
} | ||
} |
@@ -6,12 +6,13 @@ [![Build Status](https://travis-ci.org/nickdeis/eslint-plugin-no-secrets.svg)](https://travis-ci.org/nickdeis/eslint-plugin-no-secrets) | ||
An eslint rule that searches for potential secrets/keys in code. | ||
An eslint rule that searches for potential secrets/keys in code and JSON files. | ||
<!-- vscode-markdown-toc --> | ||
* 1. [Usage](#Usage) | ||
* 1.1. [Include JSON files](#IncludeJSONfiles) | ||
* 2. [Config](#Config) | ||
* 3. [When it's really not a secret](#Whenitsreallynotasecret) | ||
* 3.1. [1. Either disable it with a comment](#Eitherdisableitwithacomment) | ||
* 3.2. [2. use the `ignoreContent` to ignore certain content](#usetheignoreContenttoignorecertaincontent) | ||
* 3.3. [3. Use `ignoreIdentifiers` to ignore certain variable/property names](#UseignoreIdentifierstoignorecertainvariablepropertynames) | ||
* 3.4. [4. Use `additionalDelimiters` to further split up tokens](#UseadditionalDelimiterstofurthersplituptokens) | ||
* 3.1. [ Either disable it with a comment](#Eitherdisableitwithacomment) | ||
* 3.2. [ use the `ignoreContent` to ignore certain content](#usetheignoreContenttoignorecertaincontent) | ||
* 3.3. [ Use `ignoreIdentifiers` to ignore certain variable/property names](#UseignoreIdentifierstoignorecertainvariablepropertynames) | ||
* 3.4. [ Use `additionalDelimiters` to further split up tokens](#UseadditionalDelimiterstofurthersplituptokens) | ||
* 4. [Options](#Options) | ||
@@ -47,2 +48,12 @@ * 5. [Acknowledgements](#Acknowledgements) | ||
### 1.1. <a name='IncludeJSONfiles'></a>Include JSON files | ||
If you want to include JSON files, either us the `--ext` flag from the command line | ||
`eslint . --ext .json,.js` | ||
or run them on individual JSON files | ||
`eslint config.json` | ||
## 2. <a name='Config'></a>Config | ||
@@ -78,3 +89,3 @@ | ||
### 3.1. <a name='Eitherdisableitwithacomment'></a>1. Either disable it with a comment | ||
### 3.1. <a name='Eitherdisableitwithacomment'></a> Either disable it with a comment | ||
@@ -81,0 +92,0 @@ ```javascript |
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
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
19813
11
343
152
4
2
1