logoESLint React

ts-blank-eslint-parser

Using ts-blank-eslint-parser as an alternative parser for TypeScript projects

The ts-blank-eslint-parser is a work in progress and comes with limitations:

  • No support for TypeScript syntax that need transformation like enums, namespaces, decorators
  • No support for rules that require type information
  • No fixable support for types (the types will also be stripped out in the fix output)

Use it only if you are okay with the limitations.

Install

npm install --save-dev eslint @eslint/js globals ts-blank-eslint-parser @eslint-react/eslint-plugin@next

Setup

eslint.config.js
// @ts-check
import eslintJs from "@eslint/js";
import eslintReact from "@eslint-react/eslint-plugin";
import tsBlankEslintParser from "ts-blank-eslint-parser";
import globals from "globals";
 
const GLOB_TS = ["**/*.ts", "**/*.tsx"];
 
export default [
  // base configuration for browser environment source files
  {
    files: GLOB_TS,
    languageOptions: {
      globals: {
        ...globals.browser,
      },
      parser: tsBlankEslintParser,
    },
    rules: {
      ...eslintJs.configs.recommended.rules,
    },
  },
  // React configuration
  {
    files: GLOB_TS,
    ...eslintReact.configs["recommended-typescript"],
  },
];

On this page