Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Support javascript files#120

Merged
egamma merged 1 commit intomicrosoft:masterfrom
YuichiNukiyama:support_javascript
Nov 13, 2016
Merged

Support javascript files#120
egamma merged 1 commit intomicrosoft:masterfrom
YuichiNukiyama:support_javascript

Conversation

@YuichiNukiyama
Copy link
Contributor

fix #51

@egamma
Copy link
Member

egamma commented Nov 13, 2016

@YuichiNukiyama thanks for the PR 💐

@YuichiNukiyama does tslint also support linting of react .jsx files?

@egamma egamma merged commit e05a502 into microsoft:master Nov 13, 2016
@egamma
Copy link
Member

egamma commented Nov 13, 2016

@YuichiNukiyama is there a configuration option in tslint.json to enable tslint in .js files? I'm testing it currently, but do not get tslint warnings in .js files

in .ts files
image

in .js files
image

@YuichiNukiyama YuichiNukiyama deleted the support_javascript branch November 13, 2016 10:29
@YuichiNukiyama
Copy link
Contributor Author

@egamma Thanks for merging my PR.

does tslint also support linting of react .jsx files?

TSLint hasn't supported .jsx files yet.

is there a configuration option in tslint.json to enable tslint in .js files?
I'm testing it currently, but do not get tslint warnings in .js files

TSLint have new options. If you want to lint js file, you shoud add jsRules options to tslint.json.

{
  "jsRules": {
    "quotemark": [true, "double", "avoid-escape"]
  },
  "rules": {
    …
  }
}

@egamma
Copy link
Member

egamma commented Nov 13, 2016

@YuichiNukiyama thanks I could now test the JS support.

Since JS is now supported, the extension also needs to activate for js files.

    "onLanguage:javascript",

I've pushed the change.

I also noticed that I don't get validation/suggestions inside the jsRules properties.

rules
image

jsRules
image

The schema for tslint.json at http://json.schemastore.org/tslint should be updated to include jsRules.

@YuichiNukiyama
Copy link
Contributor Author

I see. I'll try it.

@YuichiNukiyama
Copy link
Contributor Author

done 😄

@egamma
Copy link
Member

egamma commented Nov 17, 2016

excellent, thanks 🌷

@egamma
Copy link
Member

egamma commented Nov 21, 2016

@YuichiNukiyama regarding linting of .jsx files. It looks like this is now supported. Pls see palantir/tslint#1714. It is an easy change to enable tslint for javascriptreact files, what do you think?

@YuichiNukiyama
Copy link
Contributor Author

I think so, too. I'll send PR.

@YuichiNukiyama YuichiNukiyama mentioned this pull request Nov 21, 2016
@egamma egamma modified the milestone: November Dec 9, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to use TSLint vscode extension to lint *.js file?

2 participants