Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: always refer to eslint-plugin-regexp #1808

Merged
merged 1 commit into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/Options.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Alternately, you can bypass that prompt by providing any number of the following
- `--exclude-lint-jsdoc`: Don't use eslint-plugin-jsdoc to enforce good practices around JSDoc comments.
- `--exclude-lint-packages`: Don't add a pnpm dedupe workflow to ensure packages aren't duplicated unnecessarily.
- `--exclude-lint-perfectionist`: Don't apply eslint-plugin-perfectionist to ensure imports, keys, and so on are in sorted order.
- `--exclude-lint-regex`: Don't add eslint-plugin-regex to enforce good practices around regular expressions.
- `--exclude-lint-regexp`: Don't add eslint-plugin-regexp to enforce good practices around regular expressions.
- `--exclude-lint-strict`: Don't augment the recommended logical lint rules with typescript-eslint's strict config.
- `--exclude-lint-stylistic`: Don't add stylistic rules such as typescript-eslint's stylistic config.
- `--exclude-lint-spelling`: Don't add cspell to spell check against dictionaries of known words.
Expand Down
8 changes: 4 additions & 4 deletions docs/Tooling.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ This table summarizes each tooling piece and which base levels they're included
| [Lint Package JSON](#lint-package-json) | `--exclude-lint-package-json` | | | 💯 |
| [Lint Packages](#lint-packages) | `--exclude-lint-packages` | | | 💯 |
| [Lint Perfectionist](#lint-perfectionist) | `--exclude-lint-perfectionist` | | | 💯 |
| [Lint Regex](#lint-regex) | `--exclude-lint-regex` | | | 💯 |
| [Lint Regexp](#lint-regexp) | `--exclude-lint-regexp` | | | 💯 |
| [Lint Spelling](#lint-spelling) | `--exclude-lint-spelling` | | | 💯 |
| [Lint Strict](#lint-strict) | `--exclude-lint-strict` | | | 💯 |
| [Lint Stylistic](#lint-stylistic) | `--exclude-lint-stylistic` | | | 💯 |
Expand Down Expand Up @@ -226,7 +226,7 @@ Using the _"everything"_ level will gain you comprehensive, strict coverage of a
- [Lint Package JSON](#lint-package-json)
- [Lint Packages](#lint-packages)
- [Lint Perfectionist](#lint-perfectionist)
- [Lint Regex](#lint-regex)
- [Lint Regexp](#lint-regexp)
- [Lint Spelling](#lint-spelling)
- [Lint Strict](#lint-strict)
- [Lint Stylistic](#lint-stylistic)
Expand Down Expand Up @@ -277,9 +277,9 @@ pnpm lint:packages
[`eslint-plugin-perfectionist`](https://eslint-plugin-perfectionist.azat.io): Lints for sorting properties, imports, etc.
This plugin is quite particular -perfectionist, even- but all its rules include auto-fixers that can correct complaints for you.

### Lint Regex
### Lint Regexp

[`eslint-plugin-regex`](https://github.com/gmullerb/eslint-plugin-regex): Detects issues with JavaScript regular expressions, such as potential exponential complexity.
[`eslint-plugin-regexp`](https://github.com/ota-meshi/eslint-plugin-regexp): Detects issues with JavaScript regular expressions, such as potential exponential complexity.

### Lint Spelling

Expand Down
2 changes: 1 addition & 1 deletion src/bin/help.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ describe("logHelpText", () => {
],
[
"
--exclude-lint-regex: Don't add eslint-plugin-regex to enforce good practices around
--exclude-lint-regexp: Don't add eslint-plugin-regexp to enforce good practices around
regular expressions.",
],
[
Expand Down
4 changes: 2 additions & 2 deletions src/shared/options/args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ export const allArgOptions = {
docsSection: "opt-out",
type: "boolean",
},
"exclude-lint-regex": {
description: `Don't add eslint-plugin-regex to enforce good practices around
"exclude-lint-regexp": {
description: `Don't add eslint-plugin-regexp to enforce good practices around
regular expressions.`,
docsSection: "opt-out",
type: "boolean",
Expand Down
8 changes: 4 additions & 4 deletions src/shared/options/augmentOptionsWithExcludes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const optionsBase = {
excludeLintPackageJson: undefined,
excludeLintPackages: undefined,
excludeLintPerfectionist: undefined,
excludeLintRegex: undefined,
excludeLintRegexp: undefined,
excludeLintSpelling: undefined,
excludeLintStrict: undefined,
excludeLintStylistic: undefined,
Expand Down Expand Up @@ -96,7 +96,7 @@ describe("augmentOptionsWithExcludes", () => {
excludeLintPackageJson: true,
excludeLintPackages: true,
excludeLintPerfectionist: true,
excludeLintRegex: true,
excludeLintRegexp: true,
excludeLintSpelling: true,
excludeLintStrict: true,
excludeLintStylistic: true,
Expand Down Expand Up @@ -137,7 +137,7 @@ describe("augmentOptionsWithExcludes", () => {
excludeLintPackageJson: true,
excludeLintPackages: true,
excludeLintPerfectionist: true,
excludeLintRegex: true,
excludeLintRegexp: true,
excludeLintSpelling: true,
excludeLintStrict: true,
excludeLintStylistic: true,
Expand Down Expand Up @@ -165,7 +165,7 @@ describe("augmentOptionsWithExcludes", () => {
excludeLintPackageJson: true,
excludeLintPackages: true,
excludeLintPerfectionist: true,
excludeLintRegex: true,
excludeLintRegexp: true,
excludeLintSpelling: true,
excludeLintStrict: true,
excludeLintStylistic: true,
Expand Down
6 changes: 3 additions & 3 deletions src/shared/options/exclusionKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ export const exclusionDescriptions: Record<ExclusionKey, ExclusionDescription> =
"Apply eslint-plugin-perfectionist to ensure imports, keys, and so on are in sorted order.",
level: "common",
},
excludeLintRegex: {
hint: "--exclude-lint-regex",
excludeLintRegexp: {
hint: "--exclude-lint-regexp",
label:
"Include eslint-plugin-regex to enforce good practices around regular expressions.",
"Include eslint-plugin-regexp to enforce good practices around regular expressions.",
level: "common",
},
excludeLintSpelling: {
Expand Down
2 changes: 1 addition & 1 deletion src/shared/options/optionsSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const optionsSchemaShape = {
excludeLintPackageJson: z.boolean().optional(),
excludeLintPackages: z.boolean().optional(),
excludeLintPerfectionist: z.boolean().optional(),
excludeLintRegex: z.boolean().optional(),
excludeLintRegexp: z.boolean().optional(),
excludeLintSpelling: z.boolean().optional(),
excludeLintStrict: z.boolean().optional(),
excludeLintStylistic: z.boolean().optional(),
Expand Down
4 changes: 2 additions & 2 deletions src/shared/options/readOptions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const emptyOptions = {
excludeLintPackageJson: undefined,
excludeLintPackages: undefined,
excludeLintPerfectionist: undefined,
excludeLintRegex: undefined,
excludeLintRegexp: undefined,
excludeLintSpelling: undefined,
excludeLintStrict: undefined,
excludeLintYml: undefined,
Expand Down Expand Up @@ -809,7 +809,7 @@ describe("readOptions", () => {
"excludeLintPackageJson": undefined,
"excludeLintPackages": undefined,
"excludeLintPerfectionist": undefined,
"excludeLintRegex": undefined,
"excludeLintRegexp": undefined,
"excludeLintSpelling": undefined,
"excludeLintStrict": undefined,
"excludeLintYml": undefined,
Expand Down
2 changes: 1 addition & 1 deletion src/shared/options/readOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export async function readOptions(
excludeLintPackageJson: values["exclude-lint-package-json"],
excludeLintPackages: values["exclude-lint-packages"],
excludeLintPerfectionist: values["exclude-lint-perfectionist"],
excludeLintRegex: values["exclude-lint-regex"],
excludeLintRegexp: values["exclude-lint-regexp"],
excludeLintSpelling: values["exclude-lint-spelling"],
excludeLintStrict: values["exclude-lint-strict"],
excludeLintYml: values["exclude-lint-yml"],
Expand Down
2 changes: 1 addition & 1 deletion src/shared/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export interface Options {
excludeLintPackageJson?: boolean;
excludeLintPackages?: boolean;
excludeLintPerfectionist?: boolean;
excludeLintRegex?: boolean;
excludeLintRegexp?: boolean;
excludeLintSpelling?: boolean;
excludeLintStrict?: boolean;
excludeLintStylistic?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/steps/finalizeDependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export async function finalizeDependencies(options: Options) {
...(options.excludeLintPerfectionist
? []
: ["eslint-plugin-perfectionist"]),
...(options.excludeLintRegex ? [] : ["eslint-plugin-regexp"]),
...(options.excludeLintRegexp ? [] : ["eslint-plugin-regexp"]),
...(options.excludeLintSpelling ? [] : ["cspell"]),
...(options.excludeLintYml ? [] : ["eslint-plugin-yml"]),
...(options.excludeReleases
Expand Down
2 changes: 1 addition & 1 deletion src/steps/writing/creation/createESLintConfig.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function fakeOptions(getExcludeValue: (exclusionName: string) => boolean) {
"excludeLintPackageJson",
"excludeLintPackages",
"excludeLintPerfectionist",
"excludeLintRegex",
"excludeLintRegexp",
"excludeLintSpelling",
"excludeLintStrict",
"excludeLintStylistic",
Expand Down
4 changes: 2 additions & 2 deletions src/steps/writing/creation/createESLintConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export async function createESLintConfig(options: Options) {
`import packageJson from "eslint-plugin-package-json/configs/recommended";`,
!options.excludeLintPerfectionist &&
`import perfectionist from "eslint-plugin-perfectionist";`,
!options.excludeLintRegex &&
!options.excludeLintRegexp &&
`import * as regexp from "eslint-plugin-regexp";`,
!options.excludeLintYml && `import yml from "eslint-plugin-yml";`,
`import tseslint from "typescript-eslint";`,
Expand All @@ -36,7 +36,7 @@ export async function createESLintConfig(options: Options) {
!options.excludeLintPackageJson && ` packageJson,`,
!options.excludeLintPerfectionist &&
` perfectionist.configs["recommended-natural"],`,
!options.excludeLintRegex && ` regexp.configs["flat/recommended"],`,
!options.excludeLintRegexp && ` regexp.configs["flat/recommended"],`,
].filter(Boolean);

const ignores = [
Expand Down
2 changes: 1 addition & 1 deletion src/steps/writing/creation/dotVSCode.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function fakeOptions(
"excludeLintPackageJson",
"excludeLintPackages",
"excludeLintPerfectionist",
"excludeLintRegex",
"excludeLintRegexp",
"excludeLintSpelling",
"excludeLintStrict",
"excludeLintStylistic",
Expand Down
Loading