Skip to content

Commit 3b7a64c

Browse files
committed
Exposing the StyleContext interface
1 parent cdeed7c commit 3b7a64c

File tree

3 files changed

+25
-5
lines changed

3 files changed

+25
-5
lines changed

src/index.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1-
import { parseForESLint } from "./parser";
21
import * as AST from "./ast";
32
import { traverseNodes } from "./traverse";
43
import { KEYS } from "./visitor-keys";
54
import { ParseError } from "./errors";
5+
export {
6+
parseForESLint,
7+
StyleContext,
8+
StyleContextNoStyleElement,
9+
StyleContextParseError,
10+
StyleContextSuccess,
11+
StyleContextUnknownLang,
12+
} from "./parser";
613
export * as meta from "./meta";
714
export { name } from "./meta";
815

916
export { AST, ParseError };
1017

11-
// parser
12-
export { parseForESLint };
1318
// Keys
1419
// eslint-disable-next-line @typescript-eslint/naming-convention -- ignore
1520
export const VisitorKeys = KEYS;

src/parser/index.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,22 @@ import {
2222
import { ParseError } from "../errors";
2323
import { parseTypeScript } from "./typescript";
2424
import { addReference } from "../scope";
25-
import { parseStyleContext, type StyleContext } from "./style-context";
25+
import {
26+
parseStyleContext,
27+
type StyleContext,
28+
type StyleContextNoStyleElement,
29+
type StyleContextParseError,
30+
type StyleContextSuccess,
31+
type StyleContextUnknownLang,
32+
} from "./style-context";
33+
34+
export {
35+
StyleContext,
36+
StyleContextNoStyleElement,
37+
StyleContextParseError,
38+
StyleContextSuccess,
39+
StyleContextUnknownLang,
40+
};
2641

2742
export interface ESLintProgram extends Program {
2843
comments: Comment[];

tests/src/parser/style-context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import fs from "fs";
33
import path from "path";
44

55
import { parseForESLint } from "../../../src";
6-
import type { StyleContext } from "../../../src/parser/style-context";
6+
import type { StyleContext } from "../../../src/parser";
77
import { generateParserOptions, listupFixtures } from "./test-utils";
88

99
const STYLE_CONTEXT_FIXTURE_ROOT = path.resolve(

0 commit comments

Comments
 (0)