ESLint plugin that enforces consistent positioning of decorators (e.g., same line vs. new line before the target). Current stable version is 6.1.0 (released 2026-04-16) with minor updates adding ESLint 10 support and bundled TypeScript typings. Maintained by NullVoxPopuli, with frequent releases (~monthly) and support for ESLint 7, 8, 9, and 10. Key differentiator: provides both flat configs and legacy configs tailored for Ember projects, integrates with Prettier, and is the only dedicated decorator-position linter. Requires @babel/eslint-parser as a parser.
npm install eslint-plugin-decorator-positionVerified import paths — ran on the pinned version, not inferred.
Flat config setup with recommended preset, Babel parser, and custom printWidth.
Upgrade ESLint to version 7 or later (8/9/10 supported).
Upgrade Node.js to version 12 or higher.
Use dynamic import() in CommonJS, or switch to ESM. Alternatively, import legacy configs from 'eslint-plugin-decorator-position/config-legacy/ember' which remain CJS.
Migrate to flat config using 'eslint-plugin-decorator-position/config/recommended'.
Set 'decorator-position/decorator-position': ['error', { printWidth: 100 }] and matching printWidth in prettier/prettier rule.Use @babel/eslint-parser with @babel/plugin-proposal-decorators. For TypeScript, ensure babelOptions are set accordingly.
Use import() or switch to ESM. For legacy configs, use 'eslint-plugin-decorator-position/config-legacy/ember' which is still CJS.
Use 'eslint-plugin-decorator-position/config/recommended' (no .js). Ensure package is installed.
Set parser to '@babel/eslint-parser' and add '@babel/plugin-proposal-decorators' with legacy: true in parserOptions.
Ensure plugins array includes 'decorator-position' and rules are prefixed correctly. For flat config, add the plugin object.