tslint settings not imported

I've got the following tslint.json file:

{
"extends": [
"tslint-config-airbnb"
],
"rules": {
"mocha-no-side-effect-code": false,
"missing-jsdoc": false,
"no-relative-imports": false,
"export-name": false,
"promise-function-async": false,
"no-void-expression": false,
"max-line-length": false,
"no-redundant-jsdoc": false,
"prefer-type-cast": false,
"align": false,
"import-name": false,
"trailing-comma": [
true,
{
"multiline": "never",
"singleline": "never"
}
],
"typedef": [
true,
"parameter",
"arrow-parameter",
"property-declaration",
"member-variable-declaration"
],
"semicolon": false
}
}

I've tried importing them by right-clicking the file and selecting "Apply TSLint Code Style Rules", but this doesn't seem to have effect. Reformatting the code uses e.g. 4-space indentation instead of 2 - and immediately after gives errors that tslint rules are not followed, and there's also a lot of warnings, e.g. missing semicolons (while semicolons are turned off).

How to properly import tslint settings into webstorm?

 

4 comments

the correct syntax for semicolon is

"semicolon": [true, "never"]

See https://palantir.github.io/tslint/rules/semicolon/

It is correctly imported; "ter-indent"rule seems to be ignored; logged as https://youtrack.jetbrains.com/issue/WEB-36227

0

That's quick, thanks!

One more thing: the Webstorm formatter also reformats: (which is correct according to tslint)

import { expect } from 'chai'

to:

import {expect} from 'chai'

which violates the `objects-curly-spacing` rule. Is it possible to fix this as well?

0

WebStorm preferences can be changed in Settings | Editor | Code Style | TypeScript | Spaces, Within | ES6 import/export braces

 

objects-curly-spacing, as well as other rules defined in tslint-eslint-rules plugin, are not currently supported - https://youtrack.jetbrains.com/issue/WEB-36227#focus=streamItem-27-3206519-0-0

 

0

Thanks :) At least it's possible to override manually, still would be nice if it "just worked" ;). I think vscode works without any customisations needed.

0

Please sign in to leave a comment.