projecte_ionic/node_modules/@angular-eslint/eslint-plugin-template/dist/utils/create-eslint-rule.d.ts
2022-02-09 18:30:03 +01:00

37 lines
1.8 KiB
TypeScript
Executable file

import type { TSESLint } from '@typescript-eslint/experimental-utils';
export declare const createESLintRule: <TOptions extends readonly unknown[], TMessageIds extends string, TRuleListener extends TSESLint.RuleListener = TSESLint.RuleListener>({ name, meta, defaultOptions, create, }: Readonly<{
name: string;
meta: {
docs: {
category: "Best Practices" | "Stylistic Issues" | "Variables" | "Possible Errors";
description: string;
recommended: false | "error" | "warn";
suggestion?: boolean | undefined;
requiresTypeChecking?: boolean | undefined;
extendsBaseRule?: string | boolean | undefined;
};
} & Omit<TSESLint.RuleMetaData<TMessageIds>, "docs">;
defaultOptions: Readonly<TOptions>;
create: (context: Readonly<TSESLint.RuleContext<TMessageIds, TOptions>>, optionsWithDefault: Readonly<TOptions>) => TRuleListener;
}>) => TSESLint.RuleModule<TMessageIds, TOptions, TRuleListener>;
interface SourceSpan {
start: {
line: number;
col: any;
};
end: {
line: number;
col: any;
};
}
interface ParserServices {
convertNodeSourceSpanToLoc: (sourceSpan: SourceSpan) => any;
convertElementSourceSpanToLoc: <TMessageIds extends string>(context: TSESLint.RuleContext<TMessageIds, []>, node: any) => any;
}
export declare function getTemplateParserServices(context: any): ParserServices;
/**
* Utility for rule authors to ensure that their rule is correctly being used with @angular-eslint/template-parser
* If @angular-eslint/template-parser is not the configured parser when the function is invoked it will throw
*/
export declare function ensureTemplateParser(context: TSESLint.RuleContext<string, readonly unknown[]>): void;
export {};