Skip to content

feat(utils): add Linter configType constructor option #8999

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

Merged
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/utils/src/ts-eslint/Linter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,19 @@ declare class LinterBase {

namespace Linter {
export interface LinterOptions {
/**
* Which config format to use.
* @default 'flat'
*/
configType?: ConfigTypeSpecifier;

/**
* path to a directory that should be considered as the current working directory.
*/
cwd?: string;
}

export type ConfigTypeSpecifier = 'eslintrc' | 'flat';
export type EnvironmentConfig = SharedConfig.EnvironmentConfig;
export type GlobalsConfig = SharedConfig.GlobalsConfig;
export type GlobalVariableOption = SharedConfig.GlobalVariableOption;
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/src/ts-eslint/eslint/ESLintShared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export declare class ESLintBase<
/**
* The type of configuration used by this class.
*/
static readonly configType: 'eslintrc' | 'flat';
static readonly configType: Linter.ConfigTypeSpecifier;
}
export interface ESLintOptions<Config extends Linter.ConfigType> {
/**
Expand Down
Loading