1.2.1 • Published 4 years ago

eslint-plugin-optimize-regex v1.2.1

Weekly downloads
19,136
License
MIT
Repository
github
Last release
4 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-miszomext-editorweb-ui-deps@developer-kit/eslint-config@bence.a.toth/eslint-config@al/eslint-config-alertlogic@alt-code/linters-config@budarin/spa-react-app-config@bosscard/eslint-config@destinationstransfers/eslint-config@destinationstransfers/eslint-plugin@greenatom/dotfiles@flexbe/eslint-config@freaktechnik/eslint-config-base@laozhu/eslint-config@leblanccodes/eslint-config@lottiefiles/eslint-plugin@ishtar-gate/eslint-config-custom@newsteam/eslint@nirtamir2/eslint-config@ehacke/eslint-config@max-norin/ts-project-init@mblabs/eslint-config@megabytelabs/eslint-config@jenssimon/eslint-config-base@i-novus/eslint-config@ineedj/eslintrc@react-nevka/eslint-config@quark-uilib/dotfiles@scagood/eslint-config@reki/eslint-config-base@searchspring/eslint-config@roleup/eslint-config@warrify/eslint-config@washi/eslint-config@wasc/tools@washingtondc/eslint@typedigital/eslint-config@xtrctio/eslint-config@sweetlikepete/eslint@taknepoidet-config/eslint-config@tamland/eslinteslint-config-lifioneslint-config-lifion-webeslint-config-peerigoneslint-config-reform-collectiveeslint-config-tiphedoreslint-config-nirtamir2eslint-config-noamkadosheslint-config-yaruseslint-config-typedigitaleslint-config-strict-modeeslint-config-suiyobieslint-config-simplesenseeslint-config-zumataeslint-config-flexbeeslint-config-dougkulakeslint-config-atomiceslint-config-backendeslint-config-bbvaeslint-config-airlight-baseeslint-config-evil-vueeslint-config-bis-baseeslint-config-dsx-baseeslint-config-hardestyeslint-config-fukseslint-config-saiichihashimotoeslint-prettier-husky-configeslint-plugin-ni-ps-lint
1.2.1

4 years ago

1.2.0

5 years ago

1.1.7

6 years ago

1.1.6

7 years ago

1.1.5

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago

0.1.0

8 years ago