{"id":19740,"library":"eslint-plugin-es-x","title":"eslint-plugin-es-x","description":"ESLint plugin that disallows individual ECMAScript syntactic features from ES3 to upcoming proposals. Version 9.6.0 requires ESLint >=9.29.0 and Node.js ^20.19.0 || >=22.12.0. Actively maintained by eslint-community as a fork of the deprecated eslint-plugin-es. Provides 128+ granular rules to restrict specific syntax (e.g., BigInt, optional chaining, top-level await) with readable error messages. Ships TypeScript type declarations, flat config support, and predefined configs like 'no-new-in-es2023'. Unlike setting ecmaVersion in Espree, this plugin allows selective feature bans and gives clear feedback for restricted syntax.","status":"active","version":"9.6.0","language":"javascript","source_language":"en","source_url":"https://github.com/eslint-community/eslint-plugin-es-x","tags":["javascript","eslint","plugin","eslintplugin","typescript"],"install":[{"cmd":"npm install eslint-plugin-es-x","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-es-x","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-es-x","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency: plugin requires ESLint >=9.29.0 (flat config only).","package":"eslint","optional":false}],"imports":[{"note":"Plugin is ESM-only since v9.0.0; CommonJS require() throws ERR_REQUIRE_ESM.","wrong":"const plugin = require('eslint-plugin-es-x')","symbol":"plugin","correct":"import plugin from 'eslint-plugin-es-x'"},{"note":"Named export for configs like configs['no-new-in-es2023'].","symbol":"configs","correct":"import { configs } from 'eslint-plugin-es-x'"},{"note":"Individual rules are not exported; access via rules object, e.g., rules['es-x/no-bigint'].","wrong":"import { noBigInt } from 'eslint-plugin-es-x'","symbol":"rules","correct":"import { rules } from 'eslint-plugin-es-x'"}],"quickstart":{"code":"import plugin from 'eslint-plugin-es-x';\n\nexport default [\n  {\n    plugins: {\n      'es-x': plugin\n    },\n    rules: {\n      'es-x/no-bigint': 'error',\n      'es-x/no-optional-chaining': 'error'\n    }\n  }\n];","lang":"typescript","description":"Sets up eslint-plugin-es-x with flat config in an ESM project, forbidding BigInt and optional chaining."},"warnings":[{"fix":"Upgrade ESLint to >=9.29.0 and Node.js to ^20.19.0 || >=22.12.0.","message":"v9.0.0 drops support for ESLint <9.29.0 and Node.js <20.19.0.","severity":"breaking","affected_versions":">=8.0.0 <9.0.0"},{"fix":"Review updated configs and adjust rule overrides.","message":"v9.0.0 changes 'no-new-in-es2020' and 'restrict-to-es3' through 'restrict-to-es2019' configs – rules may be added or removed.","severity":"breaking","affected_versions":">=8.0.0 <9.0.0"},{"fix":"Migrate to flat config format.","message":"Legacy .eslintrc configs are deprecated; use flat config (eslint.config.js) for ESLint >=9.","severity":"deprecated","affected_versions":">=9.0.0"},{"fix":"Use rule names like 'es-x/no-arrow-functions'.","message":"Plugin rules are prefixed with 'es-x/', not 'esx/' or 'es2015/'.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Access configs via plugin.configs object.","message":"Config names are under 'configs' export, not directly on plugin – e.g., plugin.configs['no-new-in-es2023'].","severity":"gotcha","affected_versions":">=9.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run: npm install eslint-plugin-es-x --save-dev","cause":"Package not installed or wrong import path.","error":"Cannot find module 'eslint-plugin-es-x'"},{"fix":"Change to import statement: import plugin from 'eslint-plugin-es-x'","cause":"Using CommonJS require() with ESM-only package.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module"},{"fix":"Add to plugins object: import plugin from 'eslint-plugin-es-x'; export default [{ plugins: { 'es-x': plugin } }]","cause":"Flat config not configured correctly.","error":"ESLint couldn't find the plugin 'es-x'"},{"fix":"Ensure rule name is 'es-x/no-bigint' (not 'no-bigint') and plugin is registered.","cause":"Typo in rule name or missing plugin registration.","error":"Definition for rule 'es-x/no-bigint' was not found"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}