Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Optimize regex literals

License

NotificationsYou must be signed in to change notification settings

BrainMaestro/eslint-plugin-optimize-regex

Repository files navigation

npmnpm

Optimize regex literals

Installation

You'll first need to installESLint:

npm i eslint --save-dev

Next, installeslint-plugin-optimize-regex:

npm install eslint-plugin-optimize-regex --save-dev

Note: If you installed ESLint globally (using the-g flag) then you must also installeslint-plugin-optimize-regex globally.

Usage

Addoptimize-regex to the plugins section of your.eslintrc configuration file. You can omit theeslint-plugin- prefix:

{"plugins": ["optimize-regex"    ]}

Then configure the rules you want to use under the rules section.

{"rules": {"optimize-regex/optimize-regex":"warn"    }}

If you wish to add awhitelist orblacklist array againstregexp-tree'stransforms, you can add them on an objects object:

{"rules": {"optimize-regex/optimize-regex": ["warn", {"blacklist": ["charClassClassrangesMerge"]        }]    }}

If you want the latter particular settings, you can avoid settingplugins andrules and just use:

{"extends": ["optimize-regex/recommended"]}

Or without the blacklist:

{"extends": ["optimize-regex/all"]}

Rules

Inspiration

License

MIT © Ezinwa Okpoechi

About

Optimize regex literals

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors9


[8]ページ先頭

©2009-2025 Movatter.jp