Skip to content

Commit

Permalink
fix(utils): add missing fields to flat config types (#7933)
Browse files Browse the repository at this point in the history
  • Loading branch information
bradzacher committed Nov 15, 2023
1 parent 3c8312d commit 533861a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
1 change: 1 addition & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
"serializers",
"Sourcegraph",
"stringification",
"stringly",
"superset",
"thenables",
"transpiled",
Expand Down
24 changes: 23 additions & 1 deletion packages/utils/src/ts-eslint/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,36 @@ export namespace FlatConfig {
export type SeverityString = SharedConfig.SeverityString;
export type SourceType = ParserOptionsTypes.SourceType | 'commonjs';

export interface PluginMeta {
/**
* The meta.name property should match the npm package name for your plugin.
*/
name: string;
/**
* The meta.version property should match the npm package version for your plugin.
*/
version: string;
}
export interface Plugin {
/**
* Shared configurations bundled with the plugin.
* Users will reference these directly in their config (i.e. `plugin.configs.recommended`).
*/
configs?: Record<string, Config>;
/**
* Metadata about your plugin for easier debugging and more effective caching of plugins.
*/
meta?: PluginMeta;
/**
* The definition of plugin processors.
* Can be referenced by string in the config (i.e., `"pluginName/processorName"`).
* Users can stringly reference the processor using the key in their config (i.e., `"pluginName/processorName"`).
*/
processors?: Record<string, Processor>;
/**
* The definition of plugin rules.
* The key must be the name of the rule that users will use
* Users can stringly reference the rule using the key they registered the plugin under combined with the rule name.
* i.e. for the user config `plugins: { foo: pluginReference }` - the reference would be `"foo/ruleName"`.
*/
rules?: Record<string, RuleCreateFunction | AnyRuleModule>;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/src/ts-eslint/Linter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ namespace Linter {
export type Severity = SharedConfig.Severity;
export type SeverityString = SharedConfig.SeverityString;

/** @deprecated use ClassicConfig.ConfigType instead */
/** @deprecated use Linter.ConfigType instead */
export type Config = ClassicConfig.Config;
export type ConfigType = ClassicConfig.Config | FlatConfig.ConfigArray;
/** @deprecated use ClassicConfig.ConfigOverride instead */
Expand Down

0 comments on commit 533861a

Please sign in to comment.