npm-pkg-lint 2.1.1 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -0
- package/dist/index.js +18 -1
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -109,6 +109,35 @@ If your `package.json` contains the `"eslint"` keyword the ESLint packages can b
|
|
|
109
109
|
}
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
+
### Jest
|
|
113
|
+
|
|
114
|
+
If your `package.json` contains the `"jest"` keyword the Jest packages can be included as dependencies, e.g. if you publish a sharable config including a plugin you must include `"jest"` as a keyword.
|
|
115
|
+
|
|
116
|
+
**OK**:
|
|
117
|
+
|
|
118
|
+
```json
|
|
119
|
+
{
|
|
120
|
+
"name": "awesome-jest-config",
|
|
121
|
+
"version": "1.0.0",
|
|
122
|
+
"keywords": ["jest"],
|
|
123
|
+
"dependencies": {
|
|
124
|
+
"babel-jest": "^29.0.0"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**Fail**:
|
|
130
|
+
|
|
131
|
+
```json
|
|
132
|
+
{
|
|
133
|
+
"name": "eslint-config-myfancyconfig",
|
|
134
|
+
"version": "1.0.0",
|
|
135
|
+
"dependencies": {
|
|
136
|
+
"babel-jest": "^29.0.0"
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
112
141
|
### Prettier
|
|
113
142
|
|
|
114
143
|
If your `package.json` contains the `"prettier"` keyword the Prettier packages can be included as dependencies, e.g. if you publish a sharable config including a plugin you must include `"prettier"` as a keyword.
|
package/dist/index.js
CHANGED
|
@@ -15953,7 +15953,6 @@ var disallowedDependencies = [
|
|
|
15953
15953
|
prefix("gulp"),
|
|
15954
15954
|
prefix("html-validate"),
|
|
15955
15955
|
prefix("jasmine"),
|
|
15956
|
-
prefix("jest"),
|
|
15957
15956
|
prefix("mocha"),
|
|
15958
15957
|
prefix("nyc"),
|
|
15959
15958
|
prefix("protractor"),
|
|
@@ -15972,6 +15971,13 @@ var disallowedEslint = [
|
|
|
15972
15971
|
scopedPrefix("eslint-formatter"),
|
|
15973
15972
|
scopedPrefix("eslint-plugin")
|
|
15974
15973
|
];
|
|
15974
|
+
var disallowedJest = [
|
|
15975
|
+
exact("jest"),
|
|
15976
|
+
exact("babel-jest"),
|
|
15977
|
+
exact("ts-jest"),
|
|
15978
|
+
prefix("jest-"),
|
|
15979
|
+
scope("@jest")
|
|
15980
|
+
];
|
|
15975
15981
|
var disallowedPrettier = [
|
|
15976
15982
|
exact("prettier"),
|
|
15977
15983
|
prefix("prettier-"),
|
|
@@ -15996,6 +16002,9 @@ function isDisallowedDependency(pkg, dependency) {
|
|
|
15996
16002
|
if (!keywords.includes("eslint") && match(disallowedEslint, dependency)) {
|
|
15997
16003
|
return true;
|
|
15998
16004
|
}
|
|
16005
|
+
if (!keywords.includes("jest") && match(disallowedJest, dependency)) {
|
|
16006
|
+
return true;
|
|
16007
|
+
}
|
|
15999
16008
|
if (!keywords.includes("prettier") && match(disallowedPrettier, dependency)) {
|
|
16000
16009
|
return true;
|
|
16001
16010
|
}
|
|
@@ -17707,6 +17716,10 @@ function getFilePath(key) {
|
|
|
17707
17716
|
const filename2 = `${hash.slice(0, 2)}/${hash.slice(2)}.json`;
|
|
17708
17717
|
return path5.join(cacheDir, filename2);
|
|
17709
17718
|
}
|
|
17719
|
+
async function setCacheDirecory(directory2) {
|
|
17720
|
+
await fs3.mkdir(directory2, { recursive: true });
|
|
17721
|
+
cacheDir = directory2;
|
|
17722
|
+
}
|
|
17710
17723
|
async function persistentCacheGet(key) {
|
|
17711
17724
|
if (!enabled) {
|
|
17712
17725
|
return null;
|
|
@@ -18084,6 +18097,7 @@ async function run() {
|
|
|
18084
18097
|
parser.add_argument("-v", "--version", { action: "version", version });
|
|
18085
18098
|
parser.add_argument("-t", "--tarball", { help: "specify tarball location" });
|
|
18086
18099
|
parser.add_argument("-p", "--pkgfile", { help: "specify package.json location" });
|
|
18100
|
+
parser.add_argument("--cache", { help: "specify cache directory" });
|
|
18087
18101
|
parser.add_argument("--allow-types-dependencies", {
|
|
18088
18102
|
action: "store_true",
|
|
18089
18103
|
help: "allow dependencies to `@types/*`"
|
|
@@ -18093,6 +18107,9 @@ async function run() {
|
|
|
18093
18107
|
help: "ignore errors for missing fields (but still checks for empty and valid)"
|
|
18094
18108
|
});
|
|
18095
18109
|
const args = parser.parse_args();
|
|
18110
|
+
if (args.cache) {
|
|
18111
|
+
await setCacheDirecory(args.cache);
|
|
18112
|
+
}
|
|
18096
18113
|
let regenerateReportName = false;
|
|
18097
18114
|
if (args.tarball === "-") {
|
|
18098
18115
|
args.tarball = await preloadStdin();
|