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

Separator gets added to the output #48

Open
Lonli-Lokli opened this issue Oct 19, 2020 · 6 comments · Fixed by #52
Open

Separator gets added to the output #48

Lonli-Lokli opened this issue Oct 19, 2020 · 6 comments · Fixed by #52
Labels

Comments

@Lonli-Lokli
Copy link
Contributor

Describe the bug
with empty separator, eg --separator '' - wierd string added to the output

Steps to reproduce

before run:

import { Component, HostListener } from '@angular/core';
import { MatDialogRef } from '@angular/material/dialog';
import { Observable } from 'rxjs';

import { AboutDialogBloc, AboutState } from './about-dialog.bloc';

after 1st run:

import { Component, HostListener } from '@angular/core';
import { MatDialogRef } from '@angular/material/dialog';
import { Observable } from 'rxjs';'' <-!!!!!
import { AboutDialogBloc, AboutState } from './about-dialog.bloc';

after 2nd run

import { Component, HostListener } from '@angular/core';
import { MatDialogRef } from '@angular/material/dialog';
import { Observable } from 'rxjs';''<-!!!!!
import { AboutDialogBloc, AboutState } from './about-dialog.bloc';''<-!!!!!

Expected behavior
Just new line should be added

Desktop (please complete the following information):

  • OS: Win10
  • import conductor version: 2.2.1
@nivekcode
Copy link
Owner

🎉 This issue has been resolved in version 2.2.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Lonli-Lokli
Copy link
Contributor Author

@kreuzerk Apparently it works in tests but not in my repo.
According to investigation, it's due to fact that internally import-conductor uses \n as separator, while on my project it's \r\n

Not sure how to customize it in source code.

@Lonli-Lokli
Copy link
Contributor Author

@kreuzerk Can you re-open this story? It's still reproducable with the latest update.

@nivekcode nivekcode reopened this Mar 25, 2021
@Lonli-Lokli
Copy link
Contributor Author

@kreuzerk do you observe same error in project (not tests) when specifying empty separator with --separator '' ?
Not sure, maybe it's just my own local issue

@Lonli-Lokli
Copy link
Contributor Author

Nevermind, seems like --separator '' on windows is treated not as empty string but as string with two quotes inside

@d10n4t4n
Copy link

d10n4t4n commented Feb 13, 2022

For me it adds a null when running on windows npx import-conductor --separator ''

image

As i'm using it with lint-staged, i'll just add a space instead.
Then put my prettier --write after that, so it removes the empty space and everything works :D
My lint-staged looks like this:

 "lint-staged": {
    "src/**/*.{ts,scss,html}": [
      "import-conductor --separator ' '",
      "eslint --fix",
      "npm run prettier:write"
    ]
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants