eslint-plugin-regexp icon indicating copy to clipboard operation
eslint-plugin-regexp copied to clipboard

prefer-regexp-exec don't working class property

Open ODGodinho opened this issue 1 year ago • 1 comments

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

ODGodinho avatar Dec 05 '22 19:12 ODGodinho