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

Wrong warnings in tslint.json for accepted configuration values #245

Closed
Martin-Luft opened this issue Nov 23, 2016 · 8 comments · Fixed by #1280
Closed

Wrong warnings in tslint.json for accepted configuration values #245

Martin-Luft opened this issue Nov 23, 2016 · 8 comments · Fixed by #1280

Comments

@Martin-Luft
Copy link

Martin-Luft commented Nov 23, 2016

I'm using VSCode 1.7.2, TSLint plugin 0.6.3, TSLint 4.0.1 and TypeScript 2.0.10.

When I open the tslint.json file in VSCode I get serveral wrong warnings about my configuration values:

"cyclomatic-complexity": true -> Incorrect type. Expected "array"

"no-consecutive-blank-lines": true -> Incorrect type. Expected "array"

"object-literal-key-quotes": [true, "consistent-as-needed"] -> Value is not an accepted value. Valid values: [true,false,"always","as-needed"]

"one-variable-per-declaration": true -> Incorrect type. Expected "array"

"only-arrow-functions": true -> Incorrect type. Expected "array"

"typedef": [true, "arrow-call-signature"] -> Value is not an accepted value. Valid values: [true,false,"call-signature","parameter","arrow-parameter","property-declaration","variable-declaration","member-variable-declaration"]

https://github.com/Microsoft/vscode-tslint/issues/132

palantir/tslint#1776

@proProbe
Copy link

It seems like this is still a problem? Any ideas on this?

@omgaunicorn
Copy link

I ran into the same issue, specifically with the curly rule at first and mistakenly tried to fix it on the tslint side, but the tslint.json used here has several old schemata for rules that have changed. I'll look into making a PR with updates to those rules.

@cyrilletuzi
Copy link
Contributor

Be sure to not only add the missing new rules, but also the new options and severity configuration for each rule.

For example :

"class-name": true

can now be set like this, to manage severity level :

"class-name": {
  "options": true,
  "severity": "error"
}

I hope there is something to manage this case in json schemas, or it will be a very ugly schema with a lot of duplicate code...

@timbru31
Copy link
Contributor

The ban rule is also invalid since it's no longer an array of banned functions/methods since v5.4.0.
See palantir/tslint#2547

@tkrotoff
Copy link
Contributor

tkrotoff commented Sep 4, 2017

Other TSLint rules having the same issue (Incorrect type. Expected "array"):

"interface-name": false
"trailing-comma": false
"comment-format": false
"max-classes-per-file": false
"no-console": false
"member-ordering": false

tkrotoff added a commit to tkrotoff/schemastore that referenced this issue Sep 7, 2017
madskristensen pushed a commit that referenced this issue Sep 7, 2017
@tkrotoff
Copy link
Contributor

tkrotoff commented Sep 7, 2017

@Martin-Wegner this can be closed now, see #339

@Martin-Luft
Copy link
Author

Martin-Luft commented Sep 7, 2017

@tkrotoff thank you! But unfortunately there are a lot of new TSLint rules which produces a lot of warnings. For example:

"member-ordering": [true, "fields-first"] -> Incorrect type. Expected "object"

"no-magic-numbers": true -> Incorrect type. Expected "array"

"no-void-expression": [true, "ignore-arrow-function-shorthand"] -> Incorrect type. Expected "boolean"

"ordered-imports": [true, { "import-sources-order": "case-insensitive", "named-imports-order": "case-insensitive" }] -> Incorrect type. Expected "boolean"

@tkrotoff
Copy link
Contributor

tkrotoff commented Sep 7, 2017

@Martin-Wegner Well you can send a PR like I did

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

Successfully merging a pull request may close this issue.

6 participants