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

Unicode-Safe Regex Linting

Create an ESLint flat config snippet that enforces safe Unicode handling in regular expressions, ensuring engineers rely on Unicode-aware flags, code point escapes, and canonical property names. Tests lint sample files with this config; patterns marked as passing should produce no violations, while failing patterns should surface at least one Unicode-focused lint error.

Capabilities

Requires Unicode-aware flags

  • A pattern using Unicode property escapes without a u or v flag is reported; the same pattern passes when the flag is present. @test
  • A pattern containing an astral character literal (e.g., 😀) without a Unicode-aware flag is reported, while the pattern passes when written with a code point escape and the proper flag. @test

Prefers code point escapes

  • A pattern that encodes an astral symbol via surrogate pairs or raw literal is reported, and autofix rewrites it to a \u{...} code point escape under a Unicode-aware flag. @test

Normalizes property names

  • A pattern using non-canonical Unicode property keys or casing (e.g., \p{sc=grEek}) is reported; the canonical form (e.g., \p{Script=Greek}) passes. @test

Implementation

@generates

API

// Returns an ESLint flat config array that enforces unicode-safe regex linting.
// Configuration must enable only the rules necessary for Unicode flags, code point escapes, and property name normalization.
export function createUnicodeRegexConfig(): import('eslint').Linter.FlatConfig[];

Dependencies { .dependencies }

eslint-plugin-regexp { .dependency }

Provides regex-focused ESLint rules with Unicode-aware checks and autofixes.

Install with Tessl CLI

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

tile.json