Skip to content

fix: add missing types for no-misleading-character-class options - #18905

Merged
snitin315 merged 1 commit into
eslint:mainfrom
kripod:patch-5
Sep 16, 2024
Merged

snitin315 merged 1 commit into
eslint:mainfrom
kripod:patch-5

Conversation

@kripod

@kripod kripod commented Sep 15, 2024 •

Copy link
Copy Markdown
Contributor

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[ ] Documentation update
[x] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

Tell us about your environment (npx eslint --env-info):

  • Node version: v22.8.0
  • npm version: v10.8.2
  • Local ESLint version: v9.10.0 (Currently used)
  • Global ESLint version: Not found
  • Operating System: darwin 23.6.0

What parser are you using (place an "X" next to just one item)?

N/A

Please show your full configuration:

N/A

What did you do? Please include the actual source code causing the issue.

Tried to create a custom config using TypeScript as follows:

import type { Linter } from "eslint";
import type { ESLintRules } from "eslint/rules";

export default {
  rules: {
    "no-misleading-character-class": [
      "error",
      { allowEscape: true }, // does not exist in type
    ],
  },
} satisfies Linter.Config<ESLintRules>;

What did you expect to happen?

Options existing at runtime should be available on the type level.

What actually happened? Please include the actual, raw output from ESLint.

TypeScript flagged a type-level issue as highlighted in the comment above.

What changes did you make? (Give an overview)

Fixed the types to include missing allowEscape option for the no-misleading-character-class rule.

Is there anything you'd like reviewers to focus on?

N/A

@kripod
kripod requested a review from a team as a code owner September 15, 2024 05:19
@eslint-github-bot eslint-github-bot Bot added the bug ESLint is working incorrectly label Sep 15, 2024
@netlify

ghost commented Sep 15, 2024 •

Copy link
Copy Markdown

✅ Deploy Preview for docs-eslint ready!

Name Link
🔨 Latest commit 9cdd353
🔍 Latest deploy log https://app.netlify.com/sites/docs-eslint/deploys/66e66e648ae44100089d27ce
😎 Deploy Preview https://deploy-preview-18905--docs-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

ghost left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
no-misleading-character-class option - https://eslint.org/docs/latest/rules/no-misleading-character-class#options
I would like to have this reviewed by the ESLint team before marking it as accepted.

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you.

@snitin315 snitin315 added the accepted There is consensus among the team that this change meets the criteria for inclusion label Sep 16, 2024
@snitin315
snitin315 merged commit 2de5742 into eslint:main Sep 16, 2024
@kripod
kripod deleted the patch-5 branch September 16, 2024 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accepted There is consensus among the team that this change meets the criteria for inclusion bug ESLint is working incorrectly contributor pool

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

4 participants