import regexpPlugin from 'eslint-plugin-regexp'; import { defineConfig } from 'eslint/config'; /** * https://github.com/ota-meshi/eslint-plugin-regexp/blob/master/lib/configs/recommended.ts */ export const recommended = defineConfig({ files: ['**/*.{js,jsx,cjs,mjs,ts,tsx}'], plugins: { regexp: regexpPlugin, }, rules: { 'no-control-regex': 2, 'no-empty-character-class': 0, 'no-invalid-regexp': 'off', 'no-misleading-character-class': 2, 'no-regex-spaces': 2, 'no-useless-backreference': 'off', 'prefer-regex-literals': 2, 'regexp/confusing-quantifier': 'warn', 'regexp/control-character-escape': 2, 'regexp/match-any': 2, 'regexp/negation': 2, 'regexp/no-dupe-characters-character-class': 2, 'regexp/no-dupe-disjunctions': 2, 'regexp/no-empty-alternative': 'warn', 'regexp/no-empty-capturing-group': 2, 'regexp/no-empty-group': 2, 'regexp/no-empty-lookarounds-assertion': 2, 'regexp/no-escape-backspace': 2, 'regexp/no-invalid-regexp': 2, 'regexp/no-invisible-character': 2, 'regexp/no-lazy-ends': 'warn', 'regexp/no-legacy-features': 2, 'regexp/no-non-standard-flag': 2, 'regexp/no-obscure-range': 2, 'regexp/no-optional-assertion': 2, 'regexp/no-potentially-useless-backreference': 'warn', 'regexp/no-super-linear-backtracking': 2, 'regexp/no-trivially-nested-assertion': 2, 'regexp/no-trivially-nested-quantifier': 2, 'regexp/no-unused-capturing-group': 2, 'regexp/no-useless-assertions': 2, 'regexp/no-useless-backreference': 2, 'regexp/no-useless-character-class': 2, 'regexp/no-useless-dollar-replacements': 2, 'regexp/no-useless-escape': 2, 'regexp/no-useless-flag': 'warn', 'regexp/no-useless-lazy': 2, 'regexp/no-useless-non-capturing-group': 2, 'regexp/no-useless-quantifier': 2, 'regexp/no-useless-range': 2, 'regexp/no-useless-two-nums-quantifier': 2, 'regexp/no-zero-quantifier': 2, 'regexp/optimal-lookaround-quantifier': 'warn', 'regexp/optimal-quantifier-concatenation': 2, 'regexp/prefer-character-class': 2, 'regexp/prefer-d': 2, 'regexp/prefer-plus-quantifier': 2, 'regexp/prefer-predefined-assertion': 2, 'regexp/prefer-question-quantifier': 2, 'regexp/prefer-range': 2, 'regexp/prefer-star-quantifier': 2, 'regexp/prefer-unicode-codepoint-escapes': 2, 'regexp/prefer-w': 2, 'regexp/sort-flags': 2, 'regexp/strict': 2, }, });