Skip to content

Commit b312ec0

Browse files
avivkellerRafaelGSS
authored andcommitted
meta: reword linter messages
PR-URL: #53949 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent fbf74bc commit b312ec0

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

eslint.config.mjs

+7-7
Original file line numberDiff line numberDiff line change
@@ -346,31 +346,31 @@ export default [
346346
'error',
347347
{
348348
name: '__filename',
349-
message: 'Use import.meta.url instead',
349+
message: 'Use import.meta.url instead.',
350350
},
351351
{
352352
name: '__dirname',
353-
message: 'Not available in ESM',
353+
message: 'Not available in ESM.',
354354
},
355355
{
356356
name: 'exports',
357-
message: 'Not available in ESM',
357+
message: 'Not available in ESM.',
358358
},
359359
{
360360
name: 'module',
361-
message: 'Not available in ESM',
361+
message: 'Not available in ESM.',
362362
},
363363
{
364364
name: 'require',
365-
message: 'Use import instead',
365+
message: 'Use import instead.',
366366
},
367367
{
368368
name: 'Buffer',
369-
message: 'Import Buffer instead of using the global',
369+
message: "Import 'Buffer' instead of using the global.",
370370
},
371371
{
372372
name: 'process',
373-
message: 'Import process instead of using the global',
373+
message: "Import 'process' instead of using the global.",
374374
},
375375
] },
376376
},

lib/eslint.config_partial.mjs

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,23 @@ const noRestrictedSyntax = [
1111
...noRestrictedSyntaxCommonLib,
1212
{
1313
selector: "CallExpression[callee.object.name='assert']:not([callee.property.name='ok']):not([callee.property.name='fail']):not([callee.property.name='ifError'])",
14-
message: 'Please only use simple assertions in ./lib',
14+
message: 'Only use simple assertions',
1515
},
1616
{
1717
selector: 'NewExpression[callee.name=/Error$/]:not([callee.name=/^(AssertionError|NghttpError|AbortError|NodeAggregateError)$/])',
18-
message: 'Use an error exported by the internal/errors module.',
18+
message: "Use an error exported by 'internal/errors' instead.",
1919
},
2020
{
2121
selector: "CallExpression[callee.object.name='Error'][callee.property.name='captureStackTrace']",
22-
message: "Please use `require('internal/errors').hideStackFrames()` instead.",
22+
message: "Use 'hideStackFrames' from 'internal/errors' instead.",
2323
},
2424
{
2525
selector: "AssignmentExpression:matches([left.object.name='Error']):matches([left.name='prepareStackTrace'], [left.property.name='prepareStackTrace'])",
26-
message: "Use 'overrideStackTrace' from 'lib/internal/errors.js' instead of 'Error.prepareStackTrace'.",
26+
message: "Use 'overrideStackTrace' from 'internal/errors' instead.",
2727
},
2828
{
2929
selector: "ThrowStatement > NewExpression[callee.name=/^ERR_[A-Z_]+$/] > ObjectExpression:first-child:not(:has([key.name='message']):has([key.name='code']):has([key.name='syscall']))",
30-
message: 'The context passed into SystemError constructor must have .code, .syscall and .message.',
30+
message: 'The context passed into the SystemError constructor must include .code, .syscall, and .message properties.',
3131
},
3232
];
3333

@@ -500,7 +500,7 @@ export default [
500500
...noRestrictedSyntax,
501501
{
502502
selector: 'VariableDeclarator:has(.init[name="primordials"]) Identifier[name=/Prototype[A-Z]/]:not([name=/^(Object|Reflect)(Get|Set)PrototypeOf$/])',
503-
message: 'We do not use prototype primordials in this file',
503+
message: 'Do not use prototype primordials in this file.',
504504
},
505505
],
506506
},

0 commit comments

Comments
 (0)