With the following rule:
"import/newline-after-import": "error"
If I write:
import { DemoModel } from '../app/models/demo.model';
import { HomeComponent } from './views/home/home.component';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
No error is throw. But if I write:
import { DemoModel } from '../app/models/demo.model';
import { HomeComponent } from './views/home/home.component';
const x = 2;
it works as expected.
The way I see it, it should not care what the next line is (if not import, of course).
Here are the images:


What is an "anchor annotation"? That looks like decorators syntax, a stage 2 proposal that's on its 4th syntax/semantics iteration.
Are you saying you expect a newline above the decorator, below the imports, and it's not forcing one? If so, that is indeed a bug.
Are you saying you expect a newline above the decorator, below the imports, and it's not forcing one? If so, that is indeed a bug.
Exactly.
I can confirm that bug makes newline-after-imports pretty much useless in an Angular project, considering most of the typescript files in an angular project start with imports followed directly by the declaration of a decorated class.
Any updates about this?
Most helpful comment
Exactly.