tslint-eslint-rules
tslint-eslint-rules copied to clipboard
[ter-indent] add new options for arrays and objects
Since the last time I updated the rule there have been new changes, see:
https://github.com/eslint/eslint/compare/0643bfeff68979044ca57a2b392d855d18be7d08...dec3ec6a1d1ded6f931a0b9e31c324e3fea50550
I'll try to get these in with a couple of other rules for next minor release.
@jmlopez-rod Is this related to the issues I'm seeing in ter-indent when using it like:
.update(
{},
{
returnChanges: 'always'
}
)
@blakeembrey What's the configuration and errors you are using with the code? It could be, I'm gonna say the rule is complaining on { returnChanges: 'always' } parameter?
I'm gonna say the rule is complaining on { returnChanges: 'always' } parameter?
Yes, sorry - it is. The rule is https://github.com/blakeembrey/tslint-config-standard/blob/6d0d2f5a968e36f7b763188d32f1b019cee85c52/tslint.js#L63-L69.
I saw https://github.com/eslint/eslint/commit/0ad4d33cdcbdd8f879dc60b56a697d727a619fc1 in the diff you pasted which looks relevant here.
This was the enhancement request I was about to file. I could use the Array and Object indent rule options that eslint has. I wanted to use this rule in tslint.yml:
ter-indent:
severity: error
options:
- 4
-
SwitchCase: 1
FunctionDeclaration:
parameters: first
body: 1
FunctionExpression:
parameters: first
body: 1
MemberExpression: off
CallExpression:
arguments: first
ArrayExpression: first
ObjectExpression: first
ImportDeclaration: first
so that this passes:
return {
name,
text: `You have to do ${name}`
};
Any updates?