{"id":19684,"library":"eslint-plugin-adonis","title":"ESLint Plugin Adonis","description":"ESLint plugin providing rules for AdonisJS applications and addons, maintained by the AdonisJS community. Current stable version is 3.0.3 (released 2023-06-13), release cadence is irregular. Features TypeScript support and is designed for AdonisJS 5+ with ESM modules. v3 major release targets ESM and updated coding style; v2.x supports ESLint 8. Differentiates from generic ESLint configs by providing AdonisJS-specific conventions like Edge template rules, Lucid ORM usage, and Ace commands.","status":"active","version":"2.1.1","language":"javascript","source_language":"en","source_url":"https://github.com/AdonisCommunity/eslint-plugin-adonis","tags":["javascript","eslint","eslintplugin","eslint-plugin","adonisjs","typescript"],"install":[{"cmd":"npm install eslint-plugin-adonis","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-adonis","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-adonis","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; plugin requires ESLint 8 for v2.x and v3.x","package":"eslint","optional":false}],"imports":[{"note":"ESM-only since v3; v2 supports both CJS and ESM","wrong":"const plugin = require('eslint-plugin-adonis')","symbol":"plugin","correct":"import plugin from 'eslint-plugin-adonis'"},{"note":"Named export for configs; available in v2 and v3","wrong":"const configs = require('eslint-plugin-adonis').configs","symbol":"configs","correct":"import { configs } from 'eslint-plugin-adonis'"},{"note":"Exported if you need to extend rules programmatically","wrong":null,"symbol":"rules","correct":"import { rules } from 'eslint-plugin-adonis'"}],"quickstart":{"code":"// .eslintrc.cjs\nmodule.exports = {\n  extends: [\n    'plugin:adonis/common',\n    'plugin:adonis/typescript' // if using TS\n  ],\n  plugins: ['adonis'],\n  parserOptions: {\n    ecmaVersion: 2020,\n    sourceType: 'module'\n  },\n  rules: {\n    'adonis/no-unused-vars': 'warn',\n    'adonis/sort-imports': 'off'\n  }\n};","lang":"javascript","description":"Example ESLint configuration using adonis plugin with common and TypeScript presets, showing rule customization."},"warnings":[{"fix":"Switch to ESM by adding 'type': 'module' in package.json and using import syntax in .eslintrc.cjs or .eslintrc.js.","message":"v3 drops CommonJS support and requires ESM. Migrate to ES modules or stay on v2.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Use the base 'unicorn/no-array-for-each' rule directly (requires eslint-plugin-unicorn).","message":"Rule 'unicorn/no-array-for-each' removed in v3.0.3; if you depend on it, upgrade or stay on v3.0.2.","severity":"gotcha","affected_versions":">=3.0.3"},{"fix":"Update to v3.0.2+ which uses 'unicorn/prefer-number-properties' prefix.","message":"Rule 'prefer-number-properties' was incorrectly referenced in v3.0.0-3.0.1; fixed in v3.0.2.","severity":"deprecated","affected_versions":">=3.0.0 <3.0.2"},{"fix":"Update ESLint to version 8 or higher.","message":"Plugin expects ESLint 8.x; using with ESLint <8 will fail.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Run 'npm install eslint@8' and update config files.","message":"v2.0.0 dropped support for ESLint 7; upgrade from v1 to v2 requires ESLint 8.","severity":"breaking","affected_versions":">=2.0.0 <3.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-adonis' from project root.","cause":"Plugin not installed in project or global node_modules not visible.","error":"Error: Failed to load plugin 'adonis' declared in '.eslintrc': Cannot find module 'eslint-plugin-adonis'"},{"fix":"Use object format: 'adonis/no-unused-vars': ['warn'] or set to 'off'.","cause":"Rule configuration expects an array but received a string or wrong format.","error":"Error: ESLint configuration in .eslintrc is invalid: - Configuration for rule 'adonis/no-unused-vars' is invalid: Value [\"error\"] is the wrong type."},{"fix":"Set parserOptions.ecmaVersion: 2020 (or higher) and sourceType: 'module'.","cause":"ESM syntax used with old parser; missing ecmaVersion or sourceType.","error":"Parsing error: The keyword 'import' is reserved"},{"fix":"Add 'plugins: ['adonis']' to ESLint config.","cause":"Plugin not registered in plugins array before extending.","error":"TypeError: Cannot set properties of undefined (setting 'adonis')"},{"fix":"Update to v3.0.3+ or install eslint-plugin-unicorn if you need that specific rule.","cause":"Using v3.0.3+ where rule removed, or eslint-plugin-unicorn not installed.","error":"Error: Rule 'unicorn/no-array-for-each' was not found."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}