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

Proposal: linting macro #349

Open
nycdotnet opened this issue Mar 26, 2016 · 0 comments
Open

Proposal: linting macro #349

nycdotnet opened this issue Mar 26, 2016 · 0 comments

Comments

@nycdotnet
Copy link
Contributor

Proposal: With the assumption that more will come with future versions, implement an option that will enable all of the TypeScript-provided linting options. This will be updated as new linting features are added to TypeScript, so it will be somewhat of a set-and-forget for users of grunt-ts as they upgrade. The linting option will be off by default. An explicit setting will override the setting that would have come from linting.

Setting linting: true will set the following for use with TypeScript 1.8:

noImplicitAny: true, 
suppressImplicitAnyIndexErrors: true // see note
isolatedModules: true, 
suppressExcessPropertyErrors: false,  
allowUnusedLabels: false, 
noImplicitReturns: true,  
noFallthroughCasesInSwitch: true, 
allowUnreachableCode: false,
forceConsistentCasingInFileNames: true,
noImplicitUseStrict: false

Note regarding suppressImplicitAnyIndexErrors - while technically this weakens the TypeScript type checking, it is also very practical in this author's opinion. It can be turned off with linting enabled by setting suppressImplicitAnyIndexErrors: false.

One issue is that this will need to be aware of the TypeScript version and only pass switches that are appropriate (for example, it is safe to pass noImplicitAny to TypeScript 1.6, but not allowUnusedLabels).

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

No branches or pull requests

1 participant