Ctrl + K
DocumentationLog inGet started

tessl/npm-eslint-plugin-regexp

tessl install tessl/npm-eslint-plugin-regexp@2.10.0

ESLint plugin for finding RegExp mistakes and RegExp style guide violations.

Agent Success

Agent success rate when using this tile

82%

Improvement

Agent success rate improvement when using this tile compared to baseline

0.96x

Baseline

Agent success rate without this tile

85%

task.mdevals/scenario-9/

Range-Limited Regex Linting

Build an ESLint helper that enforces regex character class ranges while respecting configurable allowed character ranges.

Capabilities

Build range-aware lint configs

  • createRangeLintConfig() returns both legacy and flat ESLint config objects that attach the regex linting plugin, set settings.regexp.allowedCharacterRanges to ["alphanumeric"] when not provided, and enable character-class range optimization plus disallowed-range detection as errors. @test

Optimize allowed contiguous sets

  • lintPatterns("const rx = /[ABCDE]/;") with default options reports a single range-optimization issue, applies the autofix to [A-E], leaves zero disallowed-range issues, and returns the rewritten source in output. @test

Block disallowed ranges cleanly

  • lintPatterns("const rx = /[πŸ˜€πŸ˜πŸ˜‚πŸ˜ƒ]/u;", { allowedRanges: "alphanumeric" }) leaves the input unchanged, reports at least one disallowed-range issue for characters outside the allowed ranges, and reports zero range-optimization fixes because the forbidden characters prevent range creation. @test

Implementation

@generates

API

export type AllowedRanges = string | readonly string[];

export interface RangeConfigShape {
  plugins: unknown;
  rules: Record<string, unknown>;
  settings: { regexp: { allowedCharacterRanges: AllowedRanges } };
}

export interface RangeConfig {
  legacy: RangeConfigShape;
  flat: RangeConfigShape;
}

export interface LintSummary {
  errorCount: number;
  warningCount: number;
  rangeIssues: number;
  disallowedRangeIssues: number;
  output: string;
}

export function createRangeLintConfig(options?: { allowedRanges?: AllowedRanges }): RangeConfig;

export function lintPatterns(
  code: string,
  options?: { allowedRanges?: AllowedRanges; autofix?: boolean }
): Promise<LintSummary>;

Dependencies { .dependencies }

eslint-plugin-regexp { .dependency }

Regex-focused ESLint plugin that optimizes character sets and respects allowedCharacterRanges.

eslint { .dependency }

ESLint engine used to apply the plugin and autofixes.

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/eslint-plugin-regexp@2.10.x
tile.json