You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 21, 2022. It is now read-only.
That is correct and unfortunately that is what the ESlint docs say:
"ignoreStrings": true ignores lines that contain a double-quoted or single-quoted string
I'm surprised no one has said anything about lines like you mentioned (without typescript)
function foo(param1: string, param2: number, param3: InterfaceName["prop"]) {
const bar = fnCall(param3['doNotIgnoreMe'], param4["a"], param4[`b`], param4['c']);
}
The function call should be split but instead it is being ignored if we have the ignoreStrings or the the ignoreTemplateLiterals options.
It almost seems as if we need more a bit more control over strings. I was going to suggest to allow ignoreStrings to take in an object with exceptions:
ignoreStrings: {
exceptPropertyAccess: true,
}
I think this would cover the example above, but then people would have issues with
const a = someElement['with-some-super-random-loooooooooooonnnnnnnnnggggggg-key-that-they-want-to-be-able-to-ignore'];
but this would be fixed by doing:
const key = 'with-some-super-random-loooooooooooonnnnnnnnnggggggg-key-that-they-want-to-be-able-to-ignore';
const a = someElement[key];
I actually want something like this even if eslint does not cover it. Can you think of other case scenarios where we would want to create exceptions to the ignore rules?
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
ignoreStrings: true
does match code below like a string and ignores length checkThe text was updated successfully, but these errors were encountered: