-
-
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
add fixer for first
#1046
add fixer for first
#1046
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,12 +20,19 @@ ruleTester.run('first', rule, { | |
export { x };\ | ||
import { y } from './foo';" | ||
, errors: 1 | ||
, output: "import { x } from './foo';\ | ||
import { y } from './foo';\ | ||
export { x };" | ||
}) | ||
, test({ code: "import { x } from './foo';\ | ||
export { x };\ | ||
import { y } from './bar';\ | ||
import { z } from './baz';" | ||
, errors: 2 | ||
, output: "import { x } from './foo';\ | ||
import { y } from './bar';\ | ||
import { z } from './baz';\ | ||
export { x };" | ||
}) | ||
, test({ code: "import { x } from './foo'; import { y } from 'bar'" | ||
, options: ['absolute-first'] | ||
|
@@ -35,7 +42,37 @@ ruleTester.run('first', rule, { | |
'use directive';\ | ||
import { y } from 'bar';" | ||
, errors: 1 | ||
, output: "import { x } from 'foo';\ | ||
import { y } from 'bar';\ | ||
'use directive';" | ||
}) | ||
, test({ code: "var foo = bar;\ | ||
import { x } from './foo';\ | ||
import { y } from './bar';\ | ||
import { z } from './baz';" | ||
, errors: 3 | ||
, output: "import { x } from './foo';\ | ||
import { y } from './bar';\ | ||
import { z } from './baz';\nvar foo = bar;" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nbd but could this use a continuation instead of a literal There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it must be a seperator here. I thought a line-breaker is suitable, or may be another option? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It just looks odd to see the previous lines using \ but this one using \n |
||
}) | ||
, test({ code: "var a = x;\ | ||
import { x } from './foo';\ | ||
import { y } from './bar';\ | ||
import { z } from './baz';" | ||
, errors: 2 | ||
, output: "import { y } from './bar';\ | ||
import { z } from './baz';\nvar a = x;\ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is actually incorrect; because |
||
import { x } from './foo';" | ||
}) | ||
, test({ code: "if (true) { x() };\ | ||
import { x } from './foo';\ | ||
import { y } from './bar';\ | ||
import { z } from './baz';" | ||
, errors: 3 | ||
, output: "import { x } from './foo';\ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here. |
||
import { y } from './bar';\ | ||
import { z } from './baz';\nif (true) { x() };" | ||
}) | ||
, | ||
] | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we validate that the output matches the input here?