0.0.1 • Published 5 years ago

glob-tsc v0.0.1

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

glob-tsc

The purpose of this command is to add support for file globbing to Typescript compiler tsc.

Globs can be provided by:

  • Reading filesGlob property of tsconfig.json
  • Providing it through command line arguments

All options not supported by this package will be passed to tsc compiler command

based on: tsc-glob version 1.1.0

Installation

Install the package

npm install --save-dev glob-tsc

Usage

glob-tsc [options]

Options

aliascommanddescription
-h--helpoutput usage information
-V--versionoutput the version number
-f--tsconfig-file tsconfig.json file location. Default ./tsconfig.json
-g--files-glob File globs (ignores filesGlob in tsconfig file)

Examples

Using command globs with -g alias (easiest):

glob-tsc --outDir dist --declaration -g src/**/ts/*.ts

for JavaScript type linting (see JavaScript type linting on Medium):

glob-tsc --allowJs --checkJs --noEmit --resolveJsonModule --target es5 -g bin/**/*.js,lib/**/*.js,test/**/*.js

Using alternative tsconfig JSON file:

glob-tsc --tsconfig-file config/tsconfig.json --outDir dist --declaration

Using command globs with --files-globs:

glob-tsc --files-globs src/**/ts/*.ts --outDir dist --declaration

Major TODO items

  • package "main" script should export some kind of a library API
  • cleaner & clearer log output
  • cleaner error reporting in the following cases:
    • no file globs or tsconfig.json file present
    • no valid tsc (TypeScript compiler) is found