Add autofix to noDebugger rule
MODIFY
packages/@romejs/js-compiler/transforms/lint/noDebugger.ts
packages/@romejs/js-compiler/transforms/lint/noDebugger.ts
* LICENSE file in the root directory of this source tree.
*/
-import {AnyNode} from '@romejs/js-ast';
-import {Path} from '@romejs/js-compiler';
+import {Path, TransformExitResult} from '@romejs/js-compiler';
+import {REDUCE_REMOVE} from '@romejs/js-compiler';
export default {
name: 'noDebugger',
- enter(path: Path): AnyNode {
+ enter(path: Path): TransformExitResult {
const {node} = path;
if (node.type === 'DebuggerStatement') {
path.context.addNodeDiagnostic(node, {
+ fixable: true,
category: 'lint/noDebugger',
message: "Unexpected 'debugger' statement",
});
}
- return node;
+ return REDUCE_REMOVE;
},
};

Add autofix to noDebugger rule