build: replace eslint-plugin-node with eslint-plugin-n (gh54 part II)#10952
build: replace eslint-plugin-node with eslint-plugin-n (gh54 part II)#10952Planeshifter wants to merge 3 commits intodevelopfrom
eslint-plugin-node with eslint-plugin-n (gh54 part II)#10952Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
eslint-plugin-node with eslint-plugin-neslint-plugin-node with eslint-plugin-n
ac2468f to
ff1e4ba
Compare
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
eslint-plugin-node with eslint-plugin-neslint-plugin-node with eslint-plugin-n (gh54 part II)
4fbfcbf to
7f06a75
Compare
|
@Planeshifter Heads-up: looks like stacking went sideways. Would you mind resolving the merge conflicts? |
|
Actually, I think I know what happened. It went sideways because I had deleted the base branch on the GitHub UI. And it is not clear to me how to move this PR back against the restored base branch. :( |
|
Maybe you can force push to move it back on the original base branch? 😬 |
7f06a75 to
dd197bb
Compare
lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest/lib/main.js
Outdated
Show resolved
Hide resolved
Coverage ReportNo coverage information available. |
|
/stdlib merge |
@kgryte, the slash command failed to complete. Please check the workflow logs for details. |
lib/node_modules/@stdlib/_tools/eslint/rules/doctest/lib/main.js
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest/lib/main.js
Outdated
Show resolved
Hide resolved
Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
| // MODULES // | ||
|
|
||
| var shell = require( 'child_process' ).execSync; // eslint-disable-line node/no-sync | ||
| var shell = require( 'child_process' ).execSync; |
There was a problem hiding this comment.
@Planeshifter Removing this comment re-enables the warning. Is that intended?
|
|
||
| total = pkgs.length; | ||
| out = new Array( total ); | ||
| out = new Array( total ); // eslint-disable-line stdlib/no-new-array |
There was a problem hiding this comment.
@Planeshifter We should go ahead and use #.push here. This isn't a scenario where we explicitly want a sparse array.
| rules[ 'n/no-unsupported-features/es-syntax' ] = [ 'error', { | ||
| 'version': '>=0.12.18', | ||
| 'ignores': [] | ||
| 'ignores': [ 'bigint', 'hashbang', 'object-assign', 'object-getownpropertydescriptors', 'proxy', 'string-fromcodepoint', 'string-prototype-repeat' ] |
There was a problem hiding this comment.
@Planeshifter Why are we adding these to the ignored list and not just ignoring them on a per file basis? Given that most of these are localized to specific packages, I am not sure why it makes sense to globally ignore these.
| * @memberof rules | ||
| * @type {Array} | ||
| * @see [node/shebang]{@link https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/shebang.md} | ||
| * @see [node/shebang]{@link https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/shebang.md} |
| * limitations under the License. | ||
| */ | ||
|
|
||
| /* eslint-disable node/shebang */ |
There was a problem hiding this comment.
@Planeshifter Why is this no longer applicable? It seems like n/hashbang is the same rule as node/shebang, so I am curious how this rule no longer applies.
There was a problem hiding this comment.
This obviously applies to the other files.
| // Check for a `node` property: | ||
| isString( proc.versions.node ) && | ||
|
|
||
| /* eslint-disable node/no-unsupported-features/es-builtins */ |
There was a problem hiding this comment.
@Planeshifter This seems to be likely the only package where we use proc.release, so I am not understanding why you chose to globally ignore proc.release.
| * limitations under the License. | ||
| */ | ||
|
|
||
| /* eslint-disable node/no-unsupported-features/node-builtins */ |
| @@ -20,7 +20,7 @@ | |||
|
|
|||
| // MODULES // | |||
|
|
|||
| var appendFile = require( 'fs' ).appendFileSync; // eslint-disable-line node/no-sync | |||
| var appendFile = require( 'fs' ).appendFileSync; | |||
There was a problem hiding this comment.
@Planeshifter Not understanding why this comment was removed instead of changed to n/no-sync. Applies throughout this PR.
There was a problem hiding this comment.
Given that the default value for allowRootLevel is false (ref: https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-sync.md#allowatrootlevel), I would expect this to trigger a warning given *Sync.
There was a problem hiding this comment.
Especially in this case, we shouldn't be emitting a warning, as using the sync API is intentional.
| @@ -43,7 +43,7 @@ tape( 'main export is a function', function test( t ) { | |||
| }); | |||
|
|
|||
| tape( 'the function reads the entire contents of a file', opts, function test( t ) { | |||
| var expected = fs.readFileSync( __filename ); // eslint-disable-line node/no-sync | |||
| var expected = fs.readFileSync( __filename ); // eslint-disable-line n/no-sync | |||
There was a problem hiding this comment.
@Planeshifter And then, here, we do what I would expect. So it is very unclear to me why you removed the comment in some files but then here you simply update the rule name.
| @@ -18,8 +18,6 @@ | |||
| * limitations under the License. | |||
| */ | |||
|
|
|||
| /* eslint-disable node/shebang */ | |||
There was a problem hiding this comment.
@Planeshifter Based on my reading of https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/hashbang.md, this script is not in the bin field of the package.json. In which case, we need to disable the lint rule, as the rule should claim that this file needs no hashbang. What am I missing?
| @@ -18,8 +18,10 @@ | |||
|
|
|||
| 'use strict'; | |||
|
|
|||
| /* eslint-disable n/no-unsupported-features/node-builtins */ | |||
There was a problem hiding this comment.
@Planeshifter Do we really need to disable this rule for the entire file?
| @@ -18,9 +18,11 @@ | |||
|
|
|||
| 'use strict'; | |||
|
|
|||
| /* eslint-disable n/no-unsupported-features/node-builtins */ | |||
There was a problem hiding this comment.
@Planeshifter Do we really need to disable this rule for the entire file?
| @@ -18,10 +18,12 @@ | |||
|
|
|||
| 'use strict'; | |||
|
|
|||
| /* eslint-disable n/no-unsupported-features/node-builtins */ | |||
There was a problem hiding this comment.
@Planeshifter Do we really need to disable this rule for the entire file?
| @@ -18,10 +18,12 @@ | |||
|
|
|||
| 'use strict'; | |||
|
|
|||
| /* eslint-disable n/no-unsupported-features/node-builtins */ | |||
There was a problem hiding this comment.
@Planeshifter Do we really need to disable this rule for the entire file?
| @@ -105,7 +105,7 @@ function factory( fcns, clbk, thisArg ) { | |||
| } | |||
| // Copy the remaining arguments... | |||
| len = arguments.length; | |||
| args = new Array( len ); | |||
| args = new Array( len ); // eslint-disable-line stdlib/no-new-array | |||
| @@ -38,7 +38,7 @@ bench( pkg, function benchmark( b ) { | |||
| return v * i; | |||
| } | |||
|
|
|||
| arr = new Array( 100 ); | |||
| arr = new Array( 100 ); // eslint-disable-line stdlib/no-new-array | |||
There was a problem hiding this comment.
@Planeshifter In all the loop generation here and below, we should go ahead and explicit use #.push.
| @@ -38,7 +38,7 @@ bench( pkg, function benchmark( b ) { | |||
| return v * i; | |||
| } | |||
|
|
|||
| arr = new Array( 100 ); | |||
| arr = new Array( 100 ); // eslint-disable-line stdlib/no-new-array | |||
There was a problem hiding this comment.
@Planeshifter We should go ahead and explicitly use #.push here and below.
| @@ -16,7 +16,7 @@ | |||
| * limitations under the License. | |||
| */ | |||
|
|
|||
| /* eslint-disable node/no-sync, stdlib/no-dynamic-require, stdlib/no-unassigned-require, stdlib/require-last-path-relative */ | |||
| /* eslint-disable n/no-sync, stdlib/no-dynamic-require, stdlib/no-unassigned-require */ | |||
There was a problem hiding this comment.
@Planeshifter Why is stdlib/require-last-path-relative no longer applicable here?
| @@ -25,7 +25,7 @@ var Object = require( '@stdlib/object/ctor' ); | |||
|
|
|||
| // VARIABLES // | |||
|
|
|||
| var propertyDescriptors = Object.getOwnPropertyDescriptors; // eslint-disable-line node/no-unsupported-features/es-builtins | |||
| var propertyDescriptors = Object.getOwnPropertyDescriptors; | |||
There was a problem hiding this comment.
@Planeshifter We shouldn't be globally ignoring getOwnPropertyDescriptors because of this one package.
kgryte
left a comment
There was a problem hiding this comment.
Left a series of comments. Reviewed all 542 files. There are 107 files which, IMO, have issues, as alluded to in my comments.
|
For METR, |
|
/stdlib merge |
| var tape = require( 'tape' ); | ||
| var remark = require( 'remark' ); | ||
| var readSync = require( 'to-vfile' ).readSync; // eslint-disable-line node/no-sync | ||
| var readSync = require( 'to-vfile' ).readSync; |
There was a problem hiding this comment.
@Planeshifter If only call expressions, why would it work here?
@kgryte, the slash command failed to complete. Please check the workflow logs for details. |
Progresses stdlib-js/metr-issue-tracker#54.
Description
This pull request:
eslint-plugin-node(v11) with its actively maintained forkeslint-plugin-n(v17) (PR 3 of the migration plan).nodetoninetc/eslint/plugins/index.js.node/*ton/*inetc/eslint/rules/nodejs.js.eslint-disablecomments across the codebase fromnode/ton/.tryExtensionsoption fromn/file-extension-in-import(no longer supported byeslint-plugin-n).eslint-plugin-n:bigintandhashbanginn/no-unsupported-features/es-syntax,http2andprocess.releaseinn/no-unsupported-features/node-builtins.@nametags and documentation URLs to point to theeslint-community/eslint-plugin-nrepository.log/logErrorfunctions to outer scope inremark-run-javascript-examplesand fixes pre-existing lint violations in touched files.Related Issues
This pull request has the following related issues:
Questions
No.
Other
Stacked on #10950.
eslint-plugin-nis the community-maintained fork of the unmaintainedeslint-plugin-nodeand is required for ESLint v9 compatibility.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was written primarily by Claude Code. The bulk rename was done via scripted sed, with manual review of config changes and rule compatibility.
@stdlib-js/reviewers