Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upSupport for Typescript #241
Comments
dcousens
added
the
question
label
Aug 30, 2015
This comment has been minimized.
This comment has been minimized.
|
Sorry, this would complicate what is currently a simple tool. We only support JavaScript. |
feross
closed this
Aug 30, 2015
This comment has been minimized.
This comment has been minimized.
krzkaczor
commented
May 1, 2016
|
I have been working recently on standardTS. https://github.com/krzkaczor/standardts
|
This comment has been minimized.
This comment has been minimized.
kirillgroshkov
commented
Jul 6, 2016
|
Too bad, I would definitely use it for typescript if possible. Maybe it could be done in some simpler way like stripping down all typescript-specific stuff (like type annotations), other typescript things are based on ES6/7 syntax. Just saying. Using TSLINT now, but 2 problems: not enough rules, a lot of work to write and maintain your own config instead of just using "the only one". |
This comment has been minimized.
This comment has been minimized.
|
@kirillgroshkov Maybe |
This comment has been minimized.
This comment has been minimized.
|
Perhaps this will be revisited when ESLint supports different parsers. I've found a love for TypeScript and I'm heart broken about not being able to use standard. |
This comment has been minimized.
This comment has been minimized.
|
Why don't you just use https://github.com/nzakas/eslint-plugin-typescript ? {
"standard": {
"plugins": [
"typescript"
]
}
}That ought to strip type annotations so you can still use More complete instructions, but for Flow, are here: https://github.com/feross/standard#can-i-use-a-javascript-language-variant-like-flow |
This comment has been minimized.
This comment has been minimized.
|
Not actually really working. I'll report bugs to eslint-plugin-typescript. |
This comment has been minimized.
This comment has been minimized.
|
@mightyiam If you figure out that the README instructions are not enough for Typescript, can you please PR to add instructions? |
This comment has been minimized.
This comment has been minimized.
|
If I figure out what to do, I'll surely do so. |
This comment has been minimized.
This comment has been minimized.
|
This is what I currently do: |
This comment has been minimized.
This comment has been minimized.
eadwu
commented
Apr 8, 2017
•
|
With this as the test.ts file let obj: string;
obj = "yo";
// Error: Type 'number' is not assignable to type 'string'.
obj = 10;
function sayIt(what: string) {
return `Saying: ${what}`;
}
const said: string = sayIt(obj);
class Sayer {
// mandatory
what: string;
constructor(what: string) {
this.what = what;
}
// return type if you want to
sayIt(): string {
return `Saying: ${this.what}`;
}
}I got the following output
using the following as my package.json {
"devDependencies": {
"babel-eslint": "^7.2.1",
"standard": "^10.0.1"
},
"standard": {
"parser": "babel-eslint"
}
}and running node_modules/standard/bin/cmd.js test.tsHow would I add the files to package.json so that it would lint .ts files as well since just running the command without any files only lints .js and .jsx? |
This comment has been minimized.
This comment has been minimized.
|
@KC-SI Please open a new issue instead of posting into an already-closed issue. Thanks. |
This comment has been minimized.
This comment has been minimized.
|
I have released eslint-config-standard-with-typescript. Please report issues and send in PRs. Should be a step forward. |
This comment has been minimized.
This comment has been minimized.
GantMan
commented
Dec 21, 2017
|
I'm a fan of standard, and I'm a fan of typescript. Anyone got a fix for this? |
kube commentedAug 29, 2015
It would be a good thing to provide support for Typescript files.