eslint-plugin-edge

0.0.2 • Public • Published

ESLint Plugin Edge

This eslint environment will help ensure you have the environment set correctly for edge / browser development.

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install eslint-plugin-edge:

npm install eslint-plugin-edge --save-dev

Usage

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

{
  "plugins": ["edge"]
}

Add the environment to your eslint config:

{
  "env": {
    "eslint-plugin-edge/edge-and-browser": true, // If your code is for both edge and browser
    "eslint-plugin-edge/edge": true // If your code is for edge only (has more features)
  }
}

Next.js

If your code is running on next.js, the edge has one extra polyfill for AsyncLocalStorage.

To add it, add the following global to your eslint config:

{
  "globals": {
    "AsyncLocalStorage": "readonly"
  }
}

Package Sidebar

Install

npm i eslint-plugin-edge

Weekly Downloads

133

Version

0.0.2

License

ISC

Unpacked Size

7.7 kB

Total Files

3

Last publish

Collaborators

  • jacob-roberts