🌐 AI搜索 & 代理 主页
Skip to content

[feature request] Expose the rule name as a property #11608

@gajus

Description

@gajus
const createRule = ESLintUtils.RuleCreator(
  (name) => `https://github.com/gajus/eslint-plugin-panda/blob/main/docs/rules/${name}.md`,
)

const myRule = createRule({
  name: 'no-config-function-in-source',
  // ...
});

At the moment, there is no way to get the name of the myRule.

The current situation forces weird patterns like:

export const RULE_NAME = 'no-config-function-in-source'

export default createRule({
  name: RULE_NAME,
  // ...
});

Ideally, we could get it via myRule.name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions