Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prefer-regexp-exec don't working class property #495

Open
ODGodinho opened this issue Dec 5, 2022 · 1 comment
Open

prefer-regexp-exec don't working class property #495

ODGodinho opened this issue Dec 5, 2022 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@ODGodinho
Copy link

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];
    }
@ota-meshi ota-meshi added enhancement New feature or request help wanted Extra attention is needed labels Dec 5, 2022
@ota-meshi
Copy link
Owner

ota-meshi commented Dec 6, 2022

Thank you for this issue.
If you are familiar with typescript's AST and API, please consider submitting a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants