[eslint] add type property to RuleMetaData (#37351)

This commit is contained in:
Teppei Sato
2019-08-10 00:26:39 +09:00
committed by Nathan Shively-Sanders
parent 5b1c50b7f7
commit b56ebdbf4e
2 changed files with 10 additions and 1 deletions

View File

@@ -283,6 +283,12 @@ rule = { create(context) { return {}; }, meta: { fixable: 'whitespace' }};
rule = { create(context) { return {}; }, meta: { fixable: 'code' }};
rule = { create(context) { return {}; }, meta: { schema: [{ enum: ['always', 'never'] }] }};
rule = { create(context) { return {}; }, meta: { deprecated: true }};
rule = {
create(context) {
return {};
},
meta: { type: 'layout' },
};
rule = {
create(context) {

View File

@@ -292,6 +292,7 @@ export namespace Rule {
fixable?: 'code' | 'whitespace';
schema?: JSONSchema4 | JSONSchema4[];
deprecated?: boolean;
type?: 'problem' | 'suggestion' | 'layout';
}
interface RuleContext {
@@ -319,7 +320,9 @@ export namespace Rule {
type ReportDescriptor = ReportDescriptorMessage & ReportDescriptorLocation & ReportDescriptorOptions;
type ReportDescriptorMessage = { message: string } | { messageId: string };
type ReportDescriptorLocation = { node: ESTree.Node } | { loc: AST.SourceLocation | { line: number, column: number } };
type ReportDescriptorLocation =
| { node: ESTree.Node }
| { loc: AST.SourceLocation | { line: number; column: number } };
interface ReportDescriptorOptions {
data?: { [key: string]: string };