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

Error TS2304 on files from node_modules #144

Open
eakoriakin opened this issue Feb 9, 2018 · 1 comment
Open

Error TS2304 on files from node_modules #144

eakoriakin opened this issue Feb 9, 2018 · 1 comment

Comments

@eakoriakin
Copy link

TSLint for some reason checks files from node_modules and throws errors.

gulp-tslint version: 8.1.2
tslint version: 5.9.1
Operating system: iOS

Example gulp configuration:

gulp.task('check-ts', function () {
    return gulp.src(paths.ts)
        .pipe(tslint({
            formatter: 'verbose'
        }))
        .pipe(tslint.report({
            emitError: false
        }));
});

tslint.json

{
    "rules": {
        "no-duplicate-variable": true,
        "no-unused-variable": [
            true
        ]
    },
    "rulesDirectory": [
        "node_modules/tslint-eslint-rules/dist/rules"
    ]
}

tsconfig.json

{
    "compileOnSave": false,
    "compilerOptions": {
        "allowSyntheticDefaultImports": true,
        "declaration": true,
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "module": "es2015",
        "moduleResolution": "node",
        "sourceMap": true,
        "target": "es5"
    },
    "exclude": [
        "node_modules"
    ],
    "files": [
        "select-searchable.ts",
        "source/select-searchable.module.ts",
        "source/select-searchable.component.ts",
        "source/select-searchable-page.component.ts"
    ]
}

Error console output:

[10:14:10] Finished 'check-ts' after 222 ms
/Users/evgenii/Documents/Apps/ionic-select-searchable/node_modules/@angular/common/src/directives/ng_class.d.ts(48,34): error TS2304: Cannot find name 'Set'.
/Users/evgenii/Documents/Apps/ionic-select-searchable/node_modules/@angular/core/src/change_detection/differs/default_iterable_differ.d.ts(12,32): error TS2304: Cannot find name 'Iterable'.
/Users/evgenii/Documents/Apps/ionic-select-searchable/node_modules/@angular/core/src/change_detection/differs/default_keyvalue_differ.d.ts(24,16): error TS2304: Cannot find name 'Map'.
/Users/evgenii/Documents/Apps/ionic-select-searchable/node_modules/@angular/core/src/change_detection/differs/default_keyvalue_differ.d.ts(32,16): error TS2304: Cannot find name 'Map'.
/Users/evgenii/Documents/Apps/ionic-select-searchable/node_modules/@angular/core/src/change_detection/differs/iterable_differs.d.ts(14,48): error TS2304: Cannot find name 'Iterable'.
/Users/evgenii/Documents/Apps/ionic-select-searchable/node_modules/@angular/core/src/change_detection/differs/keyvalue_differs.d.ts(22,18): error TS2304: Cannot find name 'Map'.
/Users/evgenii/Documents/Apps/ionic-select-searchable/node_modules/@angular/core/src/di/reflective_provider.d.ts(87,123): error TS2304: Cannot find name 'Map'.
/Users/evgenii/Documents/Apps/ionic-select-searchable/node_modules/@angular/core/src/di/reflective_provider.d.ts(87,165): error TS2304: Cannot find name 'Map'.
/Users/evgenii/Documents/Apps/ionic-select-searchable/node_modules/@angular/platform-browser/src/browser/browser_adapter.d.ts(79,33): error TS2304: Cannot find name 'Map'.
/Users/evgenii/Documents/Apps/ionic-select-searchable/node_modules/@angular/platform-browser/src/dom/dom_adapter.d.ts(97,42): error TS2304: Cannot find name 'Map'.
/Users/evgenii/Documents/Apps/ionic-select-searchable/node_modules/@angular/platform-browser/src/dom/shared_styles_host.d.ts(11,30): error TS2304: Cannot find name 'Set'.
/Users/evgenii/Documents/Apps/ionic-select-searchable/node_modules/@angular/platform-browser/src/dom/shared_styles_host.d.ts(22,30): error TS2304: Cannot find name 'Set'.
/Users/evgenii/Documents/Apps/ionic-select-searchable/node_modules/ionic-angular/util/module-loader.d.ts(13,14): error TS2304: Cannot find name 'Map'.
/Users/evgenii/Documents/Apps/ionic-select-searchable/node_modules/ionic-angular/util/module-loader.d.ts(14,18): error TS2304: Cannot find name 'Map'.
/Users/evgenii/Documents/Apps/ionic-select-searchable/node_modules/rxjs/Observable.d.ts(59,60): error TS2693: 'Promise' only refers to a type, but is being used as a value here.
/Users/evgenii/Documents/Apps/ionic-select-searchable/node_modules/rxjs/Observable.d.ts(74,59): error TS2693: 'Promise' only refers to a type, but is being used as a value here.
@panuhorsmalahti
Copy link
Owner

Did you try using linterOptions.exclude in tslint.json?

https://palantir.github.io/tslint/usage/configuration/

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

2 participants