Skip to content

False positives when meta contains spread with prefer-message-ids, require-meta-type, require-meta-fixable, require-meta-schema #274

@bmish

Description

@bmish

When there's a spread inside the meta object that we can't evaluate, we might want to stop flagging these violations since likely the spread fills these properties in already:

 23:9 error `meta.messages` must contain at least one violation message eslint-plugin/prefer-message-ids 23:9 error `meta.type` is required (must be either `problem`, `suggestion`, or `layout`) eslint-plugin/require-meta-type 23:9 error `meta.fixable` must be either `code` or `whitespace` for fixable rules eslint-plugin/require-meta-fixable 23:9 error `meta.schema` has no schema defined but rule has options eslint-plugin/require-meta-schema 
export default createRule<Options, MessageIds>({ name: 'object-curly-spacing', meta: { ...baseRule.meta, docs: { /* ... * / } } });

Example: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/rules/object-curly-spacing.ts

This issue is not specific to TypeScript.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions