{"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,"search_vec":"'/react-native':59 '0.6.0':27 '8.21':30 'allow':36 'comment':20,47,66 'config':25,71,82 'cypress/globals':54 'defin':51 'develop':37 'differenti':61 'env':5,19,46,65 'environ':40,52 'eslint':2,4,7,18,23,29,45,64,79,84,86 'eslint-env':17,44,63 'eslint-plugin':85 'eslint-plugin-eslint-env':1 'eslintplugin':88 'file':15,42 'flat':24,70,81 'function':67 'includ':48 'integr':62 'javascript':83 'key':60 'like':53 'lint':14 'nativ':58,76 'per':41 'plugin':3,8,50,87 'plugin-defin':49 'processor':12 'provid':10 'react':57 'react-nat':56 'requir':28 'ship':32 'specifi':39 'support':77 'system':72 'type':34 'typescript':33,89 'use':16 'version':26 'via':43","created_at":"2026-05-01T13:45:07.683139+00:00","updated_at":"2026-05-01T13:45:07.683139+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/origin-1/eslint-plugin-eslint-env","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/eslint-plugin-eslint-env","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}