Skip to content
This repository has been archived by the owner on Oct 11, 2021. It is now read-only.

Releases: RunDevelopment/eslint-plugin-clean-regex

Deprecation

11 Oct 12:52
Compare
Choose a tag to compare

The project is now officially deprecated and will not be worked on anymore.

Please use eslint-plugin-regexp instead. You can find a migration guide here.

v0.5.1...v0.5.2

0.5.1

25 Mar 17:33
Compare
Choose a tag to compare

Lots of minor fixes and improvements.

Added

  • Contributing guide and issue templates

Changed

  • no-trivially-nested-quantifier: Improved the condition that decides whether quantifiers are trivially nested. The rule will now be able to detect more cases.
  • Improved many functions that analyse the RegExp AST.
  • Updated to latest refa version.

Fixed

  • Some typos.

v0.5.0...v0.5.1

0.5.0

26 Oct 21:50
Compare
Choose a tag to compare

I ❤️ Typescript + Prettier!

The whole project is now implemented in Typescript and uses Prettier for formatting.

Added

  • no-obscure-range: A new rule to report most likely unintended ranges in character classes due to unescaped -s.
  • no-empty-alternative: A new rule to detect empty alternatives in groups and patterns that are likely a mistake.
  • prefer-predefined-assertion: This will suggest predefined assertions (\b\B^$) if a lookaround behaves like one.
  • disjoint-alternatives: A new rule to report disjoint alternatives to prevent mistakes and exponential backtracking.
  • no-trivially-nested-quantifier: A new rule to fix trivially quantifiers.

Changed

  • no-unnecessary-group: New option to allow non-capturing groups that wrap the whole regex.
  • prefer-character-class: The rule is now also active inside lookarounds, will reorder alternatives, and more aggressively merge into existing character classes.
  • no-unnecessary-lazy: It can now analyse single-character quantifiers.
  • prefer-predefined-character-set: It will now leave 0-9 as is.
  • optimal-concatenation-quantifier: It can now merge characters and quantifiers.
  • New rules table in README.
  • Better error messages for a lot of rules.

Fixed

  • no-empty-lookaround didn't handle backreferences correctly.
  • Many, many typos and other mistakes in the docs.

0.4.0

04 May 22:05
Compare
Choose a tag to compare

Clean regex now uses refa, a library for NFA and DFA operations and converting JS RegExp to NFA.
Right now, this plugin only really uses the CharSet API but implementing more complex rules is now possible!

Added

  • no-unnecessary-assertions: A new rule to report trivially accepting/rejecting assertions.
  • simple-constant-quantifier: A new rule to simplify constant quantifiers with use the range syntax (e.g. a{2,2}).
  • Added changelog.

Changed

  • optimized-character-class: Improved reporting and fixing thanks to a new implementation based on refa's character sets.

v0.3.0...v0.4.0