Skip to content

Latest commit

 

History

History
51 lines (38 loc) · 1.9 KB

README.md

File metadata and controls

51 lines (38 loc) · 1.9 KB

eslint-plugin-runtime-compat

GitHub npm version npm version

Lint JavaScript runtime compat issues before deployment!

 

Features:

  • Track compat issues across multiple imports and packages
  • Configure range of providers according to runtime-compat
  • Detect incompatible class instantiations
  • Detect incompatible class property access
  • Disable rules
  • Detect incompatible event listeners
  • Detect compat issues hidden within packages

Note: Project is in alpha. API may change

Setup

The linter config should target the server bundle, not client.

  1. Install
npm install @menglinmaker/eslint-plugin-runtime-compat
  1. Add eslint.config.mjs to root. This detects incompatible APIs for all runtimes in the dataset.
import runtimeCompat from '@menglinmaker/eslint-plugin-runtime-compat'
import tseslint from 'typescript-eslint'

export default [...tseslint.configs.recommended, ...runtimeCompat.configs.strict]

Alternatively, you can load a custom config:

runtimeCompat.configs.custom(['node', 'bun', 'deno'])

Limitations:

  • Cannot detect when globals are overridden

Attibution