Skip to content
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

[bugfix] adding file extensions to import statements #4533

Closed
wants to merge 3 commits into from

Conversation

nnmrts
Copy link

@nnmrts nnmrts commented Apr 4, 2018

This should resolve issue #4203.

I used the search and replace tool of vscode to do this, with these two regexes:

import (.*?) ('|")(.*?)(\.js)('|")

import $1 $2$3$5
import (.*?) ('|")(.*?)('|")

import $1 $2$3.js$4

@nnmrts nnmrts changed the title adding file extensions to import to statements [bugfix] adding file extensions to import to statements Apr 4, 2018
@nnmrts nnmrts changed the title [bugfix] adding file extensions to import to statements [bugfix] adding file extensions to import statements Apr 4, 2018
@nnmrts
Copy link
Author

nnmrts commented Apr 4, 2018

did a mini fix 1a8f348 because jscs threw an error

@marwahaha
Copy link
Member

@nnmrts - your tests are failing

@leofavre
Copy link

leofavre commented Apr 18, 2018

@nnmrts, your regular expression in not targeting imports with multiple lines. For example, in src/lib/locale/base-config.js, from '../units/month' in unchanged:

// months
import {
    defaultLocaleMonths,
    defaultLocaleMonthsShort,
} from '../units/month';

'export default moment;'
].concat(files.map(function (file) {
var identifier = path.basename(file, '.js').replace('-', '_');
return 'import ' + identifier + ' from "./' + file + '";';
return 'import ' + identifier + ' from .js"./' + file + '";';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The addition of the .js in this line appears to be the cause of the failing tests.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, i know...already fixed that locally, but there are still bugs...

@marwahaha
Copy link
Member

This has been sitting for a long time, so I will close it.

Thanks for opening this request.
For now, we will not take this change.

@marwahaha marwahaha closed this Jan 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants