{"id":19976,"library":"eslint-plugin-vtex","title":"eslint-plugin-vtex","description":"VTEX's custom ESLint plugin providing rules like prefer-early-return and enforce-explicit-enum-values. Current stable version is 2.3.0. The plugin is actively maintained by VTEX and ships TypeScript type definitions. It supports ESLint versions 6, 7, and 8. Unlike generic ESLint plugins, this one targets VTEX-specific coding conventions, making it essential for projects within the VTEX ecosystem. The plugin is released on npm and follows semantic versioning.","status":"active","version":"2.3.0","language":"javascript","source_language":"en","source_url":"https://github.com/vtex/typescript","tags":["javascript","eslint","eslint-plugin","vtex","typescript"],"install":[{"cmd":"npm install eslint-plugin-vtex","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-vtex","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-vtex","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency, required to run ESLint plugins","package":"eslint","optional":false}],"imports":[{"note":"ESLint plugin names are abbreviated; 'eslint-plugin-' prefix is omitted.","wrong":"plugins: [\"eslint-plugin-vtex\"]","symbol":"plugin","correct":"plugins: [\"vtex\"]"},{"note":"Rules must be prefixed with the plugin name (vtex/).","wrong":"\"prefer-early-return\": \"warn\"","symbol":"rules","correct":"\"vtex/prefer-early-return\": \"warn\""},{"note":"TypeScript users can import type definitions for configuration objects.","symbol":"Config","correct":"import type { Config } from 'eslint-plugin-vtex'"}],"quickstart":{"code":"// .eslintrc.json\n{\n  \"plugins\": [\"vtex\"],\n  \"rules\": {\n    \"vtex/prefer-early-return\": \"warn\",\n    \"vtex/enforce-explicit-enum-values\": \"error\"\n  }\n}","lang":"json","description":"Enables the vtex plugin and its two custom rules in an ESLint config file."},"warnings":[{"fix":"Set plugins: [\"vtex\"]","message":"Plugin name must be 'vtex' not 'eslint-plugin-vtex' in the plugins array.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use 'vtex/prefer-early-return' instead of 'prefer-early-return'","message":"Rule names must be prefixed with 'vtex/' in the rules object.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Upgrade ESLint to version 6 or later.","message":"Dropped support for ESLint <6 in version 2.0.0.","severity":"breaking","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Change plugins: [\"eslint-plugin-vtex\"] to plugins: [\"vtex\"]","cause":"Using the full npm package name in the plugins array instead of the abbreviated name.","error":"ESLint couldn't find the plugin \"eslint-plugin-vtex\".\n\nThe package is not installed, or the plugin name is misspelled."},{"fix":"Use 'vtex/prefer-early-return' instead of 'prefer-early-return'","cause":"Missing the plugin prefix in the rule name.","error":"Definition for rule 'prefer-early-return' was not found."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}