Registry / testing / eslint-plugin-eslint-env

eslint-plugin-eslint-env

JSON →
library0.6.0jsnpmunverified

An ESLint plugin that provides a processor to lint files using eslint-env comments in an ESLint flat config. Version 0.6.0 requires ESLint >=8.21 and ships TypeScript types. It allows developers to specify environments per file via /* eslint-env */ comments, including plugin-defined environments like cypress/globals or react-native/react-native. Key differentiator: integrates eslint-env comment functionality into the flat config system, which is not natively supported by ESLint's flat config.

testing
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Default export is not available; must use a named import. ESM-only package.

import { EslintEnvProcessor } from 'eslint-plugin-eslint-env';

CommonJS destructuring is needed; the package does not export a function directly.

const { EslintEnvProcessor } = require('eslint-plugin-eslint-env');

For legacy eslintrc configs, import default as a plugin object. For flat config, use the named EslintEnvProcessor.

import plugin from 'eslint-plugin-eslint-env';

Shows how to use the EslintEnvProcessor in an ESLint flat config file (eslint.config.js with ESM imports).

import { EslintEnvProcessor } from 'eslint-plugin-eslint-env'; export default [ { files: ['**/*.js'], processor: new EslintEnvProcessor(), }, ];
Debug
Known footguns
breakingFlat config required: This plugin only works with ESLint's flat config system (eslint.config.js). Do not use with legacy .eslintrc files.
gotchaThe EslintEnvProcessor must be instantiated (new EslintEnvProcessor()) and passed as the processor option; using the string 'EslintEnvProcessor' will not work.
gotchaPlugin-defined environments require passing plugins into the processor constructor's options object. Simply adding plugins to the config is not enough.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
10 hits · last 30 days
claudebot
4
gptbot
3
ahrefsbot
3
Resources