explaingit

joshuakgoldberg/eslint-plugin-erasable-syntax-only

Analysis updated 2026-07-05 · repo last pushed 2026-07-01

51TypeScriptAudience · developerComplexity · 2/5ActiveSetup · easy

TLDR

An ESLint plugin that flags TypeScript features incompatible with Node.js direct execution, like enums and namespaces, so teams can gradually migrate to running TypeScript without a build step.

Mindmap

mindmap
  root((repo))
    What it does
      Flags non-erasable TS
      Four separate rules
      Auto-fixes some issues
    Tech stack
      TypeScript
      ESLint
      Node.js
    Use cases
      Migrate to Node TS
      Gradual code cleanup
      Enforce erasable syntax
    Audience
      TS codebase teams
      Migration projects
    Setup
      ESLint 9 required
      Node 20.18 minimum
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Gradually migrate an existing TypeScript project to run directly in Node.js without a build step.

USE CASE 2

Identify and remove enums, namespaces, and other non-erasable TypeScript patterns one rule at a time.

USE CASE 3

Enforce erasable-syntax-only rules on specific files while excluding others during migration.

What is it built with?

TypeScriptESLintNode.js

How does it compare?

joshuakgoldberg/eslint-plugin-erasable-syntax-onlyalexvilelabah/bah-browserrosekhlifa/image-studio
Stars515150
LanguageTypeScriptTypeScriptTypeScript
Last pushed2026-07-01
MaintenanceActive
Setup difficultyeasyeasyeasy
Complexity2/52/53/5
Audiencedevelopervibe coderdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Requires ESLint version 9 or higher and Node.js 20.18.0 or newer.

This project's license is not specified in the explanation, so its usage terms are unknown.

In plain English

Node.js recently added the ability to run TypeScript files directly, without a separate compilation step. But there's a catch: Node can only handle "erasable" TypeScript code, meaning features that can be simply stripped away to leave plain JavaScript. Some TypeScript features, like enums, namespaces, and certain class parameter shortcuts, don't work this way and will cause errors. This ESLint plugin helps teams catch those problematic patterns in their code before they become a problem. The tool works as an add-on for ESLint, a popular code-checking utility. Once installed, it flags four specific TypeScript features that aren't erasable: enums, import aliases, namespaces, and class parameter properties. Some of these issues can even be auto-fixed by your editor. The plugin gives you four separate rules you can turn on individually rather than forcing an all-or-nothing switch. This is primarily for teams with an existing TypeScript codebase who want to migrate toward running their code directly through Node.js without a build step. If your project is large and uses enums or namespaces throughout, you can't just flip a switch, you'd have hundreds of errors at once. This plugin lets you tackle one rule at a time, exclude certain files temporarily, and add inline comments to suppress specific warnings where needed. It turns an overwhelming migration into a gradual cleanup. Notably, if you've already enabled TypeScript's own --erasableSyntaxOnly compiler flag, you don't need this plugin at all. The value here is the flexibility: TypeScript's flag is project-wide, while this plugin lets you be surgical about which rules apply where. The project requires ESLint version 9 or higher and Node.js 20.18.0 or newer.

Copy-paste prompts

Prompt 1
Help me set up eslint-plugin-erasable-syntax-only in my ESLint config. I want to enable all four rules but exclude my test files for now.
Prompt 2
I'm getting ESLint errors from the erasable-syntax-only plugin about enums in my code. Show me how to replace a TypeScript enum with a plain object or union type so it works with Node.js direct execution.
Prompt 3
Generate an ESLint config that turns on only the no-enums rule from eslint-plugin-erasable-syntax-only, and add inline disable comments for the three files that still use enums heavily.

Frequently asked questions

What is eslint-plugin-erasable-syntax-only?

An ESLint plugin that flags TypeScript features incompatible with Node.js direct execution, like enums and namespaces, so teams can gradually migrate to running TypeScript without a build step.

What language is eslint-plugin-erasable-syntax-only written in?

Mainly TypeScript. The stack also includes TypeScript, ESLint, Node.js.

Is eslint-plugin-erasable-syntax-only actively maintained?

Active — commit in last 30 days (last push 2026-07-01).

What license does eslint-plugin-erasable-syntax-only use?

This project's license is not specified in the explanation, so its usage terms are unknown.

How hard is eslint-plugin-erasable-syntax-only to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is eslint-plugin-erasable-syntax-only for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub joshuakgoldberg on gitmyhub

Verify against the repo before relying on details.