From e8c2acf5dee035ee13df4fd08703b8c8193fac69 Mon Sep 17 00:00:00 2001 From: Aviv Keller <38299977+RedYetiDev@users.noreply.github.com> Date: Sun, 21 Jul 2024 18:21:42 -0400 Subject: [PATCH] meta: reword linter messages PR-URL: https://github.com/nodejs/node/pull/53949 Reviewed-By: Antoine du Hamel Reviewed-By: James M Snell --- eslint.config.mjs | 14 +++++++------- lib/eslint.config_partial.mjs | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index b9cce86efb4..67d21b540f9 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -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.", }, ] }, }, diff --git a/lib/eslint.config_partial.mjs b/lib/eslint.config_partial.mjs index a51fafafaf1..0310790bac8 100644 --- a/lib/eslint.config_partial.mjs +++ b/lib/eslint.config_partial.mjs @@ -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.', }, ]; @@ -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.', }, ], },