0.0.2 • Published 2 years ago
eslint-plugin-edge v0.0.2
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-devNext, install eslint-plugin-edge:
npm install eslint-plugin-edge --save-devUsage
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"
}
}