From dc1485a9aa8a3faec2c12dac407c3de2f8dbff8c Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 31 Mar 2025 21:25:25 +0200 Subject: [PATCH 1/3] tools: enable linter in `test/fixtures/errors` --- eslint.config.mjs | 1 + test/fixtures/errors/force_colors.js | 3 ++- 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 | 8 ++++---- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 45ee3455226cab..82773a030849a0 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -53,6 +53,7 @@ export default [ // We want to lint only a few specific fixtures folders 'test/fixtures/*', '!test/fixtures/console', + '!test/fixtures/errors', '!test/fixtures/v8', '!test/fixtures/vm', ]), diff --git a/test/fixtures/errors/force_colors.js b/test/fixtures/errors/force_colors.js index 0f3c92c6f865a8..a19a78f0929f7f 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/throw_in_eval_anonymous.js b/test/fixtures/errors/throw_in_eval_anonymous.js index aa9ab6a05803bb..e325841f4becb8 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 0d33fcf4d05dd5..e04d8f7f29618e 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 b62d422597904a..6568b4611de991 100644 --- a/test/fixtures/errors/throw_in_line_with_tabs.js +++ b/test/fixtures/errors/throw_in_line_with_tabs.js @@ -19,16 +19,16 @@ // 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 */ + 'use strict'; require('../../common'); console.error('before'); (function() { - // These lines should contain tab! - // eslint-disable-next-line no-throw-literal - throw ({ foo: 'bar' }); + // These lines should contain tab! + // eslint-disable-next-line no-throw-literal + throw ({ foo: 'bar' }); })(); console.error('after'); From 1c91671d89527746f5e2fa09a43edeb24ef8f7b0 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 1 Apr 2025 13:38:35 +0200 Subject: [PATCH 2/3] fixup! tools: enable linter in `test/fixtures/errors` --- test/fixtures/errors/throw_in_line_with_tabs.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/fixtures/errors/throw_in_line_with_tabs.js b/test/fixtures/errors/throw_in_line_with_tabs.js index 6568b4611de991..f38ebfbb324209 100644 --- a/test/fixtures/errors/throw_in_line_with_tabs.js +++ b/test/fixtures/errors/throw_in_line_with_tabs.js @@ -19,16 +19,16 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. - +/* eslint-disable @stylistic/js/indent, @stylistic/js/no-tabs */ 'use strict'; require('../../common'); console.error('before'); (function() { - // These lines should contain tab! - // eslint-disable-next-line no-throw-literal - throw ({ foo: 'bar' }); + // These lines should contain tab! + // eslint-disable-next-line no-throw-literal + throw ({ foo: 'bar' }); })(); console.error('after'); From 60990d5a244fc06b4030e20db881b97e77db305e Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 2 Apr 2025 14:03:43 +0200 Subject: [PATCH 3/3] fixup! fixup! tools: enable linter in `test/fixtures/errors` --- test/fixtures/errors/force_colors.snapshot | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/fixtures/errors/force_colors.snapshot b/test/fixtures/errors/force_colors.snapshot index e5a03ca6094b4f..93ac005e833ce6 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 *