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
Description
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;
// ...
}
}