0.0.1 • Published 11 months ago

@menglinmaker/eslint-plugin-runtime-compat v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

Note: This ESLint plugin is still under development. Please submit a issue or PR if you have any suggestions and changes.

 

Setup

  1. Install
npm install @menglinmaker/eslint-plugin-runtime-compat
  1. Add ESLint config
import runtimeCompat from "@menglinmaker/eslint-runtime-compat";

export default [runtimeCompat.configs.strict];

Alternatively, you can load a custom config:

export default [runtimeCompat.configs.custom(['node', 'bun', 'deno'], {
  deprecated: true,
  experimental: true,
})];

 

Contributing

Prerequisite - must have pnpm installed. All git-hooks for formatting will be automatically installed and configured.

  1. Clone repo
  2. Build dist before linting - pnpm run build
  3. Contribute to some files
  4. Create a pull request changeset - pnpm changeset
  5. Approved PRs that passes CI will be released to npm

 

Problem statement

What problem does this solve?

The feedback cycle for detecting and fixing runtime compatability issues is too large:

Solution

Lint compatability issues before deployment using pre-collected runtime-compat-data.

An alternative approach is to use remocal testing. However, this does require a more complex setup with more test code to maintain.

Limitations:

  • Does not lint across multiple files since ESLint only analyses each file in isolation.
  • Cannot detect overiding of APIs - variables cannot be tracked across files due to ESLint's design.

Todo:

  • Track variable reassignments within a file.
  • Detect incompatability issues from instance methods and properties.
  • Disable rules due to polyfills.
0.0.1

11 months ago

0.0.0

12 months ago