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

Make target file extension configurable #6

Closed
gausie opened this issue Mar 18, 2016 · 8 comments
Closed

Make target file extension configurable #6

gausie opened this issue Mar 18, 2016 · 8 comments

Comments

@gausie
Copy link

gausie commented Mar 18, 2016

I use .jsx in my project (for ReactJS) so this currently will not work on my components folder.

I could submit a pull request but wondered if you want to support user-configured extensions.

@gajus gajus changed the title Support JSX Make target file extension configurable Mar 19, 2016
@gajus
Copy link
Owner

gajus commented Mar 19, 2016

By the looks of it, this change would affect only a few lines of code:

./src/utilities/readDirectory.js:36:        return !_.includes(files, fileName + '.js');
./src/utilities/readDirectory.js:67:        if (!isDirectory && !_.endsWith(fileName, '.js')) {

As long as this feature is implemented sticking to principles of functional programming (without use or global state variables and tested), I don't have any objections against a PR.

@gausie
Copy link
Author

gausie commented Mar 19, 2016

I figured I would just replace with fileName.matches(/\.jsx?$/)
On 19 Mar 2016 11:05, "Gajus Kuizinas" [email protected] wrote:

By the looks of it, this change would affect only a few lines of code:

./src/utilities/readDirectory.js:36: return !.includes(files, fileName + '.js');
./src/utilities/readDirectory.js:67: if (!isDirectory && !
.endsWith(fileName, '.js')) {

As long as this feature is implemented sticking to principles of
functional programming (without use or global state variables and tested),
I don't have any objections against a PR.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#6 (comment)

@gajus
Copy link
Owner

gajus commented Mar 19, 2016

No, that could have unwanted side-effects, e.g. someone could have Foo.js as entry file and Foo.jsx to contain a template. Not saying it is a good thing to do, but I have seen worse and it is a fairly likely scenario.

@Someguy123
Copy link

What's the status of this? @gajus ?

Would be great to just do --filetype=jsx, or if it would just natively do JSX by default.

@gajus
Copy link
Owner

gajus commented Jun 3, 2016

What's the status of this? @gajus ?

Not a priority for me. Will happily accept a PR.

@jogelin
Copy link

jogelin commented Jun 22, 2017

It is also useful for typescript but it doesn't generate index.TS...

@gajus
Copy link
Owner

gajus commented Jun 22, 2017

It is also useful for typescript but it doesn't generate index.TS...

Would accept a PR.

@FDiskas
Copy link

FDiskas commented Jan 19, 2022

already implemented

@gajus gajus closed this as completed Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants