Skip to content

Adding the possibility of inserting an arbitrary EOF #48

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

Merged
merged 2 commits into from
Apr 27, 2018
Merged

Adding the possibility of inserting an arbitrary EOF #48

merged 2 commits into from
Apr 27, 2018

Conversation

radziksh
Copy link
Contributor

@Quramy @olegstepura first of all, thank you for your great work!

In our project we use git with different operating systems, and for the convenience of development we decided to store our files with LF ending. We use typed-css-modules-loader which passes the parameters to the typed-css-modules via options:

{
  loader: 'typed-css-modules-loader',
    options: {
        // params for typed-css-modules
    },
},

the problem is that when the programmer that uses Mac os generates a change, then the d.ts file is saved in the LF format, and if the programmer that uses Windows does this, the d.ts file is saved in the CRLF format. Because of this we see many changed files in which there are actually no changes:

screenshot_11

all changes are just EOL:

screenshot_12

we needed to directly specify the type of EOL that we need, but unfortunately this option was not available and we had to create a fork. Perhaps this option will be useful to other users, so I created a pr.

usage with typed-css-modules-loader:

{
  loader: 'typed-css-modules-loader',
    options: {
      EOL: '\r\n', // or '\n'
   },
},

If there are no options, then by default, there will be an old behavior with an os.EOL

It is necessary for projects where developers use different operating systems for one project.
@Quramy
Copy link
Owner

Quramy commented Apr 26, 2018

@radziksh Thanks for your PR . It looks nice ;)
Whould you write doc about this EOL option to README https://github.com/Quramy/typed-css-modules/blob/master/README.md#new-dtscreatoroption ?

@radziksh
Copy link
Contributor Author

@Quramy done

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.

2 participants