eslint-plugin-n 15.3.0 → 15.5.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 +94 -94
- package/lib/rules/no-callback-literal.js +4 -3
- package/lib/rules/no-unsupported-features/node-builtins.js +1 -1
- package/lib/rules/no-unsupported-features.js +5 -4
- package/lib/rules/process-exit-as-throw.js +1 -1
- package/lib/rules/shebang.js +5 -4
- package/lib/util/check-publish.js +6 -0
- package/package.json +8 -3
package/README.md
CHANGED
|
@@ -8,12 +8,12 @@ Additional ESLint's rules for Node.js
|
|
|
8
8
|
|
|
9
9
|
## 💿 Install & Usage
|
|
10
10
|
|
|
11
|
-
```
|
|
12
|
-
|
|
11
|
+
```sh
|
|
12
|
+
npm install --save-dev eslint eslint-plugin-n
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
-
|
|
16
|
-
-
|
|
15
|
+
- Requires Node.js `>=12.22.0`
|
|
16
|
+
- Requires ESLint `>=7.0.0`
|
|
17
17
|
|
|
18
18
|
**Note:** It recommends a use of [the "engines" field of package.json](https://docs.npmjs.com/files/package.json#engines). The "engines" field is used by `n/no-unsupported-features/*` rules.
|
|
19
19
|
|
|
@@ -55,119 +55,119 @@ $ npm install --save-dev eslint eslint-plugin-n
|
|
|
55
55
|
|
|
56
56
|
## 📖 Rules
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
- ✒️ - the mark of fixable rules.
|
|
60
|
-
|
|
61
|
-
<!--RULES_TABLE_START-->
|
|
62
|
-
### Possible Errors
|
|
58
|
+
<!-- begin auto-generated rules list -->
|
|
63
59
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
| [n/no-extraneous-require](./docs/rules/no-extraneous-require.md) | disallow `require()` expressions which import extraneous modules | ⭐️ |
|
|
71
|
-
| [n/no-missing-import](./docs/rules/no-missing-import.md) | disallow `import` declarations which import non-existence modules | ⭐️ |
|
|
72
|
-
| [n/no-missing-require](./docs/rules/no-missing-require.md) | disallow `require()` expressions which import non-existence modules | ⭐️ |
|
|
73
|
-
| [n/no-new-require](./docs/rules/no-new-require.md) | disallow `new` operators with calls to `require` | |
|
|
74
|
-
| [n/no-path-concat](./docs/rules/no-path-concat.md) | disallow string concatenation with `__dirname` and `__filename` | |
|
|
75
|
-
| [n/no-process-exit](./docs/rules/no-process-exit.md) | disallow the use of `process.exit()` | |
|
|
76
|
-
| [n/no-unpublished-bin](./docs/rules/no-unpublished-bin.md) | disallow `bin` files that npm ignores | ⭐️ |
|
|
77
|
-
| [n/no-unpublished-import](./docs/rules/no-unpublished-import.md) | disallow `import` declarations which import private modules | ⭐️ |
|
|
78
|
-
| [n/no-unpublished-require](./docs/rules/no-unpublished-require.md) | disallow `require()` expressions which import private modules | ⭐️ |
|
|
79
|
-
| [n/no-unsupported-features/es-builtins](./docs/rules/no-unsupported-features/es-builtins.md) | disallow unsupported ECMAScript built-ins on the specified version | ⭐️ |
|
|
80
|
-
| [n/no-unsupported-features/es-syntax](./docs/rules/no-unsupported-features/es-syntax.md) | disallow unsupported ECMAScript syntax on the specified version | ⭐️ |
|
|
81
|
-
| [n/no-unsupported-features/node-builtins](./docs/rules/no-unsupported-features/node-builtins.md) | disallow unsupported Node.js built-in APIs on the specified version | ⭐️ |
|
|
82
|
-
| [n/process-exit-as-throw](./docs/rules/process-exit-as-throw.md) | make `process.exit()` expressions the same code path as `throw` | ⭐️ |
|
|
83
|
-
| [n/shebang](./docs/rules/shebang.md) | suggest correct usage of shebang | ⭐️✒️ |
|
|
60
|
+
💼 Configurations enabled in.\
|
|
61
|
+
✅ Set in the `recommended` configuration.\
|
|
62
|
+
☑️ Set in the `recommended-module` configuration.\
|
|
63
|
+
✔️ Set in the `recommended-script` configuration.\
|
|
64
|
+
🔧 Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\
|
|
65
|
+
❌ Deprecated.
|
|
84
66
|
|
|
85
67
|
### Best Practices
|
|
86
68
|
|
|
87
|
-
|
|
|
88
|
-
|
|
89
|
-
| [
|
|
69
|
+
| Name | Description | 💼 | 🔧 | ❌ |
|
|
70
|
+
| :--------------------------------------------------- | :----------------------- | :------ | :- | :- |
|
|
71
|
+
| [no-deprecated-api](docs/rules/no-deprecated-api.md) | disallow deprecated APIs | ✅ ☑️ ✔️ | | |
|
|
72
|
+
|
|
73
|
+
### Possible Errors
|
|
74
|
+
|
|
75
|
+
| Name | Description | 💼 | 🔧 | ❌ |
|
|
76
|
+
| :------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------- | :------ | :- | :- |
|
|
77
|
+
| [handle-callback-err](docs/rules/handle-callback-err.md) | require error handling in callbacks | | | |
|
|
78
|
+
| [no-callback-literal](docs/rules/no-callback-literal.md) | enforce Node.js-style error-first callback pattern is followed | | | |
|
|
79
|
+
| [no-exports-assign](docs/rules/no-exports-assign.md) | disallow the assignment to `exports` | ✅ ☑️ ✔️ | | |
|
|
80
|
+
| [no-extraneous-import](docs/rules/no-extraneous-import.md) | disallow `import` declarations which import extraneous modules | ✅ ☑️ ✔️ | | |
|
|
81
|
+
| [no-extraneous-require](docs/rules/no-extraneous-require.md) | disallow `require()` expressions which import extraneous modules | ✅ ☑️ ✔️ | | |
|
|
82
|
+
| [no-hide-core-modules](docs/rules/no-hide-core-modules.md) | disallow third-party modules which are hiding core modules | | | ❌ |
|
|
83
|
+
| [no-missing-import](docs/rules/no-missing-import.md) | disallow `import` declarations which import non-existence modules | ✅ ☑️ ✔️ | | |
|
|
84
|
+
| [no-missing-require](docs/rules/no-missing-require.md) | disallow `require()` expressions which import non-existence modules | ✅ ☑️ ✔️ | | |
|
|
85
|
+
| [no-new-require](docs/rules/no-new-require.md) | disallow `new` operators with calls to `require` | | | |
|
|
86
|
+
| [no-path-concat](docs/rules/no-path-concat.md) | disallow string concatenation with `__dirname` and `__filename` | | | |
|
|
87
|
+
| [no-process-exit](docs/rules/no-process-exit.md) | disallow the use of `process.exit()` | ✅ ☑️ ✔️ | | |
|
|
88
|
+
| [no-unpublished-bin](docs/rules/no-unpublished-bin.md) | disallow `bin` files that npm ignores | ✅ ☑️ ✔️ | | |
|
|
89
|
+
| [no-unpublished-import](docs/rules/no-unpublished-import.md) | disallow `import` declarations which import private modules | ✅ ☑️ ✔️ | | |
|
|
90
|
+
| [no-unpublished-require](docs/rules/no-unpublished-require.md) | disallow `require()` expressions which import private modules | ✅ ☑️ ✔️ | | |
|
|
91
|
+
| [no-unsupported-features](docs/rules/no-unsupported-features.md) | disallow unsupported ECMAScript features on the specified version | | | ❌ |
|
|
92
|
+
| [no-unsupported-features/es-builtins](docs/rules/no-unsupported-features/es-builtins.md) | disallow unsupported ECMAScript built-ins on the specified version | ✅ ☑️ ✔️ | | |
|
|
93
|
+
| [no-unsupported-features/es-syntax](docs/rules/no-unsupported-features/es-syntax.md) | disallow unsupported ECMAScript syntax on the specified version | ✅ ☑️ ✔️ | | |
|
|
94
|
+
| [no-unsupported-features/node-builtins](docs/rules/no-unsupported-features/node-builtins.md) | disallow unsupported Node.js built-in APIs on the specified version | ✅ ☑️ ✔️ | | |
|
|
95
|
+
| [process-exit-as-throw](docs/rules/process-exit-as-throw.md) | require that `process.exit()` expressions use the same code path as `throw` | ✅ ☑️ ✔️ | | |
|
|
96
|
+
| [shebang](docs/rules/shebang.md) | require correct usage of shebang | ✅ ☑️ ✔️ | 🔧 | |
|
|
90
97
|
|
|
91
98
|
### Stylistic Issues
|
|
92
99
|
|
|
93
|
-
|
|
|
94
|
-
|
|
95
|
-
| [
|
|
96
|
-
| [
|
|
97
|
-
| [
|
|
98
|
-
| [
|
|
99
|
-
| [
|
|
100
|
-
| [
|
|
101
|
-
| [
|
|
102
|
-
| [
|
|
103
|
-
| [
|
|
104
|
-
| [
|
|
105
|
-
| [
|
|
106
|
-
| [
|
|
107
|
-
| [
|
|
108
|
-
| [
|
|
109
|
-
| [
|
|
110
|
-
| [
|
|
111
|
-
| [
|
|
112
|
-
| [
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
These rules have been deprecated in accordance with the [deprecation policy](https://eslint.org/docs/user-guide/rule-deprecation), and replaced by newer rules:
|
|
117
|
-
|
|
118
|
-
| Rule ID | Replaced by |
|
|
119
|
-
|:--------|:------------|
|
|
120
|
-
| [n/no-hide-core-modules](./docs/rules/no-hide-core-modules.md) | (nothing) |
|
|
121
|
-
| [n/no-unsupported-features](./docs/rules/no-unsupported-features.md) | [n/no-unsupported-features/es-syntax](./docs/rules/no-unsupported-features/es-syntax.md) and [n/no-unsupported-features/es-builtins](./docs/rules/no-unsupported-features/es-builtins.md) |
|
|
122
|
-
|
|
123
|
-
<!--RULES_TABLE_END-->
|
|
100
|
+
| Name | Description | 💼 | 🔧 | ❌ |
|
|
101
|
+
| :------------------------------------------------------------------------------- | :---------------------------------------------------------------------- | :- | :- | :- |
|
|
102
|
+
| [callback-return](docs/rules/callback-return.md) | require `return` statements after callbacks | | | |
|
|
103
|
+
| [exports-style](docs/rules/exports-style.md) | enforce either `module.exports` or `exports` | | 🔧 | |
|
|
104
|
+
| [file-extension-in-import](docs/rules/file-extension-in-import.md) | enforce the style of file extensions in `import` declarations | | 🔧 | |
|
|
105
|
+
| [global-require](docs/rules/global-require.md) | require `require()` calls to be placed at top-level module scope | | | |
|
|
106
|
+
| [no-mixed-requires](docs/rules/no-mixed-requires.md) | disallow `require` calls to be mixed with regular variable declarations | | | |
|
|
107
|
+
| [no-process-env](docs/rules/no-process-env.md) | disallow the use of `process.env` | | | |
|
|
108
|
+
| [no-restricted-import](docs/rules/no-restricted-import.md) | disallow specified modules when loaded by `import` declarations | | | |
|
|
109
|
+
| [no-restricted-require](docs/rules/no-restricted-require.md) | disallow specified modules when loaded by `require` | | | |
|
|
110
|
+
| [no-sync](docs/rules/no-sync.md) | disallow synchronous methods | | | |
|
|
111
|
+
| [prefer-global/buffer](docs/rules/prefer-global/buffer.md) | enforce either `Buffer` or `require("buffer").Buffer` | | | |
|
|
112
|
+
| [prefer-global/console](docs/rules/prefer-global/console.md) | enforce either `console` or `require("console")` | | | |
|
|
113
|
+
| [prefer-global/process](docs/rules/prefer-global/process.md) | enforce either `process` or `require("process")` | | | |
|
|
114
|
+
| [prefer-global/text-decoder](docs/rules/prefer-global/text-decoder.md) | enforce either `TextDecoder` or `require("util").TextDecoder` | | | |
|
|
115
|
+
| [prefer-global/text-encoder](docs/rules/prefer-global/text-encoder.md) | enforce either `TextEncoder` or `require("util").TextEncoder` | | | |
|
|
116
|
+
| [prefer-global/url](docs/rules/prefer-global/url.md) | enforce either `URL` or `require("url").URL` | | | |
|
|
117
|
+
| [prefer-global/url-search-params](docs/rules/prefer-global/url-search-params.md) | enforce either `URLSearchParams` or `require("url").URLSearchParams` | | | |
|
|
118
|
+
| [prefer-promises/dns](docs/rules/prefer-promises/dns.md) | enforce `require("dns").promises` | | | |
|
|
119
|
+
| [prefer-promises/fs](docs/rules/prefer-promises/fs.md) | enforce `require("fs").promises` | | | |
|
|
120
|
+
|
|
121
|
+
<!-- end auto-generated rules list -->
|
|
124
122
|
|
|
125
123
|
## 🔧 Configs
|
|
126
124
|
|
|
127
125
|
This plugin provides three configs:
|
|
128
126
|
|
|
129
|
-
-
|
|
130
|
-
-
|
|
131
|
-
-
|
|
127
|
+
- `plugin:n/recommended` considers both CommonJS and ES Modules. If [`"type":"module"` field](https://medium.com/@nodejs/announcing-a-new-experimental-modules-1be8d2d6c2ff#b023) existed in package.json then it considers files as ES Modules. Otherwise it considers files as CommonJS. In addition, it considers `*.mjs` files as ES Modules and `*.cjs` files as CommonJS.
|
|
128
|
+
- `plugin:n/recommended-module` considers all files as ES Modules.
|
|
129
|
+
- `plugin:n/recommended-script` considers all files as CommonJS.
|
|
132
130
|
|
|
133
131
|
Those preset config:
|
|
134
132
|
|
|
135
|
-
-
|
|
136
|
-
-
|
|
137
|
-
-
|
|
138
|
-
-
|
|
139
|
-
-
|
|
133
|
+
- enable [no-process-exit](http://eslint.org/docs/rules/no-process-exit) rule because [the official document](https://nodejs.org/api/process.html#process_process_exit_code) does not recommend a use of `process.exit()`.
|
|
134
|
+
- enable plugin rules which are given ✅ in the above table.
|
|
135
|
+
- add `{ecmaVersion: 2019}` and etc into `parserOptions`.
|
|
136
|
+
- add proper globals into `globals`.
|
|
137
|
+
- add this plugin into `plugins`.
|
|
140
138
|
|
|
141
139
|
## 👫 FAQ
|
|
142
140
|
|
|
143
|
-
-
|
|
144
|
-
-
|
|
141
|
+
- Q: The `no-missing-import` / `no-missing-require` rules don't work with nested folders in SublimeLinter-eslint
|
|
142
|
+
- A: See [context.getFilename() in rule returns relative path](https://github.com/roadhump/SublimeLinter-eslint#contextgetfilename-in-rule-returns-relative-path) in the SublimeLinter-eslint FAQ.
|
|
145
143
|
|
|
146
144
|
## 🚥 Semantic Versioning Policy
|
|
147
145
|
|
|
148
146
|
`eslint-plugin-n` follows [semantic versioning](http://semver.org/) and [ESLint's Semantic Versioning Policy](https://github.com/eslint/eslint#semantic-versioning-policy).
|
|
149
147
|
|
|
150
|
-
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
148
|
+
- Patch release (intended to not break your lint build)
|
|
149
|
+
- A bug fix in a rule that results in it reporting fewer errors.
|
|
150
|
+
- Improvements to documentation.
|
|
151
|
+
- Non-user-facing changes such as refactoring code, adding, deleting, or modifying tests, and increasing test coverage.
|
|
152
|
+
- Re-releasing after a failed release (i.e., publishing a release that doesn't work for anyone).
|
|
153
|
+
- Minor release (might break your lint build)
|
|
154
|
+
- A bug fix in a rule that results in it reporting more errors.
|
|
155
|
+
- A new rule is created.
|
|
156
|
+
- A new option to an existing rule is created.
|
|
157
|
+
- An existing rule is deprecated.
|
|
158
|
+
- Major release (likely to break your lint build)
|
|
159
|
+
- A support for old Node version is dropped.
|
|
160
|
+
- A support for old ESLint version is dropped.
|
|
161
|
+
- An existing rule is changed in it reporting more errors.
|
|
162
|
+
- An existing rule is removed.
|
|
163
|
+
- An existing option of a rule is removed.
|
|
164
|
+
- An existing config is updated.
|
|
165
|
+
|
|
166
|
+
Deprecated rules follow ESLint's [deprecation policy](https://eslint.org/docs/user-guide/rule-deprecation).
|
|
167
167
|
|
|
168
168
|
## 📰 Changelog
|
|
169
169
|
|
|
170
|
-
-
|
|
170
|
+
- [GitHub Releases](https://github.com/weiran-zsd/eslint-plugin-node/releases)
|
|
171
171
|
|
|
172
172
|
## ❤️ Contributing
|
|
173
173
|
|
|
@@ -177,6 +177,6 @@ Please use GitHub's Issues/PRs.
|
|
|
177
177
|
|
|
178
178
|
### Development Tools
|
|
179
179
|
|
|
180
|
-
-
|
|
181
|
-
-
|
|
182
|
-
-
|
|
180
|
+
- `npm test` runs tests and measures coverage.
|
|
181
|
+
- `npm run coverage` shows the coverage result of `npm test` command.
|
|
182
|
+
- `npm run clean` removes the coverage result of `npm test` command.
|
|
@@ -8,7 +8,7 @@ module.exports = {
|
|
|
8
8
|
meta: {
|
|
9
9
|
docs: {
|
|
10
10
|
description:
|
|
11
|
-
"
|
|
11
|
+
"enforce Node.js-style error-first callback pattern is followed",
|
|
12
12
|
category: "Possible Errors",
|
|
13
13
|
recommended: false,
|
|
14
14
|
url: "https://github.com/weiran-zsd/eslint-plugin-node/blob/HEAD/docs/rules/no-callback-literal.md",
|
|
@@ -17,8 +17,9 @@ module.exports = {
|
|
|
17
17
|
fixable: null,
|
|
18
18
|
schema: [],
|
|
19
19
|
messages: {
|
|
20
|
-
unexpectedLiteral:
|
|
21
|
-
|
|
20
|
+
unexpectedLiteral:
|
|
21
|
+
"Unexpected literal in error position of callback.",
|
|
22
|
+
},
|
|
22
23
|
},
|
|
23
24
|
|
|
24
25
|
create(context) {
|
|
@@ -263,7 +263,7 @@ const trackMap = {
|
|
|
263
263
|
},
|
|
264
264
|
},
|
|
265
265
|
release: { [READ]: { supported: "3.0.0" } },
|
|
266
|
-
report: { [READ]: { supported:
|
|
266
|
+
report: { [READ]: { supported: "14.0.0", experimental: "11.8.0"} },
|
|
267
267
|
resourceUsage: { [READ]: { supported: "12.6.0" } },
|
|
268
268
|
setegid: { [READ]: { supported: "2.0.0" } },
|
|
269
269
|
seteuid: { [READ]: { supported: "2.0.0" } },
|
|
@@ -1047,14 +1047,15 @@ module.exports = {
|
|
|
1047
1047
|
"disallow unsupported ECMAScript features on the specified version",
|
|
1048
1048
|
category: "Possible Errors",
|
|
1049
1049
|
recommended: false,
|
|
1050
|
-
|
|
1051
|
-
"n/no-unsupported-features/es-syntax",
|
|
1052
|
-
"n/no-unsupported-features/es-builtins",
|
|
1053
|
-
],
|
|
1050
|
+
|
|
1054
1051
|
url: "https://github.com/weiran-zsd/eslint-plugin-node/blob/HEAD/docs/rules/no-unsupported-features.md",
|
|
1055
1052
|
},
|
|
1056
1053
|
type: "problem",
|
|
1057
1054
|
deprecated: true,
|
|
1055
|
+
replacedBy: [
|
|
1056
|
+
"n/no-unsupported-features/es-syntax",
|
|
1057
|
+
"n/no-unsupported-features/es-builtins",
|
|
1058
|
+
],
|
|
1058
1059
|
fixable: null,
|
|
1059
1060
|
schema: [
|
|
1060
1061
|
{
|
|
@@ -148,7 +148,7 @@ module.exports = {
|
|
|
148
148
|
meta: {
|
|
149
149
|
docs: {
|
|
150
150
|
description:
|
|
151
|
-
"
|
|
151
|
+
"require that `process.exit()` expressions use the same code path as `throw`",
|
|
152
152
|
category: "Possible Errors",
|
|
153
153
|
recommended: true,
|
|
154
154
|
url: "https://github.com/weiran-zsd/eslint-plugin-node/blob/HEAD/docs/rules/process-exit-as-throw.md",
|
package/lib/rules/shebang.js
CHANGED
|
@@ -69,7 +69,7 @@ function getShebangInfo(sourceCode) {
|
|
|
69
69
|
module.exports = {
|
|
70
70
|
meta: {
|
|
71
71
|
docs: {
|
|
72
|
-
description: "
|
|
72
|
+
description: "require correct usage of shebang",
|
|
73
73
|
category: "Possible Errors",
|
|
74
74
|
recommended: true,
|
|
75
75
|
url: "https://github.com/weiran-zsd/eslint-plugin-node/blob/HEAD/docs/rules/shebang.md",
|
|
@@ -89,9 +89,10 @@ module.exports = {
|
|
|
89
89
|
messages: {
|
|
90
90
|
unexpectedBOM: "This file must not have Unicode BOM.",
|
|
91
91
|
expectedLF: "This file must have Unix linebreaks (LF).",
|
|
92
|
-
expectedHashbangNode:
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
expectedHashbangNode:
|
|
93
|
+
'This file needs shebang "#!/usr/bin/env node".',
|
|
94
|
+
expectedHashbang: "This file needs no shebang.",
|
|
95
|
+
},
|
|
95
96
|
},
|
|
96
97
|
create(context) {
|
|
97
98
|
const sourceCode = context.getSourceCode()
|
|
@@ -26,6 +26,12 @@ exports.checkPublish = function checkPublish(context, filePath, targets) {
|
|
|
26
26
|
return
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
// Private packages are never published so we don't need to check the imported dependencies either.
|
|
30
|
+
// More information: https://docs.npmjs.com/cli/v8/configuring-npm/package-json#private
|
|
31
|
+
if (packageInfo.private === true) {
|
|
32
|
+
return
|
|
33
|
+
}
|
|
34
|
+
|
|
29
35
|
const allowed = new Set(getAllowModules(context))
|
|
30
36
|
const convertPath = getConvertPath(context)
|
|
31
37
|
const basedir = path.dirname(packageInfo.filePath)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-n",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.5.0",
|
|
4
4
|
"description": "Additional ESLint's rules for Node.js",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=12.22.0"
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"esbuild": "^0.14.39",
|
|
28
28
|
"eslint": "^8.21.0",
|
|
29
29
|
"eslint-config-prettier": "^8.5.0",
|
|
30
|
+
"eslint-doc-generator": "^0.19.0",
|
|
30
31
|
"eslint-plugin-eslint-plugin": "^5.0.2",
|
|
31
32
|
"eslint-plugin-n": "file:.",
|
|
32
33
|
"fast-glob": "^3.2.11",
|
|
@@ -35,6 +36,7 @@
|
|
|
35
36
|
"import-meta-resolve": "^1.1.1",
|
|
36
37
|
"lint-staged": "^12.4.1",
|
|
37
38
|
"mocha": "^10.0.0",
|
|
39
|
+
"npm-run-all": "^4.1.5",
|
|
38
40
|
"nyc": "^15.1.0",
|
|
39
41
|
"opener": "^1.5.1",
|
|
40
42
|
"prettier": "^2.7.1",
|
|
@@ -47,7 +49,9 @@
|
|
|
47
49
|
"clean": "rimraf .nyc_output coverage",
|
|
48
50
|
"codecov": "nyc report --reporter text-lcov | codecov --pipe --disable=gcov -t $CODECOV_TOKEN",
|
|
49
51
|
"coverage": "opener ./coverage/lcov-report/index.html",
|
|
50
|
-
"lint": "
|
|
52
|
+
"lint": "npm-run-all \"lint:*\"",
|
|
53
|
+
"lint:eslint-docs": "npm run update:eslint-docs -- --check",
|
|
54
|
+
"lint:js": "eslint lib scripts tests/lib .eslintrc.js",
|
|
51
55
|
"new": "node scripts/new-rule",
|
|
52
56
|
"pretest": "npm run -s lint",
|
|
53
57
|
"test": "nyc npm run -s test:_mocha",
|
|
@@ -58,7 +62,8 @@
|
|
|
58
62
|
"postversion": "git push && git push --tags",
|
|
59
63
|
"watch": "npm run test:_mocha -- --watch --growl",
|
|
60
64
|
"format": "prettier --loglevel warn --write \"**/*.{js,css,md}\"",
|
|
61
|
-
"prepare": "husky install"
|
|
65
|
+
"prepare": "husky install",
|
|
66
|
+
"update:eslint-docs": "eslint-doc-generator --config-emoji recommended-module,☑️ --config-emoji recommended-script,✔️ --split-by meta.docs.category"
|
|
62
67
|
},
|
|
63
68
|
"repository": {
|
|
64
69
|
"type": "git",
|