-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
newline-after-import not recognizing decorator #1004
Comments
Presumably: import pick from 'ramda'
export default class MyComponent extends React.Component {} autofixes to: import pick from 'ramda'
export default class MyComponent extends React.Component {} ? If so, this seems like a bug. |
In the above case, it works as expected and autofixes to 2 new lines after import. However, when there's a decorator before the export, there is only one blank line between the import and the decorator. |
I have the same problem. In the source code of this rule I found this code
In the case with default export class node has type "ExportDefaultDeclaration". So, function isClassWithDecorator returned false |
@atos1990 that seems like a good test case and fix - want to submit a PR? |
@ljharb, yes, no problem |
I have the same problem with options
code: import { Context, config, controller, get, provide } from 'mymodule'
@provide()
@controller('/')
export class HomeController {
.....
.....
} |
hey guys, this is still an issue! can we have this fixed? |
I set my eslint config to have 2 new lines after imports using
newline-after-import
plugin. We are also allowing decorator syntax with@
.Currently, it is not counting decorator as a line of code. Only one new line appears after import group if the code block starts with a decorator.
Currently
Want
The text was updated successfully, but these errors were encountered: