Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular inline templates #16

Open
mwld opened this issue Aug 29, 2018 · 0 comments
Open

Angular inline templates #16

mwld opened this issue Aug 29, 2018 · 0 comments

Comments

@mwld
Copy link

mwld commented Aug 29, 2018

Hi there,

I am using Angular inline templates in my project and I would like to lint them with HTMLHint via htmlhint-loader.

It works with this configuration:

            {
                enforce: "pre",
                test: /\.ts$/,
                loader: "htmlhint-loader",
                include: [...],
                options: {
                    configFile: [...],
                    failOnError: false,
                    failOnWarning: false,
                }
            },

The actual HTML part within inline templates is situated inside a template variable in those *.ts files. I guess htmlhint-loader is currently linting the whole file including the TypeScript code. This probably causes the following loader plugin error when the linter finds something what it thinks is an error:

Error:
at lint ([...]\node_modules\htmlhint-loader\index.js:115:15)
at fs.readFile ([...]\node_modules\htmlhint-loader\index.js:163:11)
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:528:3)
@ ./assets/scripts/ts/modules/shared/shared.module.ts 81:39-113
@ ./assets/scripts/ts/modules/app/app.module.ts
@ ./assets/scripts/ts/modules/app/standalone-app.module.ts
@ ./assets/scripts/ts/main.jit.ts

I would like to know if it is somehow possible to tell htmlhint-loader that it should only lint the template part within those files. (Maybe something like the regExp option of file-loader to only target a part of the loaded file.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant