eslint-plugin-regexp
eslint-plugin-regexp copied to clipboard
prefer-regexp-exec don't working class property
Information:
- ESLint version: 8.29.0
eslint-plugin-regexpversion: 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];
}
Thank you for this issue. If you are familiar with typescript's AST and API, please consider submitting a PR.