Skip to content

Commit

Permalink
fix(template-parser): generate correct index.d.ts when building (#480)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesHenry committed May 18, 2021
1 parent ae49af4 commit e150044
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -815,4 +815,6 @@ If you see a rule below that has **no status** against it, then please feel free

<!-- PR Links -->

[`pr475`]: https://api.github.com/repos/angular-eslint/angular-eslint/pulls/475

<!-- end rule list -->
2 changes: 1 addition & 1 deletion packages/template-parser/src/index.ts
Expand Up @@ -246,7 +246,7 @@ function parseForESLint(code: string, options: { filePath: string }) {
};
}

module.exports = {
export default {
parseForESLint,
parse: function parse(code: string, options: { filePath: string }) {
return parseForESLint(code, options).ast;
Expand Down
9 changes: 6 additions & 3 deletions packages/template-parser/tests/index.test.ts
@@ -1,10 +1,13 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { parseForESLint } = require('../src/index');
/**
* 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';

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

0 comments on commit e150044

Please sign in to comment.