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

Ignore tslint #83

Open
Yuuki77 opened this issue Jul 3, 2017 · 3 comments
Open

Ignore tslint #83

Yuuki77 opened this issue Jul 3, 2017 · 3 comments

Comments

@Yuuki77
Copy link

Yuuki77 commented Jul 3, 2017

i would really appreciate if there is a way to ignore a paticular file or directory from tsLint

@jmlopez-rod
Copy link
Contributor

Just be explicit and write:

/* tslint:disable */

at the start of the files you don't want to lint.

https://palantir.github.io/tslint/usage/rule-flags/

@GrafGenerator
Copy link

GrafGenerator commented Sep 27, 2017

I faced issue using tslint-loader along with Angular's AOT compilation. TSLint fails to load ngfactory for app, which exist in virtual filesystem of webpack. At the entry point of AOT I need to do smth like this:

import { enableProdMode } from "@angular/core";
import { platformBrowser } from "@angular/platform-browser";

import { AppModuleNgFactory } from "../../aot/src/startup/app.module.ngfactory";

The issue is that I can't prevent loading that in-memory file, neither by using tslint directives nor using exclude in webpack rules options.
Anyway it fails with this output:

ERROR in ./aot/src/startup/app.module.ngfactory.ts
Module build failed: Error: ENOENT: no such file or directory, scandir 'C:\test\aot-example\aot\src\startup'
    at Error (native)
    at Object.fs.readdirSync (fs.js:952:18)
    at findFile (C:\test\aot-example\node_modules\tslint\lib\configuration.js:135:25)
    at findup (C:\test\aot-example\node_modules\tslint\lib\configuration.js:118:19)
    at findConfigurationPath (C:\test\aot-example\node_modules\tslint\lib\configuration.js:95:30)
    at Function.findConfiguration (C:\test\aot-example\node_modules\tslint\lib\configuration.js:48:22)
    at parseConfigFile (C:\test\aot-example\node_modules\tslint-loader\index.js:44:24)
    at resolveOptions (C:\test\aot-example\node_modules\tslint-loader\index.js:35:27)
    at Object.module.exports (C:\test\aot-example\node_modules\tslint-loader\index.js:139:17)
 @ ./src/startup/boot.aot.ts 7:29-82
 @ multi (webpack)-dev-server/client?http://127.0.0.1:8001 ./src/startup/boot.aot.ts

Also, it's worth to mention that boot.aot.ts, which contains that import, excluded from ts build process, so if I disable tslint-loader, all working fine.

Can I workaround this issue somehow? Any help is appreciated.

@AlbertJohansson
Copy link

I was experiencing the same issue but was able to get around it by excluding .ngfactory.ts files in the webpack module rules like so:

module: {
    rules: [
        {
            test: /\.ts$/,
            enforce: 'pre',
            loader: 'tslint-loader',
            exclude: [
                /\.ngfactory\.ts$/
            ]
        }
    ]
}

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

4 participants