Skip to content

Commit 1788223

Browse files
committed
tools: enable linter in test/fixtures/eval
PR-URL: #57699 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 366fe93 commit 1788223

File tree

3 files changed

+36
-35
lines changed

3 files changed

+36
-35
lines changed

eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export default [
5353
// We want to lint only a few specific fixtures folders
5454
'test/fixtures/*',
5555
'!test/fixtures/console',
56+
'!test/fixtures/eval',
5657
'!test/fixtures/v8',
5758
'!test/fixtures/vm',
5859
]),

test/fixtures/eval/eval_typescript.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ require('../../common');
55
const spawnSync = require('child_process').spawnSync;
66

77
const queue = [
8-
'enum Foo{};',
9-
'throw new SyntaxError("hello")',
10-
'const foo;',
11-
'let x: number = 100;x;',
12-
'const foo: string = 10;',
13-
'function foo(){};foo<Number>(1);',
14-
'interface Foo{};const foo;',
15-
'function foo(){ await Promise.resolve(1)};',
8+
'enum Foo{};',
9+
'throw new SyntaxError("hello")',
10+
'const foo;',
11+
'let x: number = 100;x;',
12+
'const foo: string = 10;',
13+
'function foo(){};foo<Number>(1);',
14+
'interface Foo{};const foo;',
15+
'function foo(){ await Promise.resolve(1)};',
1616
];
1717

1818
for (const cmd of queue) {
19-
const args = ['--disable-warning=ExperimentalWarning','--experimental-strip-types', '-p', cmd];
20-
const result = spawnSync(process.execPath, args, {
21-
stdio: 'pipe'
22-
});
23-
process.stdout.write(result.stdout);
24-
process.stdout.write(result.stderr);
19+
const args = ['--disable-warning=ExperimentalWarning', '--experimental-strip-types', '-p', cmd];
20+
const result = spawnSync(process.execPath, args, {
21+
stdio: 'pipe',
22+
});
23+
process.stdout.write(result.stdout);
24+
process.stdout.write(result.stderr);
2525
}

test/fixtures/eval/stdin_typescript.js

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,34 @@ require('../../common');
55
const spawn = require('child_process').spawn;
66

77
function run(cmd, strict, cb) {
8-
const args = ['--disable-warning=ExperimentalWarning', '--experimental-strip-types'];
9-
if (strict) args.push('--use_strict');
10-
args.push('-p');
11-
const child = spawn(process.execPath, args);
12-
child.stdout.pipe(process.stdout);
13-
child.stderr.pipe(process.stdout);
14-
child.stdin.end(cmd);
15-
child.on('close', cb);
8+
const args = ['--disable-warning=ExperimentalWarning', '--experimental-strip-types'];
9+
if (strict) args.push('--use_strict');
10+
args.push('-p');
11+
const child = spawn(process.execPath, args);
12+
child.stdout.pipe(process.stdout);
13+
child.stderr.pipe(process.stdout);
14+
child.stdin.end(cmd);
15+
child.on('close', cb);
1616
}
1717

1818
const queue =
1919
[
20-
'enum Foo{};',
21-
'throw new SyntaxError("hello")',
22-
'const foo;',
23-
'let x: number = 100;x;',
24-
'const foo: string = 10;',
25-
'function foo(){};foo<Number>(1);',
26-
'interface Foo{};const foo;',
27-
'function foo(){ await Promise.resolve(1)};',
20+
'enum Foo{};',
21+
'throw new SyntaxError("hello")',
22+
'const foo;',
23+
'let x: number = 100;x;',
24+
'const foo: string = 10;',
25+
'function foo(){};foo<Number>(1);',
26+
'interface Foo{};const foo;',
27+
'function foo(){ await Promise.resolve(1)};',
2828
];
2929

3030
function go() {
31-
const c = queue.shift();
32-
if (!c) return console.log('done');
33-
run(c, false, function () {
34-
run(c, true, go);
35-
});
31+
const c = queue.shift();
32+
if (!c) return console.log('done');
33+
run(c, false, function() {
34+
run(c, true, go);
35+
});
3636
}
3737

3838
go();

0 commit comments

Comments
 (0)