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

Regex Lint Presets Setup

Configure ESLint to lint regex usage via the regex plugin's built-in presets for both flat and legacy config formats.

Capabilities

Flat configuration

  • npm run lint:flat uses ESLint's flat config format and the plugin's flat preset to lint all JS/TS files in src/; linting src/patterns.js with a duplicate alternative like (foo|foo) exits non-zero and reports the regex issue. @test
  • After replacing the duplicate alternative with a unique pattern, running npm run lint:flat completes with zero errors. @test

Legacy configuration

  • npm run lint:legacy uses a legacy .eslintrc that registers the plugin and extends its legacy preset to lint files in legacy/; linting legacy/replace.js with replaceAll using a non-global regex reports the missing global-flag issue. @test
  • The legacy config ignores legacy/vendor/, so files there are skipped by linting. @test

Implementation

@generates

API

{
  "scripts": {
    "lint:flat": "eslint src",
    "lint:legacy": "eslint --config .eslintrc.cjs legacy"
  }
}

Dependencies { .dependencies }

eslint { .dependency }

JavaScript/TypeScript linting engine.

eslint-plugin-regexp { .dependency }

Provides regex-focused lint rules and presets for flat and legacy config formats.

Install with Tessl CLI

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

tile.json