[import/order] Fix incorrect import reordering - #1253
Merged
Merged
Conversation
Fixes #1252. - Reordering import statement to line below ignores uncrossable statements - Add more tests for ordering around function call
9 similar comments
Contributor
Author
|
I have no idea why ci builds failed. Seams like build for eslint5 broken. |
ljharb
reviewed
Jan 3, 2019
Member
|
@tihonove can you rebase this? |
|
Anything I can do to help? |
ljharb
approved these changes
Oct 9, 2019
| fn_call(); | ||
|
|
||
| const global1 = require('global1'); | ||
| const global2 = require('global2'); |
Member
There was a problem hiding this comment.
without the fix, i get this output (and a test failure):
AssertionError [ERR_ASSERTION] [ERR_ASSERTION]: Output is incorrect.
+ expected
- actual
+ const local = require('./local');
fn_call();
const global1 = require('global1');
const global2 = require('global2');
- const local = require('./local');
fn_call();| // reorder fix cannot cross function call on moving below #2 | ||
| test({ | ||
| code: ` | ||
| const local = require('./local'); |
Member
There was a problem hiding this comment.
AssertionError [ERR_ASSERTION] [ERR_ASSERTION]: Output is incorrect.
+ expected
- actual
+ const local = require('./local');
fn_call();
const global1 = require('global1');
const global2 = require('global2');
- const local = require('./local');
fn_call();| // reorder fix cannot cross function call on moving below #3 | ||
| test({ | ||
| code: ` | ||
| const local1 = require('./local1'); |
Member
There was a problem hiding this comment.
AssertionError [ERR_ASSERTION] [ERR_ASSERTION]: Output is incorrect.
+ expected
- actual
+ const local1 = require('./local1');
const local2 = require('./local2');
const local3 = require('./local3');
const local4 = require('./local4');
fn_call();
const global2 = require('global2');
const global3 = require('global3');
const global4 = require('global4');
const global5 = require('global5');
- const local1 = require('./local1');
fn_call();| // reorder fix cannot cross function call on moving below | ||
| test(withoutAutofixOutput({ | ||
| code: ` | ||
| const local = require('./local'); |
Member
There was a problem hiding this comment.
AssertionError [ERR_ASSERTION] [ERR_ASSERTION]: Output is incorrect.
+ expected
- actual
+ const local = require('./local');
const global1 = require('global1');
const global2 = require('global2');
fn_call();
const global3 = require('global3');
- const local = require('./local');
fn_call();| const global1 = require('global1'); | ||
| const global2 = require('global2'); | ||
| fn_call(); | ||
| const local2 = require('./local2'); |
Member
There was a problem hiding this comment.
AssertionError [ERR_ASSERTION] [ERR_ASSERTION]: Output is incorrect.
+ expected
- actual
+ const local1 = require('./local1');
const global1 = require('global1');
const global2 = require('global2');
fn_call();
- const local2 = require('./local2');
const global3 = require('global3');
const global4 = require('global4');
- const local1 = require('./local1');
+ const local2 = require('./local2');
fn_call();| code: ` | ||
| const env = require('./config'); | ||
|
|
||
| Object.keys(env); |
Member
There was a problem hiding this comment.
AssertionError [ERR_ASSERTION] [ERR_ASSERTION]: Output is incorrect.
+ expected - actual
+ const env = require('./config');
Object.keys(env);
const http = require('http');
const express = require('express');
- const env = require('./config');
http.createServer(express());
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1252