ESLint plugin for finding RegExp mistakes and RegExp style guide violations.
82
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.
new RegExp("[") reports at least one issue; the message mentions the invalid pattern and the ruleId reflects a regex-focused lint rule. @test/foo|foo/ returns an issue that captures the duplicate branch and includes its pattern text. @test/()/ reports an issue pinpointing the empty construct with its location. @testfilename, ruleId, message, pattern, line, and column values. @test@generates
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[]>;Provides regex-focused linting for invalid syntax, duplicate elements, and empty constructs.
Used to execute the linting engine.
Install with Tessl CLI
npx tessl i tessl/npm-eslint-plugin-regexpevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10