1.2.1 • Published 3 years ago

eslint-plugin-optimize-regex v1.2.1

Weekly downloads
19,136
License
MIT
Repository
github
Last release
3 years ago

eslint-plugin-optimize-regex

npm npm

Optimize regex literals

Installation

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.

Usage

Add optimize-regex to the plugins section of your .eslintrc configuration file. You can omit the eslint-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 a whitelist or blacklist array against regexp-tree's transforms, 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 setting plugins and rules and just use:

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

Or without the blacklist:

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

Rules

Inspiration

License

MIT © Ezinwa Okpoechi

eslint-config-slick@swallowtail/eslint-config@miszo/eslint-config@alfabank/eslint-config-site@infinitebrahmanuniverse/nolb-eslint-plugin-o@everything-registry/sub-chunk-1613eslint-config-miszo@emhamzahazeen/eslint-config-base@ehacke/eslint-config@flexbe/eslint-configeslint-config-evil-vueeslint-config-lifioneslint-config-lifion-webeslint-config-bis-baseeslint-config-nirtamir2eslint-config-noamkadosheslint-config-dsx-baseeslint-config-dougkulakeslint-config-peerigoneslint-config-hardestyeslint-config-yaruseslint-config-saiichihashimotoeslint-config-suiyobieslint-config-strict-modeeslint-config-reform-collectiveeslint-config-typedigitaleslint-config-zumataeslint-config-simplesenseeslint-config-tiphedoreslint-plugin-ni-ps-linteslint-config-atomiceslint-config-backendeslint-config-bbvaeslint-config-airlight-baseeslint-config-flexbe@quark-uilib/dotfiles@roleup/eslint-config@react-nevka/eslint-config@reki/eslint-config-base@searchspring/eslint-config@scagood/eslint-config@sweetlikepete/eslint@taknepoidet-config/eslint-config@tamland/eslint@typedigital/eslint-config@warrify/eslint-config@washi/eslint-config@washingtondc/eslint@wasc/tools@tool-belt/eslint-config@xtrctio/eslint-configmext-editorweb-ui-deps@developer-kit/eslint-config@destinationstransfers/eslint-config@destinationstransfers/eslint-plugin@bosscard/eslint-config@al/eslint-config-alertlogic@budarin/spa-react-app-config@alt-code/linters-config@bence.a.toth/eslint-config@greenatom/dotfiles@jenssimon/eslint-config-base@freaktechnik/eslint-config-base@ishtar-gate/eslint-config-custom@i-novus/eslint-config@leblanccodes/eslint-config@laozhu/eslint-config@lottiefiles/eslint-plugin@max-norin/ts-project-init@mblabs/eslint-config@megabytelabs/eslint-config@newsteam/eslint
1.2.1

3 years ago

1.2.0

4 years ago

1.1.7

5 years ago

1.1.6

6 years ago

1.1.5

6 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago

0.1.0

7 years ago