@o3r/eslint-plugin
Version:
The module provides in-house eslint plugins to use in your own eslint configuration.
23 lines (22 loc) • 1.05 kB
TypeScript
import { type ParserServices, TSESLint } from '@typescript-eslint/utils';
/** Basic interface for the Parser Services object provided by jsonc-eslint-parser */
type JsoncParserServices = ParserServices & {
isJSON: boolean;
};
/**
* Determine if jsonc-eslint-parser is used
* @param parserServices Parser services object
*/
export declare function isJsoncParserServices(parserServices: any): parserServices is JsoncParserServices;
/**
* Retrieve the json parser services object or throw if the invalid parser is used
* @param context Rule context
*/
export declare function getJsoncParserServices(context: Readonly<TSESLint.RuleContext<string, readonly unknown[]>>): JsoncParserServices;
/**
* Utility for rule authors to ensure that their rule is correctly being used with jsonc-eslint-parser
* If jsonc-eslint-parser is not the configured parser when the function is invoked it will throw
* @param context
*/
export declare function ensureJsoncParser(context: Readonly<TSESLint.RuleContext<string, readonly unknown[]>>): void;
export {};