"ignoreAccessorPattern" doesn't behave like the TSLint version
See original GitHub issueMy new ESLint config:
"functional/immutable-data": ["error", {
ignorePattern: ["^mutable"],
ignoreAccessorPattern: ["**.mutable*.*", "**.current.*"],
}],
My old TSLint config:
"no-object-mutation":
[true, {"ignore-prefix": "mutable", "ignore-pattern": ["**.mutable*", "**.current"]}]
And here the sample code, where it behaves differently:
export class SomeClass {
private mutableSomething?: string;
mutate(): void {
this.mutableSomething = "xx"; // Ignored in TSLint, now reported
}
}
//
const somethingLikeReactUseRef = { current: "x" };
somethingLikeReactUseRef.current = "y"; // Ignored in TSLint, now reported
Am I doing something wrong?
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
microsoft/tslint-microsoft-contrib: A set of TSLint rules ... - GitHub
This is case-insensitive by default but ignores file extension. It can be configured to be case-insensitive or to allow names matching a regex....
Read more >TSLint extension throwing errors in my Angular application ...
Disable/Uninstall TSLint from your Visual Studio Code. You can then, place a script in your package.json file as - "lint": "eslint -c .eslintrc....
Read more >Documentation - What is a tsconfig.json - TypeScript
When input files are specified on the command line, tsconfig.json files are ignored. Examples. Example tsconfig.json files: Using the files property.
Read more >Code Inspections in JavaScript and TypeScript - JetBrains
This topic lists all JetBrains Rider code inspections available in JavaScript and TypeScript. You can toggle specific inspections or change ...
Read more >Microsoft Azure Security Code Analysis task customization guide
NOTE: Please make sure that the group policy does not disable the ... the build task will behave according to the selected value...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes,
This config should work for your original code (once the update is merged in):
As only string are being modified in your code, property mutation doesn’t need to be checked. However, to allow for reassigning and property mutation use:
Just updated. Works great! Many thanks!