From 2fcc508441d0195112a7d2060f529bd0cd50e441 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 31 Mar 2025 21:26:02 +0200 Subject: [PATCH 1/4] tools: enable linter in `test/fixtures/eval` --- eslint.config.mjs | 1 + test/fixtures/eval/eval_typescript.js | 28 ++++++++--------- test/fixtures/eval/stdin_typescript.js | 42 +++++++++++++------------- 3 files changed, 36 insertions(+), 35 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 45ee3455226cab..17ea9909f26357 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/eval', '!test/fixtures/v8', '!test/fixtures/vm', ]), diff --git a/test/fixtures/eval/eval_typescript.js b/test/fixtures/eval/eval_typescript.js index 2c96b66f70dde1..9fd1f3315d4a19 100644 --- a/test/fixtures/eval/eval_typescript.js +++ b/test/fixtures/eval/eval_typescript.js @@ -5,21 +5,21 @@ require('../../common'); const spawnSync = require('child_process').spawnSync; const queue = [ - 'enum Foo{};', - 'throw new SyntaxError("hello")', - 'const foo;', - 'let x: number = 100;x;', - 'const foo: string = 10;', - 'function foo(){};foo(1);', - 'interface Foo{};const foo;', - 'function foo(){ await Promise.resolve(1)};', + 'enum Foo{};', + 'throw new SyntaxError("hello")', + 'const foo;', + 'let x: number = 100;x;', + 'const foo: string = 10;', + 'function foo(){};foo(1);', + 'interface Foo{};const foo;', + 'function foo(){ await Promise.resolve(1)};', ]; for (const cmd of queue) { - const args = ['--disable-warning=ExperimentalWarning', '-p', cmd]; - const result = spawnSync(process.execPath, args, { - stdio: 'pipe' - }); - process.stdout.write(result.stdout); - process.stdout.write(result.stderr); + const args = ['--disable-warning=ExperimentalWarning', '-p', cmd]; + const result = spawnSync(process.execPath, args, { + stdio: 'pipe', + }); + process.stdout.write(result.stdout); + process.stdout.write(result.stderr); } diff --git a/test/fixtures/eval/stdin_typescript.js b/test/fixtures/eval/stdin_typescript.js index d47c495f861fba..e1acaf8a6b391d 100644 --- a/test/fixtures/eval/stdin_typescript.js +++ b/test/fixtures/eval/stdin_typescript.js @@ -5,34 +5,34 @@ require('../../common'); const spawn = require('child_process').spawn; function run(cmd, strict, cb) { - const args = ['--disable-warning=ExperimentalWarning']; - if (strict) args.push('--use_strict'); - args.push('-p'); - const child = spawn(process.execPath, args); - child.stdout.pipe(process.stdout); - child.stderr.pipe(process.stdout); - child.stdin.end(cmd); - child.on('close', cb); + const args = ['--disable-warning=ExperimentalWarning']; + if (strict) args.push('--use_strict'); + args.push('-p'); + const child = spawn(process.execPath, args); + child.stdout.pipe(process.stdout); + child.stderr.pipe(process.stdout); + child.stdin.end(cmd); + child.on('close', cb); } const queue = [ - 'enum Foo{};', - 'throw new SyntaxError("hello")', - 'const foo;', - 'let x: number = 100;x;', - 'const foo: string = 10;', - 'function foo(){};foo(1);', - 'interface Foo{};const foo;', - 'function foo(){ await Promise.resolve(1)};', + 'enum Foo{};', + 'throw new SyntaxError("hello")', + 'const foo;', + 'let x: number = 100;x;', + 'const foo: string = 10;', + 'function foo(){};foo(1);', + 'interface Foo{};const foo;', + 'function foo(){ await Promise.resolve(1)};', ]; function go() { - const c = queue.shift(); - if (!c) return console.log('done'); - run(c, false, function () { - run(c, true, go); - }); + const c = queue.shift(); + if (!c) return console.log('done'); + run(c, false, function() { + run(c, true, go); + }); } go(); From f1aa94429702edcae9f41a2e77ee108ca1428232 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Fri, 4 Apr 2025 10:24:32 +0200 Subject: [PATCH 2/4] empty commit to test the new rule From 0e44e755fb472ca03ea41597bdc3323fc955209c Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Fri, 4 Apr 2025 10:35:28 +0200 Subject: [PATCH 3/4] code change --- eslint.config.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/eslint.config.mjs b/eslint.config.mjs index 17ea9909f26357..4db7114f5b2b21 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -67,6 +67,7 @@ export default [ // The default is `commonjs` but it's not supported by the Babel parser. sourceType: 'script', }, + // Code change }, { plugins: { From aab7fa9f27693d43d70ac1464de4dc70e70a0db0 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Fri, 4 Apr 2025 10:36:50 +0200 Subject: [PATCH 4/4] Revert "code change" This reverts commit 0e44e755fb472ca03ea41597bdc3323fc955209c. --- eslint.config.mjs | 1 - 1 file changed, 1 deletion(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 4db7114f5b2b21..17ea9909f26357 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -67,7 +67,6 @@ export default [ // The default is `commonjs` but it's not supported by the Babel parser. sourceType: 'script', }, - // Code change }, { plugins: {