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-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];
}