Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/origin-1/eslint-plugin-eslint-env
An ESLint plugin to lint files with eslint-env comments using the flat config.
https://github.com/origin-1/eslint-plugin-eslint-env
Last synced: about 16 hours ago
JSON representation
An ESLint plugin to lint files with eslint-env comments using the flat config.
- Host: GitHub
- URL: https://github.com/origin-1/eslint-plugin-eslint-env
- Owner: origin-1
- License: isc
- Created: 2023-03-14T12:00:20.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-12T16:01:14.000Z (13 days ago)
- Last Synced: 2025-01-12T16:11:12.804Z (13 days ago)
- Language: JavaScript
- Homepage:
- Size: 46.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# eslint-plugin-eslint-env · [![npm version][npm badge]][npm url]
An ESLint plugin to lint files with [`eslint-env`](https://eslint.org/docs/latest/use/configure/language-options#using-configuration-comments) comments using the flat config.
## Prerequisites
ESLint 8.21 or later is required.
## Installation
```console
npm i -D eslint-plugin-eslint-env
```## Usage
In your `eslint.config.js` file, create a new `EslintEnvProcessor` and add it to your configuration.
```diff
+ import { EslintEnvProcessor } from 'eslint-plugin-eslint-env';export default
[
{
files: ['**/*.js'],
+ processor: new EslintEnvProcessor(),
},
];
```To support plugin-defined environments in `eslint-env` comments (e.g. `/* eslint-env cypress/globals */`, `/* eslint-env react-native/react-native */`, etc.), add a `plugins` setting both to the configuration and to the `EslintEnvProcessor` constructor options.
```diff
import { EslintEnvProcessor } from 'eslint-plugin-eslint-env';
+ import eslintPluginCypress from 'eslint-plugin-cypress';+ const plugins = { 'cypress': eslintPluginCypress };
export default
[
{
files: ['**/*.js'],
+ plugins,
+ processor: new EslintEnvProcessor({ plugins }),
},
];
```[npm badge]: https://img.shields.io/npm/v/eslint-plugin-eslint-env?logo=npm
[npm url]: https://www.npmjs.com/package/eslint-plugin-eslint-env