{"id":25508,"library":"eslint-plugin-eslint-env","title":"eslint-plugin-eslint-env","description":"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.","status":"active","version":"0.6.0","language":"javascript","source_language":"en","source_url":"https://github.com/origin-1/eslint-plugin-eslint-env","tags":["javascript","eslint","eslint-plugin","eslintplugin","typescript"],"install":[{"cmd":"npm install eslint-plugin-eslint-env","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-eslint-env","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-eslint-env","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required for ESLint configuration handling","package":"@eslint/eslintrc","optional":true},{"reason":"peer dependency required for TypeScript type definitions","package":"@types/eslint","optional":true},{"reason":"peer dependency: required version >=8.21","package":"eslint","optional":false}],"imports":[{"note":"Default export is not available; must use a named import. ESM-only package.","wrong":"import EslintEnvProcessor from 'eslint-plugin-eslint-env';","symbol":"EslintEnvProcessor","correct":"import { EslintEnvProcessor } from 'eslint-plugin-eslint-env';"},{"note":"CommonJS destructuring is needed; the package does not export a function directly.","wrong":"const EslintEnvProcessor = require('eslint-plugin-eslint-env');","symbol":"require/CommonJS","correct":"const { EslintEnvProcessor } = require('eslint-plugin-eslint-env');"},{"note":"For legacy eslintrc configs, import default as a plugin object. For flat config, use the named EslintEnvProcessor.","wrong":"import { plugin } from 'eslint-plugin-eslint-env';","symbol":"Plugin object use (legacy config)","correct":"import plugin from 'eslint-plugin-eslint-env';"}],"quickstart":{"code":"import { EslintEnvProcessor } from 'eslint-plugin-eslint-env';\n\nexport default [\n  {\n    files: ['**/*.js'],\n    processor: new EslintEnvProcessor(),\n  },\n];","lang":"typescript","description":"Shows how to use the EslintEnvProcessor in an ESLint flat config file (eslint.config.js with ESM imports)."},"warnings":[{"fix":"Switch to flat config by using eslint.config.js and ensure ESLint version >=8.21.","message":"Flat config required: This plugin only works with ESLint's flat config system (eslint.config.js). Do not use with legacy .eslintrc files.","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Use processor: new EslintEnvProcessor() in your config object.","message":"The EslintEnvProcessor must be instantiated (new EslintEnvProcessor()) and passed as the processor option; using the string 'EslintEnvProcessor' will not work.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Pass plugins to the processor: new EslintEnvProcessor({ plugins: { 'cypress': eslintPluginCypress } }).","message":"Plugin-defined environments require passing plugins into the processor constructor's options object. Simply adding plugins to the config is not enough.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run npm install -D eslint-plugin-eslint-env and ensure node_modules is present.","cause":"The package is not installed or is installed as a dev dependency but not resolved correctly.","error":"Error: Failed to load plugin 'eslint-plugin-eslint-env' declared in 'eslint.config.js': Cannot find module 'eslint-plugin-eslint-env'"},{"fix":"Ensure you use import { EslintEnvProcessor } from 'eslint-plugin-eslint-env' and instantiate: new EslintEnvProcessor().","cause":"Using EslintEnvProcessor without the 'new' keyword or wrong import (e.g., default import instead of named).","error":"TypeError: (intermediate value) is not a constructor"},{"fix":"Verify your eslint.config.js exports an array with an object containing 'files' and 'processor' properties.","cause":"Missing or incorrectly structured flat config; processor not applied correctly.","error":"Error: Configuration for rule 'undefined' is not found"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}