ivogabe / gulp-typescript

A TypeScript compiler for gulp with incremental compilation support.
MIT License
839 stars 129 forks source link

TypeScript semantic errors angularJs 1.8.2 with gulp, not sure why its compiling the node_modules even though its excluded #658

Open richie50 opened 3 years ago

richie50 commented 3 years ago

Expected behavior: Compiles ts to js Actual behavior: /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(32,3): error TS2305: Module '"../../tapable/tapable"' has no exported member 'Tapable'. /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(998,23): error TS2314: Generic type 'SyncWaterfallHook' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(999,22): error TS2314: Generic type 'SyncWaterfallHook' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1000,28): error TS2314: Generic type 'AsyncSeriesWaterfallHook' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1001,27): error TS2314: Generic type 'AsyncSeriesWaterfallHook' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1002,27): error TS2314: Generic type 'SyncBailHook<T, R>' requires 2 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1003,21): error TS2314: Generic type 'SyncWaterfallHook' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1004,27): error TS2314: Generic type 'HookMap' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1006,30): error TS2314: Generic type 'HookMap' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1007,24): error TS2314: Generic type 'HookMap' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1016,33): error TS2314: Generic type 'HookMap' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1017,27): error TS2314: Generic type 'HookMap' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1018,37): error TS2314: Generic type 'HookMap' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1019,44): error TS2314: Generic type 'HookMap' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1020,47): error TS2314: Generic type 'HookMap' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1021,28): error TS2314: Generic type 'SyncBailHook<T, R>' requires 2 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1022,30): error TS2314: Generic type 'SyncBailHook<T, R>' requires 2 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1023,24): error TS2314: Generic type 'HookMap' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1024,25): error TS2314: Generic type 'SyncBailHook<T, R>' requires 2 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1025,34): error TS2314: Generic type 'SyncBailHook<T, R>' requires 2 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1026,25): error TS2314: Generic type 'SyncBailHook<T, R>' requires 2 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1027,31): error TS2314: Generic type 'SyncBailHook<T, R>' requires 2 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1028,36): error TS2314: Generic type 'SyncBailHook<T, R>' requires 2 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1029,35): error TS2314: Generic type 'SyncBailHook<T, R>' requires 2 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1030,34): error TS2314: Generic type 'SyncBailHook<T, R>' requires 2 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1031,40): error TS2314: Generic type 'SyncBailHook<T, R>' requires 2 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1032,33): error TS2314: Generic type 'SyncBailHook<T, R>' requires 2 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1033,36): error TS2314: Generic type 'HookMap' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1034,38): error TS2314: Generic type 'HookMap' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1035,36): error TS2314: Generic type 'HookMap' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1036,28): error TS2314: Generic type 'HookMap' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1037,25): error TS2314: Generic type 'HookMap' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1038,27): error TS2314: Generic type 'HookMap' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1039,25): error TS2314: Generic type 'HookMap' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1040,29): error TS2314: Generic type 'SyncBailHook<T, R>' requires 2 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1041,23): error TS2314: Generic type 'HookMap' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1042,32): error TS2314: Generic type 'HookMap' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1043,22): error TS2314: Generic type 'HookMap' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1044,29): error TS2314: Generic type 'HookMap' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1045,38): error TS2314: Generic type 'HookMap' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1046,48): error TS2314: Generic type 'SyncBailHook<T, R>' requires 2 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1047,44): error TS2314: Generic type 'SyncBailHook<T, R>' requires 2 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1048,26): error TS2314: Generic type 'SyncBailHook<T, R>' requires 2 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1057,28): error TS2314: Generic type 'AsyncSeriesWaterfallHook' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1058,27): error TS2314: Generic type 'AsyncSeriesWaterfallHook' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1059,33): error TS2314: Generic type 'SyncWaterfallHook' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1060,27): error TS2314: Generic type 'AsyncSeriesWaterfallHook' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1080,21): error TS2707: Generic type 'SyncHook<T, R>' requires between 1 and 2 type arguments. /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1081,19): error TS2707: Generic type 'SyncHook<T, R>' requires between 1 and 2 type arguments. /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1083,40): error TS2314: Generic type 'SyncBailHook<T, R>' requires 2 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1084,35): error TS2314: Generic type 'SyncBailHook<T, R>' requires 2 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1085,43): error TS2314: Generic type 'SyncBailHook<T, R>' requires 2 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1088,23): error TS2707: Generic type 'SyncHook<T, R>' requires between 1 and 2 type arguments. /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1090,35): error TS2314: Generic type 'SyncBailHook<T, R>' requires 2 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1091,30): error TS2314: Generic type 'SyncBailHook<T, R>' requires 2 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1092,38): error TS2314: Generic type 'SyncBailHook<T, R>' requires 2 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1100,27): error TS2314: Generic type 'AsyncSeriesHook' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1107,27): error TS2314: Generic type 'SyncBailHook<T, R>' requires 2 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1126,25): error TS2707: Generic type 'SyncHook<T, R>' requires between 1 and 2 type arguments. /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1127,24): error TS2707: Generic type 'SyncHook<T, R>' requires between 1 and 2 type arguments. /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1133,33): error TS2707: Generic type 'SyncHook<T, R>' requires between 1 and 2 type arguments. /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1134,40): error TS2314: Generic type 'SyncBailHook<T, R>' requires 2 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1135,32): error TS2707: Generic type 'SyncHook<T, R>' requires between 1 and 2 type arguments. /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1140,31): error TS2314: Generic type 'AsyncSeriesHook' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1146,33): error TS2314: Generic type 'SyncBailHook<T, R>' requires 2 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1147,24): error TS2314: Generic type 'AsyncSeriesHook' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1155,33): error TS2314: Generic type 'SyncBailHook<T, R>' requires 2 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1156,28): error TS2707: Generic type 'SyncHook<T, R>' requires between 1 and 2 type arguments. /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1160,43): error TS2314: Generic type 'SyncBailHook<T, R>' requires 2 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1161,38): error TS2314: Generic type 'SyncBailHook<T, R>' requires 2 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1162,46): error TS2314: Generic type 'SyncBailHook<T, R>' requires 2 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1175,27): error TS2314: Generic type 'SyncWaterfallHook' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1176,22): error TS2314: Generic type 'SyncWaterfallHook' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1177,32): error TS2314: Generic type 'SyncWaterfallHook' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1178,28): error TS2314: Generic type 'SyncWaterfallHook' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1179,24): error TS2314: Generic type 'SyncWaterfallHook' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1180,27): error TS2314: Generic type 'SyncWaterfallHook' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1194,22): error TS2314: Generic type 'SyncWaterfallHook' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1195,21): error TS2314: Generic type 'SyncWaterfallHook' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1196,21): error TS2314: Generic type 'SyncWaterfallHook' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1197,22): error TS2314: Generic type 'SyncWaterfallHook' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1198,19): error TS2707: Generic type 'SyncHook<T, R>' requires between 1 and 2 type arguments. /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1285,25): error TS2314: Generic type 'SyncBailHook<T, R>' requires 2 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1287,29): error TS2314: Generic type 'AsyncSeriesHook' requires 1 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1303,25): error TS2707: Generic type 'SyncHook<T, R>' requires between 1 and 2 type arguments. /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1304,26): error TS2707: Generic type 'SyncHook<T, R>' requires between 1 and 2 type arguments. /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1305,31): error TS2707: Generic type 'SyncHook<T, R>' requires between 1 and 2 type arguments. /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1308,26): error TS2314: Generic type 'SyncBailHook<T, R>' requires 2 type argument(s). /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1328,25): error TS2707: Generic type 'SyncHook<T, R>' requires between 1 and 2 type arguments. /Users/richie50/Desktop/aiol/node_modules/@types/webpack/index.d.ts(1395,24): error TS2314: Generic type 'SyncBailHook<T, R>' requires 2 type argument(s). TypeScript: 90 semantic errors Your gulpfile:

Include your gulpfile, or only the related task (with ts.createProject).

gulp.task('scripts', function() {
        return tsProject.src()
            // .pipe(ts({
            //     rootDir: "src",
            //     module: "commonjs",
            //     noImplicitAny: false,
            //     compilerOptions: {
            //         exclude: [
            //             "node_modules",
            //             "typings"
            //         ],
            //     },
            //     target: "es5",
            //     allowJs: true,
            //     outDir: "dist",
            //     moduleResolution: "node"
            // }))
            .pipe(tsProject())
            .on('error', function() { /* Ignore compiler errors */ })
            .pipe(browserSync.reload({ stream: true  }))
            .pipe($.size());
    });

tsconfig.json

Include your tsconfig, if related to this issue.

{
  "include": ["./src/**/*"],
  //"typeRoots": ["node_modules/@types"],
  "exclude" : [
    "node_modules",
    "typings"
  ],
  "compilerOptions": {
    /* Visit https://aka.ms/tsconfig.json to read more about this file */

    // "incremental": true,                   /* Enable incremental compilation */
    "target": "es5",                          /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
    "module": "commonjs",                     /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
    // "lib": [],                             /* Specify library files to be included in the compilation. */
    //"allowJs": true,                       /* Allow javascript files to be compiled. */
    // "checkJs": true,                       /* Report errors in .js files. */
    // "jsx": "preserve",                     /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
    // "declaration": true,                   /* Generates corresponding '.d.ts' file. */
    // "declarationMap": true,                /* Generates a sourcemap for each corresponding '.d.ts' file. */
    // "sourceMap": true,                     /* Generates corresponding '.map' file. */
    // "outFile": "./",                       /* Concatenate and emit output to single file. */
    // "outDir": "./",                        /* Redirect output structure to the directory. */
    "rootDir": "./src",                       /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
    // "composite": true,                     /* Enable project compilation */
    // "tsBuildInfoFile": "./",               /* Specify file to store incremental compilation information */
    // "removeComments": true,                /* Do not emit comments to output. */
    // "noEmit": true,                        /* Do not emit outputs. */
    // "importHelpers": true,                 /* Import emit helpers from 'tslib'. */
    // "downlevelIteration": true,            /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
    // "isolatedModules": true,               /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */

    /* Strict Type-Checking Options */
    "strict": true,                           /* Enable all strict type-checking options. */
    "noImplicitAny": false,                 /* Raise error on expressions and declarations with an implied 'any' type. */
    "strictNullChecks": true,              /* Enable strict null checks. */
    // "strictFunctionTypes": true,           /* Enable strict checking of function types. */
    // "strictBindCallApply": true,           /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
    // "strictPropertyInitialization": true,  /* Enable strict checking of property initialization in classes. */
    "noImplicitThis": false,                /* Raise error on 'this' expressions with an implied 'any' type. */
    // "alwaysStrict": true,                  /* Parse in strict mode and emit "use strict" for each source file. */

    /* Additional Checks */
    // "noUnusedLocals": true,                /* Report errors on unused locals. */
    // "noUnusedParameters": true,            /* Report errors on unused parameters. */
    // "noImplicitReturns": true,             /* Report error when not all code paths in function return a value. */
    // "noFallthroughCasesInSwitch": true,    /* Report errors for fallthrough cases in switch statement. */

    /* Module Resolution Options */
    // "moduleResolution": "node",            /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
    // "baseUrl": "./",                       /* Base directory to resolve non-absolute module names. */
    // "paths": {},                           /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
    // "rootDirs": [],                        /* List of root folders whose combined content represents the structure of the project at runtime. */
    // "typeRoots": [],                       /* List of folders to include type definitions from. */
    // "types": [],                           /* Type declaration files to be included in compilation. */
    "allowSyntheticDefaultImports": true,  /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
    "esModuleInterop": false,                  /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
    // "preserveSymlinks": true,              /* Do not resolve the real path of symlinks. */
    // "allowUmdGlobalAccess": true,          /* Allow accessing UMD globals from modules. */

    /* Source Map Options */
    // "sourceRoot": "",                      /* Specify the location where debugger should locate TypeScript files instead of source locations. */
    // "mapRoot": "",                         /* Specify the location where debugger should locate map files instead of generated locations. */
    // "inlineSourceMap": true,               /* Emit a single file with source maps instead of having a separate file. */
    // "inlineSources": true,                 /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */

    /* Experimental Options */
    // "experimentalDecorators": true,        /* Enables experimental support for ES7 decorators. */
    // "emitDecoratorMetadata": true,         /* Enables experimental support for emitting type metadata for decorators. */

    /* Advanced Options */
    "skipLibCheck": false,                     /* Skip type checking of declaration files. */
    "forceConsistentCasingInFileNames": true  /* Disallow inconsistently-cased references to the same file. */
  }
}

Code Include your TypeScript code, if necessary.