Fix dumb noDebugger bug
MODIFY
packages/@romejs/js-compiler/__rtests__/__rsnapshots__/lint.ts.rsnap
packages/@romejs/js-compiler/__rtests__/__rsnapshots__/lint.ts.rsnap
"no cond assign": "Object {\n filters: Array []\n src: 'for (let i = 1; i = 10; i++) {\\n console.log(\\'foo\\')\\n }'\n diagnostics: Array [\n Object {\n category: 'lint/noCondAssign'\n filename: 'unknown'\n language: 'js'\n message: 'Cannot assign variable in loop condition'\n mtime: undefined\n sourceType: 'module'\n origins: Array [Object {category: 'lint'}]\n end: Object {\n column: 5\n index: 61\n line: 3\n }\n start: Object {\n column: 0\n index: 0\n line: 1\n }\n }\n ]\n}",
"disallow var": "Object {\n filters: Array []\n src: 'var foobar;\\nfoobar'\n diagnostics: Array [\n Object {\n category: 'lint/disallowVar'\n filename: 'unknown'\n language: 'js'\n message: 'Variable declarations using `var` are disallowed, use `let` or `const` instead.'\n mtime: undefined\n sourceType: 'module'\n origins: Array [Object {category: 'lint'}]\n end: Object {\n column: 11\n index: 11\n line: 1\n }\n start: Object {\n column: 0\n index: 0\n line: 1\n }\n }\n ]\n}",
"no cond assign: 1": "Object {\n filters: Array []\n src: 'if(foo = \\'bar\\') {\\n console.log(\\'foo\\')\\n }'\n diagnostics: Array [\n Object {\n category: 'lint/noCondAssign'\n filename: 'unknown'\n language: 'js'\n message: 'Cannot assign variable in loop condition'\n mtime: undefined\n sourceType: 'module'\n origins: Array [Object {category: 'lint'}]\n end: Object {\n column: 5\n index: 48\n line: 3\n }\n start: Object {\n column: 0\n index: 0\n line: 1\n }\n }\n ]\n}",
+ "no debugger": "Array [\n Object {\n category: 'lint/noDebugger'\n filename: 'unknown'\n fixable: true\n language: 'js'\n message: 'Unexpected \\'debugger\\' statement'\n mtime: undefined\n sourceType: 'module'\n origins: Array [Object {category: 'lint'}]\n end: Object {\n column: 9\n index: 9\n line: 1\n }\n start: Object {\n column: 0\n index: 0\n line: 1\n }\n }\n]",
"no cond assign: 2": "Object {\n filters: Array []\n src: 'while (foo = \\'bar\\' {\\n console.log(\\'foo\\')\\n }'\n diagnostics: Array [\n Object {\n category: 'parse/js'\n filename: 'unknown'\n message: 'Unclosed while test'\n mtime: undefined\n sourceType: 'module'\n origins: Array [Object {category: 'js-parser'}]\n end: Object {\n column: 6\n index: 6\n line: 1\n }\n start: Object {\n column: 6\n index: 6\n line: 1\n }\n advice: Array [\n log {\n category: 'info'\n message: 'We expected to find the closing character <emphasis>)</emphasis> here'\n }\n frame {\n filename: 'unknown'\n end: Object {\n column: 19\n index: 19\n line: 1\n }\n start: Object {\n column: 19\n index: 19\n line: 1\n }\n }\n ]\n }\n Object {\n category: 'lint/noCondAssign'\n filename: 'unknown'\n language: 'js'\n message: 'Cannot assign variable in loop condition'\n mtime: undefined\n sourceType: 'module'\n origins: Array [Object {category: 'lint'}]\n end: Object {\n column: 5\n index: 51\n line: 3\n }\n start: Object {\n column: 0\n index: 0\n line: 1\n }\n }\n ]\n}",
"no async promise executor": "Object {\n filters: Array []\n src: 'new Promise(async function foo() {})'\n diagnostics: Array [\n Object {\n category: 'lint/noAsyncPromiseExecutor'\n filename: 'unknown'\n language: 'js'\n message: 'Promise executor functions should not be async.'\n mtime: undefined\n sourceType: 'module'\n origins: Array [Object {category: 'lint'}]\n end: Object {\n column: 35\n index: 35\n line: 1\n }\n start: Object {\n column: 12\n index: 12\n line: 1\n }\n }\n ]\n}",
"no cond assign: 3": "Object {\n filters: Array []\n src: 'do {\\n console.log(\\'foo)\\n } while (foo = \\'bar\\')'\n diagnostics: Array [\n Object {\n advice: undefined\n category: 'parse/js'\n filename: 'unknown'\n message: 'Unterminated string constant'\n mtime: undefined\n sourceType: 'module'\n origins: Array [Object {category: 'js-parser'}]\n end: Object {\n column: 0\n index: 28\n line: 3\n }\n start: Object {\n column: 0\n index: 28\n line: 3\n }\n }\n Object {\n category: 'lint/undeclaredVariables'\n filename: 'unknown'\n language: 'js'\n message: 'Undeclared variable <emphasis>INVALID_PLACEHOLDER</emphasis>'\n mtime: undefined\n sourceType: 'module'\n origins: Array [Object {category: 'lint'}]\n end: Object {\n column: 50\n index: 55\n line: 2\n }\n start: Object {\n column: 50\n index: 55\n line: 2\n }\n }\n Object {\n category: 'lint/undeclaredVariables'\n filename: 'unknown'\n language: 'js'\n message: 'Undeclared variable <emphasis>bar</emphasis>'\n mtime: undefined\n sourceType: 'module'\n origins: Array [Object {category: 'lint'}]\n end: Object {\n column: 47\n index: 52\n line: 2\n }\n start: Object {\n column: 44\n index: 49\n line: 2\n }\n }\n ]\n}",

MODIFY
packages/@romejs/js-compiler/transforms/lint/noDebugger.ts
packages/@romejs/js-compiler/transforms/lint/noDebugger.ts
@@ -19,8 +19,10 @@ export default {
category: 'lint/noDebugger',
message: "Unexpected 'debugger' statement",
});
- }
return REDUCE_REMOVE;
+ }
+
+ return node;
},
};

Fix dumb noDebugger bug