Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(utils): add missing fields to flat config types #7933

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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