npm-pkg-lint 2.0.3 → 3.0.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 +44 -1
- package/bin/index.js +0 -0
- package/dist/index.js +834 -639
- package/dist/index.js.map +4 -4
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -17,7 +17,24 @@ Core principles:
|
|
|
17
17
|
|
|
18
18
|
> npx npm-pkg-lint [--tarball my-pkg-1.2.3.tgz} [--pkgfile package.json]
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
```
|
|
21
|
+
usage: npm-pkg-lint [-h] [-v] [-t TARBALL] [-p PKGFILE] [OPTIONS]
|
|
22
|
+
|
|
23
|
+
npm package linter
|
|
24
|
+
|
|
25
|
+
optional arguments:
|
|
26
|
+
-h, --help show this help message and exit
|
|
27
|
+
-v, --version show program's version number and exit
|
|
28
|
+
-t TARBALL, --tarball TARBALL
|
|
29
|
+
specify tarball location
|
|
30
|
+
-p PKGFILE, --pkgfile PKGFILE
|
|
31
|
+
specify package.json location
|
|
32
|
+
--allow-types-dependencies
|
|
33
|
+
allow dependencies to `@types/*`
|
|
34
|
+
--ignore-missing-fields
|
|
35
|
+
ignore errors for missing fields (but still checks for
|
|
36
|
+
empty and valid)
|
|
37
|
+
```
|
|
21
38
|
|
|
22
39
|
Use `--tarball` and `--pkgfile` to specify custom locations.
|
|
23
40
|
Default is to find `package.json` from current directory tree and derive tarball filename from the `name` and `version` field.
|
|
@@ -80,6 +97,30 @@ Examples of disallowed packages:
|
|
|
80
97
|
|
|
81
98
|
By default `@types/*` is disallowed but this can be disabled with `--allow-types-dependencies`.
|
|
82
99
|
|
|
100
|
+
## Obsolete dependencies
|
|
101
|
+
|
|
102
|
+
Disallows certain packages from being included as `dependencies`, `devDependencies` or `peerDependencies` entirely.
|
|
103
|
+
These dependencies have native replacements supported by all supported NodeJS versions.
|
|
104
|
+
|
|
105
|
+
**Why?** Obsolete packages have native replacements and thus only clutter the dependency graphs thus increasing the time to install, the size on disk and produces noise with tools analyzing `package-lock.json`.
|
|
106
|
+
|
|
107
|
+
Examples of obsolete packages:
|
|
108
|
+
|
|
109
|
+
- `mkdirp` - `fs#mkdir` supports the `recursive` flag since NodeJS v10.
|
|
110
|
+
- `stable` - `Array#sort` is stable since NodeJS v12.
|
|
111
|
+
|
|
112
|
+
## Deprecated dependencies
|
|
113
|
+
|
|
114
|
+
Disallows deprecated packages from being included as `dependencies`, `devDependencies` or `peerDependencies` entirely.
|
|
115
|
+
These dependences are explicitly marked as deprecated by the package author.
|
|
116
|
+
|
|
117
|
+
**Why?** Deprecated packages should be removed or replaced with alternatives as they are often unmaintained and might contain security vulnerabilities.
|
|
118
|
+
|
|
119
|
+
Examples of obsolete packages:
|
|
120
|
+
|
|
121
|
+
- `mkdirp` - `fs#mkdir` supports the `recursive` flag since NodeJS v10.
|
|
122
|
+
- `stable` - `Array#sort` is stable since NodeJS v12.
|
|
123
|
+
|
|
83
124
|
### ESLint
|
|
84
125
|
|
|
85
126
|
If your `package.json` contains the `"eslint"` keyword the ESLint packages can be included as dependencies, e.g. if you publish a sharable config including a plugin you must include `"eslint"` as a keyword.
|
|
@@ -165,6 +206,8 @@ It also enforces all urls to be `https`, even the repository url.
|
|
|
165
206
|
While `git` is technically valid most users cannot clone the repository anonomously.
|
|
166
207
|
Shortcuts are not permitted either because it saves basically nothing, makes tooling more difficult to write and wont work for smaller hosting services.
|
|
167
208
|
|
|
209
|
+
When the `--ignore-missing-fields` option is used the fields can be omitted (but still need to be valid if present).
|
|
210
|
+
|
|
168
211
|
## Unsupported node versions
|
|
169
212
|
|
|
170
213
|
Requires `engines.node` to be up-to-date and only supporting LTS and active versions.
|
package/bin/index.js
CHANGED
|
File without changes
|