Skip to content

Commit

Permalink
meta: reword linter messages
Browse files Browse the repository at this point in the history
  • Loading branch information
RedYetiDev committed Jul 19, 2024
1 parent 45ff44b commit a5ac2d0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
14 changes: 7 additions & 7 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -346,31 +346,31 @@ export default [
'error',
{
name: '__filename',
message: 'Use import.meta.url instead',
message: 'Use import.meta.url instead.',
},
{
name: '__dirname',
message: 'Not available in ESM',
message: 'Not available in ESM.',
},
{
name: 'exports',
message: 'Not available in ESM',
message: 'Not available in ESM.',
},
{
name: 'module',
message: 'Not available in ESM',
message: 'Not available in ESM.',
},
{
name: 'require',
message: 'Use import instead',
message: 'Use import instead.',
},
{
name: 'Buffer',
message: 'Import Buffer instead of using the global',
message: "Import 'Buffer' instead of using the global.",
},
{
name: 'process',
message: 'Import process instead of using the global',
message: "Import 'process' instead of using the global.",
},
] },
},
Expand Down
12 changes: 6 additions & 6 deletions lib/eslint.config_partial.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@ const noRestrictedSyntax = [
...noRestrictedSyntaxCommonLib,
{
selector: "CallExpression[callee.object.name='assert']:not([callee.property.name='ok']):not([callee.property.name='fail']):not([callee.property.name='ifError'])",
message: 'Please only use simple assertions in ./lib',
message: 'Only use simple assertions',
},
{
selector: 'NewExpression[callee.name=/Error$/]:not([callee.name=/^(AssertionError|NghttpError|AbortError|NodeAggregateError)$/])',
message: 'Use an error exported by the internal/errors module.',
message: "Use an error exported by 'internal/errors' instead.",
},
{
selector: "CallExpression[callee.object.name='Error'][callee.property.name='captureStackTrace']",
message: "Please use `require('internal/errors').hideStackFrames()` instead.",
message: "Use 'hideStackFrames' from 'internal/errors' instead.",
},
{
selector: "AssignmentExpression:matches([left.object.name='Error']):matches([left.name='prepareStackTrace'], [left.property.name='prepareStackTrace'])",
message: "Use 'overrideStackTrace' from 'lib/internal/errors.js' instead of 'Error.prepareStackTrace'.",
message: "Use 'overrideStackTrace' from 'internal/errors' instead.",
},
{
selector: "ThrowStatement > NewExpression[callee.name=/^ERR_[A-Z_]+$/] > ObjectExpression:first-child:not(:has([key.name='message']):has([key.name='code']):has([key.name='syscall']))",
message: 'The context passed into SystemError constructor must have .code, .syscall and .message.',
message: 'The context passed into the SystemError constructor must include .code, .syscall, and .message properties.',
},
];

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

0 comments on commit a5ac2d0

Please sign in to comment.