Skip to content

Commit 988394c

Browse files
authored
Update dependencies (#2575)
1 parent b1cc894 commit 988394c

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@
6464
"clean-regexp": "^1.0.0",
6565
"core-js-compat": "^3.40.0",
6666
"esquery": "^1.6.0",
67-
"globals": "^15.15.0",
67+
"globals": "^16.0.0",
6868
"indent-string": "^5.0.0",
69-
"is-builtin-module": "^4.0.0",
69+
"is-builtin-module": "^5.0.0",
7070
"jsesc": "^3.1.0",
7171
"pluralize": "^8.0.0",
7272
"read-package-up": "^11.0.0",
@@ -79,9 +79,9 @@
7979
"@babel/code-frame": "^7.26.2",
8080
"@babel/core": "^7.26.9",
8181
"@babel/eslint-parser": "^7.26.8",
82-
"@eslint/eslintrc": "^3.2.0",
82+
"@eslint/eslintrc": "^3.3.0",
8383
"@lubien/fixture-beta-package": "^1.0.0-beta.1",
84-
"@typescript-eslint/parser": "^8.24.1",
84+
"@typescript-eslint/parser": "^8.25.0",
8585
"ava": "^6.2.0",
8686
"c8": "^10.1.3",
8787
"enquirer": "^2.4.1",
@@ -98,7 +98,7 @@
9898
"listr2": "^8.2.5",
9999
"lodash-es": "^4.17.21",
100100
"markdownlint-cli": "^0.44.0",
101-
"memoize": "^10.0.0",
101+
"memoize": "^10.1.0",
102102
"nano-spawn": "^0.2.0",
103103
"node-style-text": "^0.0.7",
104104
"npm-package-json-lint": "^8.0.0",

rules/prefer-node-protocol.js

+8-7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const MESSAGE_ID = 'prefer-node-protocol';
55
const messages = {
66
[MESSAGE_ID]: 'Prefer `node:{{moduleName}}` over `{{moduleName}}`.',
77
};
8+
const NODE_PROTOCOL = 'node:';
89

910
const create = context => ({
1011
Literal(node) {
@@ -27,12 +28,12 @@ const create = context => ({
2728

2829
const {value} = node;
2930

30-
if (
31-
typeof value !== 'string'
32-
|| value.startsWith('node:')
33-
|| /^bun(?::|$)/.test(value)
34-
|| !isBuiltinModule(value)
35-
) {
31+
if (!(
32+
typeof value === 'string'
33+
&& !value.startsWith(NODE_PROTOCOL)
34+
&& isBuiltinModule(value)
35+
&& isBuiltinModule(`${NODE_PROTOCOL}${value}`)
36+
)) {
3637
return;
3738
}
3839

@@ -42,7 +43,7 @@ const create = context => ({
4243
messageId: MESSAGE_ID,
4344
data: {moduleName: value},
4445
/** @param {import('eslint').Rule.RuleFixer} fixer */
45-
fix: fixer => fixer.insertTextAfterRange([insertPosition, insertPosition], 'node:'),
46+
fix: fixer => fixer.insertTextAfterRange([insertPosition, insertPosition], NODE_PROTOCOL),
4647
};
4748
},
4849
});

test/prefer-node-protocol.js

+6
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,13 @@ test.snapshot({
2424
const fs = await import(\`fs\`);
2525
}
2626
`,
27+
'import "punycode";', // Deprecated
28+
'import "node:punycode";', // Deprecated
2729
'import "punycode/";',
30+
'import "fs/";',
31+
// `test` is not a builtin module, `node:test` is
32+
'import "test";',
33+
'import "node:test";',
2834
// https://bun.sh/docs/runtime/bun-apis
2935
'import "bun";',
3036
'import "bun:jsc";',

0 commit comments

Comments
 (0)