Skip to content

Commit

Permalink
fix: Add supported version to Buffer constructor (#266)
Browse files Browse the repository at this point in the history
  • Loading branch information
scagood authored May 7, 2024
1 parent c7a014c commit 030f51b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/unsupported-features/node-builtins-modules/buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const buffer = {
},
Buffer: {
[READ]: { supported: ["0.1.90"] },
[CONSTRUCT]: { deprecated: ["6.0.0"] },
[CONSTRUCT]: { supported: ["0.1.90"], deprecated: ["6.0.0"] },
alloc: { [READ]: { supported: ["5.10.0", "4.5.0"] } },
allocUnsafe: { [READ]: { supported: ["5.10.0", "4.5.0"] } },
allocUnsafeSlow: { [READ]: { supported: ["5.12.0", "4.5.0"] } },
Expand Down
4 changes: 4 additions & 0 deletions tests/lib/rules/no-unsupported-features/node-builtins.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,10 @@ new RuleTester({ languageOptions: { sourceType: "module" } }).run(
},
],
},
{
code: "new Buffer(123)",
options: [{ version: "6.0.0" }],
},
],
invalid: [
{
Expand Down

0 comments on commit 030f51b

Please sign in to comment.