From caf478b72eb75b6f7ee2cea33195d48fb0479077 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Fri, 4 Apr 2025 15:41:48 +0200 Subject: [PATCH] tools: enable linter in `test/fixtures/errors` PR-URL: https://github.com/nodejs/node/pull/57701 Reviewed-By: Moshe Atlow Reviewed-By: Jake Yuesong Li --- eslint.config.mjs | 1 + test/fixtures/errors/force_colors.js | 3 ++- test/fixtures/errors/force_colors.snapshot | 6 +++--- test/fixtures/errors/throw_in_eval_anonymous.js | 2 +- test/fixtures/errors/throw_in_eval_named.js | 2 +- test/fixtures/errors/throw_in_line_with_tabs.js | 2 +- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 5bc223481a..2dbd8afabe 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -60,6 +60,7 @@ export default [ // We want to lint only a few specific fixtures folders 'test/fixtures/*', '!test/fixtures/console', + '!test/fixtures/errors', '!test/fixtures/eval', '!test/fixtures/test-runner', 'test/fixtures/test-runner/*', diff --git a/test/fixtures/errors/force_colors.js b/test/fixtures/errors/force_colors.js index 0f3c92c6f8..a19a78f092 100644 --- a/test/fixtures/errors/force_colors.js +++ b/test/fixtures/errors/force_colors.js @@ -1 +1,2 @@ -throw new Error('Should include grayed stack trace') +'use strict'; +throw new Error('Should include grayed stack trace'); diff --git a/test/fixtures/errors/force_colors.snapshot b/test/fixtures/errors/force_colors.snapshot index e5a03ca609..93ac005e83 100644 --- a/test/fixtures/errors/force_colors.snapshot +++ b/test/fixtures/errors/force_colors.snapshot @@ -1,9 +1,9 @@ -*force_colors.js:1 -throw new Error('Should include grayed stack trace') +*force_colors.js:2 +throw new Error('Should include grayed stack trace'); ^ Error: Should include grayed stack trace - at Object. (/test*force_colors.js:1:7) + at Object. (/test*force_colors.js:2:7)  at *  at *  at * diff --git a/test/fixtures/errors/throw_in_eval_anonymous.js b/test/fixtures/errors/throw_in_eval_anonymous.js index aa9ab6a058..e325841f4b 100644 --- a/test/fixtures/errors/throw_in_eval_anonymous.js +++ b/test/fixtures/errors/throw_in_eval_anonymous.js @@ -6,4 +6,4 @@ eval(` throw new Error('error in anonymous script'); -`) +`); diff --git a/test/fixtures/errors/throw_in_eval_named.js b/test/fixtures/errors/throw_in_eval_named.js index 0d33fcf4d0..e04d8f7f29 100644 --- a/test/fixtures/errors/throw_in_eval_named.js +++ b/test/fixtures/errors/throw_in_eval_named.js @@ -6,4 +6,4 @@ eval(` throw new Error('error in named script'); -//# sourceURL=evalscript.js`) +//# sourceURL=evalscript.js`); diff --git a/test/fixtures/errors/throw_in_line_with_tabs.js b/test/fixtures/errors/throw_in_line_with_tabs.js index b62d422597..f38ebfbb32 100644 --- a/test/fixtures/errors/throw_in_line_with_tabs.js +++ b/test/fixtures/errors/throw_in_line_with_tabs.js @@ -19,7 +19,7 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -/* eslint-disable indent, no-tabs */ +/* eslint-disable @stylistic/js/indent, @stylistic/js/no-tabs */ 'use strict'; require('../../common');