CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-eslint-plugin-regexp

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

82

0.96x
Overview
Eval results
Files

task.mdevals/scenario-3/

Regex Autofix Assistant

A small module that runs regex-focused linting, applies available autofixes from the regex plugin, and reports remaining suggestions.

Capabilities

Apply autofixes from regex rules

  • When given source code that contains a regex pattern with an autofixable issue (for example, a redundant character class wrapping a single token), the returned summary applies the package's autofix so the pattern is rewritten and records the corresponding rule id in appliedFixes. @test

Report remaining suggestions

  • When linting source with regex issues that the package flags without an autofix, the original code is preserved while suggestions collects the rule id, message, and range for each finding; when applySuggestions is enabled, apply the package-provided suggestion fixes before reporting. @test

Toggle between rule presets

  • Linting the same source with the stricter preset yields at least as many findings as the recommended preset, allowing comparison of how many autofixes and suggestions each preset produces. @test

Implementation

@generates

API

export type RuleCoverage = "recommended" | "all";

export interface LintSummary {
  fixedCode: string;
  appliedFixes: Array<{ ruleId: string; message: string }>;
  suggestions: Array<{ ruleId: string; message: string; range: [number, number] }>;
}

export interface LintOptions {
  config?: RuleCoverage;
  applySuggestions?: boolean;
}

export async function lintRegexSource(source: string, options?: LintOptions): Promise<LintSummary>;

export async function lintRegexFile(inputPath: string, outputPath: string, options?: LintOptions): Promise<LintSummary>;

Dependencies { .dependencies }

eslint-plugin-regexp { .dependency }

Provides regex-focused ESLint rules with autofixes and suggestions. @satisfied-by

Install with Tessl CLI

npx tessl i tessl/npm-eslint-plugin-regexp

tile.json