@o3r/eslint-plugin
Version:
The module provides in-house eslint plugins to use in your own eslint configuration.
39 lines (38 loc) • 1.57 kB
TypeScript
import { type ParserServices, TSESLint } from '@typescript-eslint/utils';
/** Position in source code */
interface SourceSpan {
/** starting position */
start: {
line: number;
col: any;
};
/** ending position */
end: {
line: number;
col: any;
};
}
/** Basic interface for the Parser Services object provided by @angular-eslint/template-parser */
type TemplateParserServices = ParserServices & {
/** Set body visitor rule runner */
convertElementSourceSpanToLoc: (listenerObj: any) => any;
/** Determine the linter notification position based on the node */
convertNodeSourceSpanToLoc: (sourceSpan: SourceSpan) => any;
};
/**
* Determine if @angular-eslint/template-parser is used
* @param parserServices Parser services object
*/
export declare function isTemplateParserServices(parserServices: any): parserServices is TemplateParserServices;
/**
* Retrieve the template parser services object or throw if the invalid parser is used
* @param context Rule context
*/
export declare function getTemplateParserServices(context: Readonly<TSESLint.RuleContext<string, readonly unknown[]>>): TemplateParserServices;
/**
* 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
* @param context
*/
export declare function ensureTemplateParser(context: Readonly<TSESLint.RuleContext<string, readonly unknown[]>>): void;
export {};