NullVoxPopuli / eslint-plugin-decorator-position

ESLint plugin for enforcing decorator position

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Angular Support

NullVoxPopuli opened this issue · comments

Angular makes use of many decorators. It'd be great to add a default configuration that supports whatever idiomatic Angular is

'decorator-position/decorator-position': [
                    'error',
                    {
                        printWidth: 120,
                        properties: 'prefer-inline',
                        methods: 'above',
                        overrides: {
                            'prefer-inline': [
                                ['@Pipe', { withArgs: true }],
                                ['@Directive', { withArgs: true }],
                                ['@Injectable', { withArgs: true }]
                            ]
                        }
                    }
                ],

Hello, this is not working for

@Pipe({
    name: 'my'
})
export class MyPipe implements PipeTransform {
    public transform(): void {
       /// ...
    }
}

Expected:

@Pipe({ name: 'my' })
export class MyPipe implements PipeTransform {
    public transform(): void {
       /// ...
    }
}

Hello! Thanks for reporting! And chance you'd be willing to set up a minimal reproduction following examples here?: https://github.com/NullVoxPopuli/eslint-plugin-decorator-position/tree/master/smoke-tests/issue-reproductions