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

ignores rules from tslint.json #92

Open
vladgogo opened this issue Mar 30, 2017 · 2 comments
Open

ignores rules from tslint.json #92

vladgogo opened this issue Mar 30, 2017 · 2 comments

Comments

@vladgogo
Copy link

vladgogo commented Mar 30, 2017

I have this tslint.json:

{
  "rules": {
    "semicolon": [true, "always"],
    "no-consecutive-blank-lines": true
  }
}

And this code in example.ts:

if (true)
    var a = 1


var a = 1

I run:
node_modules/.bin/tsfmt ./js/*.ts -r --useTslint ./tslint.json

And nothing changes. But I expect semicolons to be added and extra empty lines to be removed.

It follows the rules from tsfmt.json though, related to indentation and whitespaces.
I also found that running tsfmt ./js/*.ts -r --useTslint ./tslint.json (without node_modules) produces very weird formatting that does not follow any rules.

@vvakame
Copy link
Owner

vvakame commented Apr 4, 2017

I expect semicolons to be added

tsfmt uses compiler api of tsc.
this behavior is not supported by tsc.
I recommended to use tslint --fix option.
https://github.com/palantir/tslint#cli-1

patched welcome!

@JasCodes
Copy link

@vvakame But update file twice makes no sense.
Can't use pipe the output from tslint --fix into tsfmt somehow?

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

No branches or pull requests

3 participants