Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including eslint-plugin-optimize-regex with all npm packages installed. Try it out:

var eslintPluginOptimizeRegex = require("eslint-plugin-optimize-regex")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

eslint-plugin-optimize-regex v1.1.7

Optimize regex literals


npm npm

Optimize regex literals


You'll first need to install ESLint:

npm i eslint --save-dev

Next, install eslint-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 install eslint-plugin-optimize-regex globally.


Add optimize-regex to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

    "plugins": [

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

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




MIT © Ezinwa Okpoechi

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free