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-6/

Regex Correctness Lint Reporter

Build a module that lints JavaScript or TypeScript source for regex correctness issues, focusing on invalid syntax, duplicate constructs, and empty structures. The module should expose functions that run the linter against in-memory source strings or filesystem paths and return normalized issue data.

Capabilities

Detects invalid regex patterns

  • Linting a source containing new RegExp("[") reports at least one issue; the message mentions the invalid pattern and the ruleId reflects a regex-focused lint rule. @test

Detects duplicate constructs

  • Linting a source containing /foo|foo/ returns an issue that captures the duplicate branch and includes its pattern text. @test

Detects empty constructs

  • Linting a source containing /()/ reports an issue pinpointing the empty construct with its location. @test

Normalized issue output

  • Returned issues are sorted by filename then position; each issue includes filename, ruleId, message, pattern, line, and column values. @test

Implementation

@generates

API

export interface SourceInput {
  filename: string;
  code: string;
}

export interface RegexIssue {
  filename: string;
  ruleId: string;
  message: string;
  pattern: string;
  line: number;
  column: number;
}

export async function lintRegexSources(inputs: SourceInput[]): Promise<RegexIssue[]>;

export async function lintPaths(globs: string[]): Promise<RegexIssue[]>;

Dependencies { .dependencies }

eslint-plugin-regexp { .dependency }

Provides regex-focused linting for invalid syntax, duplicate elements, and empty constructs.

eslint { .dependency }

Used to execute the linting engine.

Version

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