Skip to content

Commit

Permalink
fix(template-parser): correct typings for cjs (#597)
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Jul 15, 2021
1 parent 8621a62 commit bb60224
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
11 changes: 5 additions & 6 deletions packages/template-parser/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,8 @@ function parseForESLint(
};
}

export default {
parseForESLint,
parse: function parse(code: string, options: { filePath: string }): AST {
return parseForESLint(code, options).ast;
},
};
export { parseForESLint };

export function parse(code: string, options: { filePath: string }): AST {
return parseForESLint(code, options).ast;
}
8 changes: 2 additions & 6 deletions packages/template-parser/tests/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
/**
* This usage seems a little wonky, but don't want to run any risk of breaking changes
* to the compiled output of the template-parser node module, so leaving until v13.
*/
import { default as templateParser } from '../src/index';
import { parseForESLint } from '../src/index';

describe('parseForESLint()', () => {
it('should work', () => {
expect(
templateParser.parseForESLint(
parseForESLint(
`
<!-- eslint-disable-next-line -->
<div>some node</div>
Expand Down

0 comments on commit bb60224

Please sign in to comment.