Skip to content

fix: add missing types for camelcase options#18897

Merged
snitin315 merged 1 commit intoeslint:mainfrom
kripod:patch-1
Sep 16, 2024
Merged

fix: add missing types for camelcase options#18897
snitin315 merged 1 commit intoeslint:mainfrom
kripod:patch-1

Conversation

@kripod
Copy link
Copy Markdown
Contributor

@kripod kripod commented Sep 13, 2024

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: {
    camelcase: [
      "warn",
      {
        properties: "never",
        ignoreDestructuring: true,
        ignoreImports: true, // does not exist in type
        ignoreGlobals: 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 comments above.

What changes did you make? (Give an overview)

Fixed the types to include ignoreImports and ignoreGlobals options for the camelcase rule.

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

N/A

Loading
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