{"id":19686,"library":"eslint-plugin-angular","title":"eslint-plugin-angular","description":"ESLint plugin providing AngularJS (Angular 1.x) specific linting rules, covering best practices, conventions, and potential errors. Current stable version is 5.0.0, which requires ESLint ^9.32.0 and drops support for earlier versions. The plugin includes a shareable config based on John Papa's AngularJS style guide. It is the most established ESLint plugin for AngularJS, with over 150 rules organized into categories like possible errors, conventions, and style. Release cadence is low; updates are prompted by major ESLint changes. Key differentiator: specifically for AngularJS (not Angular 2+), with many rules directly mapping to the John Papa style guide.","status":"active","version":"5.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/Gillespie59/eslint-plugin-angularjs","tags":["javascript","eslint","eslintplugin","angularjs"],"install":[{"cmd":"npm install eslint-plugin-angular","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-angular","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-angular","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required for plugin to function","package":"eslint","optional":false}],"imports":[{"note":"ESM only; plugin is provided as default export. CommonJS require() fails in ESLint v9 flat config.","wrong":"const angular = require('eslint-plugin-angular');","symbol":"default","correct":"import angular from 'eslint-plugin-angular';"},{"note":"Shareable config is accessed via the default export's configs property. Named export for configs does not exist.","wrong":"import { configs } from 'eslint-plugin-angular';","symbol":"configs.johnpapa","correct":"import angular from 'eslint-plugin-angular'; export default defineConfig([{ plugins: { angular }, rules: { ...angular.configs.johnpapa.rules } }]);"},{"note":"All rules must be prefixed with 'angular/', otherwise ESLint will look for a built-in rule with that name.","wrong":"rules: { 'controller-name': 'error' }","symbol":"angular/controller-name","correct":"rules: { 'angular/controller-name': 'error' }"}],"quickstart":{"code":"npm init @eslint/config\nnpm install --save-dev eslint eslint-plugin-angular\n# Create eslint.config.mjs:\nimport angular from 'eslint-plugin-angular';\nexport default defineConfig([{\n  plugins: { angular },\n  rules: {\n    'angular/controller-name': ['error', { nameStyle: 'camelCase' }],\n    'angular/module-getter': 'error',\n    'angular/module-setter': 'error'\n  }\n}]);","lang":"javascript","description":"Shows how to install and configure eslint-plugin-angular with ESLint v9 flat config, enabling three common rules."},"warnings":[{"fix":"Upgrade ESLint to ^9.32.0 or pin eslint-plugin-angular to ^4.1.0 if you cannot upgrade.","message":"Version 5.0.0 drops support for ESLint versions < 9.32.0","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"Migrate from .eslintrc to eslint.config.js/.mjs using the flat config format shown in the quickstart.","message":"Version 4.0.0 removed the eslintrc-style config (extends) support; only flat config is supported.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Use: rules: { ...angular.configs.johnpapa.rules } or specify individual rules.","message":"The plugin's shareable config must be explicitly spread in the rules object, unlike ESLint's built-in 'extends'.","severity":"gotcha","affected_versions":">=4.0.0"},{"fix":"Use 'angular/controller-name', etc. in your rules configuration.","message":"Rules are prefixed with 'angular/', not 'angularjs/' or 'ng/'.","severity":"gotcha","affected_versions":"all"},{"fix":"Check documentation and migrate to recommended replacements if available.","message":"Some older rules (e.g., 'angular/definedundefined') are deprecated but may still be available for backward compatibility.","severity":"deprecated","affected_versions":">=4.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 --save-dev eslint-plugin-angular'.","cause":"The plugin is not installed in the project's node_modules.","error":"Error: Failed to load plugin 'angular' declared in '.eslintrc': Cannot find module 'eslint-plugin-angular'"},{"fix":"Replace 'extends: ['angular']' with 'plugins: { angular }, rules: { ...angular.configs.johnpapa.rules }'.","cause":"In flat config, 'extends' is not used; you must use the plugins object and spread the config.","error":"ESLint couldn't find the config 'angular' after extending from the plugin."},{"fix":"Ensure 'plugins: { angular }' is set in flat config, or 'plugins: ['angular']' in legacy config. Use 'angular/' prefix.","cause":"The plugin is not registered in the ESLint config, or the rule prefix is wrong.","error":"Definition for rule 'angular/controller-name' was not found."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}