prefer-regexp-exec don't working class property
ODGodinho opened this issue · comments
Victor Godinho commented
Information:
- ESLint version: 8.29.0
eslint-plugin-regexp
version: 1.11.0
Description
The following case reports that RegExp#exec() should be changed
protected readonly PATH_REGEXP: RegExp = /^.*\//g;
protected getLogPath(filepath: string): string | undefined {
const match = filepath.match(this.PATH_REGEXP); // Eslint error: `Use the `RegExp#exec()` method instead`
return match?.[0];
}
Yosuke Ota commented
Thank you for this issue.
If you are familiar with typescript's AST and API, please consider submitting a PR.