Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Support augmented global properties #233

Closed
@Shinigami92

Description

@Shinigami92

Vue has something like this: https://vuejs.org/guide/typescript/options-api.html#augmenting-global-properties

@antfu suggested to try out to support this, so plugin authors can define their own TypeScript definitions and eslint-define-config would then just use these.

So code in the specific plugin projects would look like this:

import type { DeprecationRuleConfig } from './rules/deprecation/deprecation';

declare module 'eslint-define-config' {
  interface Rules {
    /**
     * Do not use deprecated APIs.
     *
     * @see [deprecation](https://github.com/gund/eslint-plugin-deprecation)
     */
    'deprecation/deprecation'?: DeprecationRuleConfig;
  }
}
import type { AdjacentOverloadSignaturesRuleConfig } from './rules/typescript-eslint/adjacent-overload-signatures';
// ...

declare module 'eslint-define-config' {
  interface Rules {
    /**
     * Require that function overload signatures be consecutive.
     *
     * @see [adjacent-overload-signatures](https://typescript-eslint.io/rules/adjacent-overload-signatures)
     */
    '@typescript-eslint/adjacent-overload-signatures'?: AdjacentOverloadSignaturesRuleConfig;
    // ...
  }
}

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions