# eslint-plugin-ts-compat

> Check browser compat base on TypeScript.

Latest version **1.0.0** (published 2026-11-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install eslint-plugin-ts-compat
pnpm add eslint-plugin-ts-compat
yarn add eslint-plugin-ts-compat
bun add eslint-plugin-ts-compat
```

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2026-11-19 |
| First published | 2024-01-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | ^14.17.0 \|\| ^16.0.0 \|\| >= 18.0.0 |
| Dependencies | 4 |
| Unpacked size | 106.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | linsk |
| Maintainers | linsk |
| Keywords | eslint, compat, regexp, browserslist |

## Links

- npm: https://www.npmjs.com/package/eslint-plugin-ts-compat
- Repository: https://github.com/linsk1998/eslint-plugin-ts-compat
- Homepage: https://github.com/linsk1998/eslint-plugin-ts-compat#readme
- Issues: https://github.com/linsk1998/eslint-plugin-ts-compat/issues
- npm.io page: https://npm.io/package/eslint-plugin-ts-compat

## Dependencies (4)

- [tsutils](https://npm.io/package/tsutils.md) ^3.21.0
- [browserslist](https://npm.io/package/browserslist.md) ^4.22.2
- [requireindex](https://npm.io/package/requireindex.md) ^1.2.0
- [ts-api-utils](https://npm.io/package/ts-api-utils.md) ^1.0.3

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@pandacss/eslint-plugin](https://npm.io/package/@pandacss/eslint-plugin.md) — 18.7K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2026-11-19
- 0.15.0 — 2025-03-01
- 0.14.0 — 2024-12-01
- 0.13.0 — 2024-11-24
- 0.12.0 — 2024-07-05
- 0.11.0 — 2024-05-01
- 0.10.0 — 2024-02-14
- 0.6.0 — 2024-02-06
- 0.5.0 — 2024-01-18
- 0.4.1 — 2024-01-17
- 0.4.0 — 2024-01-16
- 0.3.0 — 2024-01-15
- 0.2.0 — 2024-01-14
- 0.1.0 — 2024-01-12
- 0.0.0 — 2024-01-11

## README

# eslint-plugin-ts-compat

[![npm version](https://img.shields.io/npm/v/eslint-plugin-ts-compat.svg)](https://www.npmjs.com/package/eslint-plugin-ts-compat)
[![Build Status](https://github.com/linsk1998/eslint-plugin-ts-compat/workflows/CI/badge.svg)](https://github.com/linsk1998/eslint-plugin-ts-compat/actions)
[![License](https://img.shields.io/npm/l/eslint-plugin-ts-compat.svg)](https://github.com/linsk1998/eslint-plugin-ts-compat/blob/main/LICENSE)

This is a eslint-plugin to check browser compat base on TypeScript.

* You can ban some code even Babel and Polyfills could not solve.
* Use Typescript for type check.

## Installation

You'll first need to install [ESLint](https://eslint.org/):

```sh
npm i eslint --save-dev
```

Next, install `eslint-plugin-ts-compat`:

```sh
npm install eslint-plugin-ts-compat --save-dev
```

## Usage

Add `ts-compat` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:

```json
{
    "plugins": ["ts-compat"],
    "parser": "@typescript-eslint/parser",
}
```


Then configure the rules you want to use under the rules section.

```json
{
    "rules": {
        "ts-compat/no-regexp-flags": 2
    }
}
```

This plugin exports a recommended config that enforces good practices.

```json
{
    "extends": [
        "plugin:ts-compat/recommended"
    ]
}
```

Support a [browserslist](https://www.npmjs.com/package/browserslist) configuration to preset rules.

```json
{
    "extends": [
        "plugin:ts-compat/browserslist"
    ]
}
```

## Rules

<!-- begin auto-generated rules list -->

💼 Configurations enabled in.\
✅ Set in the `recommended` configuration.\
🔧 Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).

| Name                                                                                       | Description                                                         | 💼 | 🔧 |
| :----------------------------------------------------------------------------------------- | :------------------------------------------------------------------ | :- | :- |
| [no-array-index](docs/rules/no-array-index.md)                                             | Disable array index                                                 |    | 🔧 |
| [no-atomics](docs/rules/no-atomics.md)                                                     | Disable Atomics object.                                             | ✅  |    |
| [no-bigint](docs/rules/no-bigint.md)                                                       | Disable BigInt.                                                     | ✅  |    |
| [no-binary](docs/rules/no-binary.md)                                                       | Disable binary data APIs.                                           | ✅  |    |
| [no-class-list](docs/rules/no-class-list.md)                                               | Disable classList                                                   | ✅  |    |
| [no-date-parse](docs/rules/no-date-parse.md)                                               | Not allow parse date string.                                        | ✅  |    |
| [no-document-current-script](docs/rules/no-document-current-script.md)                     | Disable document.currentScript.                                     | ✅  |    |
| [no-event-listener](docs/rules/no-event-listener.md)                                       | Disable standard event                                              | ✅  |    |
| [no-event-timestamp](docs/rules/no-event-timestamp.md)                                     | Disable Event.prototype.timeStamp                                   |    |    |
| [no-function-length](docs/rules/no-function-length.md)                                     | Disable Function.prototype.length                                   | ✅  |    |
| [no-function-name](docs/rules/no-function-name.md)                                         | Disable Function.prototype.name                                     | ✅  |    |
| [no-map-iterator](docs/rules/no-map-iterator.md)                                           | Disable the Map iterator APIs.                                      |    |    |
| [no-proxy](docs/rules/no-proxy.md)                                                         | Disable Proxy object.                                               | ✅  |    |
| [no-reflect](docs/rules/no-reflect.md)                                                     | Disable Reflect object.                                             | ✅  |    |
| [no-regexp-flags](docs/rules/no-regexp-flags.md)                                           | Disable RegExp.prototype.flags                                      | ✅  |    |
| [no-regexp-sticky](docs/rules/no-regexp-sticky.md)                                         | Disable regexp sticky                                               | ✅  |    |
| [no-regexp-unicode](docs/rules/no-regexp-unicode.md)                                       | Disable JavaScript built-in: RegExp: unicode                        | ✅  |    |
| [no-regexp-unicode-sets](docs/rules/no-regexp-unicode-sets.md)                             | Disable JavaScript built-in: RegExp: unicodeSet                     | ✅  |    |
| [no-set-iterator](docs/rules/no-set-iterator.md)                                           | Disable the Set iterator APIs.                                      |    |    |
| [no-string-htmlify-methods](docs/rules/no-string-htmlify-methods.md)                       | Disable the String HTML methods                                     | ✅  |    |
| [no-string-index](docs/rules/no-string-index.md)                                           | Disable string index                                                | ✅  | 🔧 |
| [no-string-normalize](docs/rules/no-string-normalize.md)                                   | Disable String.prototype.normalize                                  | ✅  |    |
| [no-symbol](docs/rules/no-symbol.md)                                                       | Disable Symbol and symbol keyed properties.                         | ✅  |    |
| [no-symbol-description](docs/rules/no-symbol-description.md)                               | Disable Symbol.prototype.description                                | ✅  |    |
| [no-timer-args-exceed](docs/rules/no-timer-args-exceed.md)                                 | Not allow using the third argument of `setTimeout` & `setInterval`. |    |    |
| [no-top-level-await](docs/rules/no-top-level-await.md)                                     | Disable Top-Level await.                                            |    |    |
| [no-weakrefs](docs/rules/no-weakrefs.md)                                                   | Disable WeakRef and FinalizationRegistry.                           | ✅  |    |
| [prefer-anonymous-function-expression](docs/rules/prefer-anonymous-function-expression.md) | Prefer anonymous function expression.                               | ✅  | 🔧 |
| [prefer-enum-plain-object](docs/rules/prefer-enum-plain-object.md)                         | Only allow enumeration on plain object.                             | ✅  |    |
| [prefer-immuable-url](docs/rules/prefer-immuable-url.md)                                   | Prefer immuable url                                                 | ✅  |    |
| [prefer-inner-text](docs/rules/prefer-inner-text.md)                                       | Prefer .innerText                                                   | ✅  | 🔧 |
| [prefer-sealed-class](docs/rules/prefer-sealed-class.md)                                   | Prefer sealed class                                                 |    |    |
| [prefer-url-href](docs/rules/prefer-url-href.md)                                           | Prefer url href.                                                    | ✅  | 🔧 |

<!-- end auto-generated rules list -->

---
_Source: https://npm.io/package/eslint-plugin-ts-compat · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
