Skip to content

Commit

Permalink
feat(eslint-plugin-template): export template parser services and rul…
Browse files Browse the repository at this point in the history
…e creator (#888)
  • Loading branch information
reduckted committed Nov 19, 2022
1 parent f71f236 commit 47a0fb3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions packages/eslint-plugin-template/src/index.ts
Expand Up @@ -116,3 +116,9 @@ export default {
[useTrackByFunctionRuleName]: useTrackByFunction,
},
};

export type { ParserServices } from './utils/create-eslint-rule';
export {
getTemplateParserServices,
patchedRuleCreator as createESLintRule,
} from './utils/create-eslint-rule';
Expand Up @@ -9,7 +9,9 @@ import { ESLintUtils } from '@typescript-eslint/utils';
* We need to patch the RuleCreator in order to preserve the defaultOptions
* to use as part of documentation generation.
*/
const patchedRuleCreator: typeof ESLintUtils.RuleCreator = (urlCreator) => {
export const patchedRuleCreator: typeof ESLintUtils.RuleCreator = (
urlCreator,
) => {
return function createRule({ name, meta, defaultOptions, create }) {
return {
meta: Object.assign(Object.assign({}, meta), {
Expand All @@ -36,7 +38,7 @@ export const createESLintRule = patchedRuleCreator(
`https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin-template/docs/rules/${ruleName}.md`,
);

interface ParserServices {
export interface ParserServices {
convertNodeSourceSpanToLoc: (
sourceSpan: ParseSourceSpan,
) => TSESTree.SourceLocation;
Expand Down

0 comments on commit 47a0fb3

Please sign in to comment.