Registry / testing / eslint-plugin-decorator-position

eslint-plugin-decorator-position

JSON →
library6.1.0jsnpmunverified

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.

testingdevops
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ESM-only since v6.0.0; if using CommonJS, use dynamic import or use legacy config paths (e.g., 'eslint-plugin-decorator-position/config-legacy/ember').

import plugin from 'eslint-plugin-decorator-position'

Named export; not available as a default property. Use for custom rule configuration.

import { rules } from 'eslint-plugin-decorator-position'

Config paths for flat configs are under /config/. Do not append .js extension; Node ESM resolves correctly.

import recommended from 'eslint-plugin-decorator-position/config/recommended'

Legacy configs use the 'plugin:' prefix with the config name (e.g., /ember). Direct path import is for flat configs only.

module.exports = { extends: ['plugin:decorator-position/ember'] }

Flat config setup with recommended preset, Babel parser, and custom printWidth.

// eslint.config.js import plugin from 'eslint-plugin-decorator-position'; import recommended from 'eslint-plugin-decorator-position/config/recommended'; import babelParser from '@babel/eslint-parser'; export default [ ...recommended, { languageOptions: { parser: babelParser, parserOptions: { requireConfigFile: false, babelOptions: { plugins: [['@babel/plugin-proposal-decorators', { legacy: true }]], }, }, }, rules: { 'decorator-position/decorator-position': ['error', { printWidth: 100 }], }, }, ];
Debug
Known footguns
breakingESLint 6 compatibility dropped. Plugin v6 requires ESLint >=7.
breakingNode.js <12 support dropped. Plugin v3+ requires Node >=12.
breakingESM-only plugin exports starting in v6.0.0. CommonJS require() fails with 'ERR_REQUIRE_ESM'.
deprecatedLegacy configs (e.g., 'plugin:decorator-position/ember') are deprecated in favor of flat configs.
gotchaWhen using with Prettier, printWidth must be explicitly set in the decorator-position rule if not using a .prettierrc.js file; otherwise lint results may conflict with prettier/prettier rule.
gotchaThe package always requires '@babel/eslint-parser' as parser; '@typescript-eslint/parser' is only partially supported and may cause false positives for TypeScript decorators.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
9 hits · last 30 days
gptbot
4
ahrefsbot
4
script
1
Resources