The issue of blob patterns not functioning properly in TypeScript on Windows has been causing frustration

I am facing an issue with Typescript not working properly when using blob patterns in my tsconfig.json file. Below is the content of my tsconfig.json:

 {
      "compileOnSave": false,
      "compilerOptions": {
        "declaration": false,
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "module": "commonjs",
        "moduleResolution": "node",
        "outDir": "../../dist/out-tsc-e2e",
        "sourceMap": true,
        "target": "es5",
        "typeRoots": [
          "../../node_modules/@types"
        ]
      },
      "files": [
        "../../test/**/*.ts"
      ]
    }

Answer №1

The files option does not support glob patterns - it requires an array of individual file names:

{
    ...

    "files": [
        "index.js",
        "utils.js",
        "config.js"
    ]
}

Instead, you can utilize the include property for defining glob patterns as needed:

{
    ... 
    
    "include": [
        "lib/**/*.js",
		"src/**/*.js"
    ],
    "exclude": [
        "node_modules",
        "**/*.test.js"
    ]
}

See more examples in the "Examples" section at: http://www.typescriptlang.org/docs/handbook/tsconfig-json.html

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The power of Vue reactivity in action with Typescript classes

Currently, I am working on a Vue application that is using Vue 2.6.10 along with Typescript 3.6.3. In my project, I have defined a Typescript class which contains some standard functions for the application. There is also a plugin in place that assigns an ...

Obtain a pair of parameters from the URL

I'm encountering an issue with extracting a parameter from a URL in my form. Initially, the form linked a customer to a product using one parameter. Now, we have added another parameter to be included in the URL, but I am unable to retrieve it. What ...

propagate the amalgamation of tuples as an argument

I'm working with a function that returns a union type of tuples. I need to pass this return value to another function that can accept all its forms using the spread operator .... type TupleUnion = readonly [number, number] | readonly [number, number, ...

Troubleshooting problem with TypeScript observables in Angular 5

Having trouble with a messaging app, specifically an error related to TS. The syntax checker in the Editor is flagging this issue: Type 'Observable<{}>' is not compatible with type 'Observable'. Type '{}' cannot be as ...

Strategies for handling uncaught promise rejections within a Promise catch block

I'm facing a challenge with handling errors in Promise functions that use reject. I want to catch these errors in the catch block of the Promise.all() call, but it results in an "Unhandled promise rejection" error. function errorFunc() { return ne ...

add headers using a straightforward syntax

I'm attempting to append multiple header values. This is what I'm currently doing: options.headers.append('Content-Type', 'application/json'); options.headers.append('X-Requested-By', 'api-client'); ... ...

JavaScript - Imported function yields varied outcome from module

I have a utility function in my codebase that helps parse URL query parameters, and it is located within my `utils` package. Here is the code snippet for the function: export function urlQueryParamParser(params: URLSearchParams) { const output:any = {}; ...

"Error TS2339: The property specified does not exist within type definition", located on the input field

When a user clicks a specific button, I need an input field to be focused with its text value selected entirely to allow users to replace the entire value while typing. This is the markup for the input field: <input type="text" id="descriptionField" c ...

Angular 11 Working with template-driven model within a directive

My currency directive in Angular 8.2 formats currency fields for users by using the following code: <input [(ngModel)]="currentEmployment.monthlyIncome" currency> @Directive({ selector: '[ngModel][currency]', providers: [Curr ...

Issue ( Uncaught TypeError: Trying to access a property of undefined ('data') even though it has been properly defined

One of my custom hooks, useFetch, is designed to handle API data and return it as a state. useFetch: import { useState, useEffect } from "react"; import { fetchDataFromApi } from "./api"; const useFetch = (endpoint) => { const [d ...

Upon transitioning from typescript to javascript

I attempted to clarify my confusion about TypeScript, but I'm still struggling to explain it well. From my understanding, TypeScript is a strict syntactical superset of JavaScript that enhances our code by allowing us to use different types to define ...

Tips for assigning a JSON object as the resolve value and enabling autosuggestion when utilizing the promise function

Is there a way to make my promise function auto-suggest the resolved value if it's a JSON object, similar to how the axios NPM module does? Here is an example of how axios accomplishes this: axios.get("url.com") .then((res) => { Here, axios will ...

Avoiding the restriction of narrowing generic types when employing literals with currying in TypeScript

Trying to design types for Sanctuary (js library focused on functional programming) has posed a challenge. The goal is to define an Ord type that represents any value with a natural order. In essence, an Ord can be: A built-in primitive type: number, str ...

What is the purpose of utilizing import and require() in Node.js programming?

Currently, I am analyzing the source code found at "Type definitions for Express 4.16" and stumbled upon this interesting line (#18): import serveStatic = require("serve-static"); I couldn't help but wonder why the above code is necessary or being u ...

Ensure Angular Reactive Forms do not include empty fields when submitting the form

Is there a way to retrieve only the fields with values entered by the user from a form and exclude empty fields in the resulting JSON object? Currently, the JSON object still includes empty quotation marks for empty inputs. Thank you! Current: { "user ...

Angular is having trouble with the toggle menu button in the Bootstrap template

I recently integrated this template into my Angular project, which you can view at [. I copied the entire template code into my home.component.html file; everything seems to be working fine as the CSS is loading correctly and the layout matches the origina ...

Utilize the global theme feature within React Material-UI to create a cohesive

I'm feeling a bit lost when it comes to setting up React Material-UI theme. Even though I've tried to keep it simple, it's not working out for me as expected. Here is the code snippet I have: start.tsx const theme = createMuiTheme({ ...

Utilizing absolute path imports in Vite originating from the src directory

What are the necessary changes to configuration files in a react + ts + vite project to allow for imports like this: import x from 'src/components/x' Currently, with the default setup, we encounter the following error: Failed to resolve import ...

Is there a way to implement Rust's enum variant classes or Kotlin sealed classes in TypeScript?

When working with HTTP responses in TypeScript, I am interested in creating a variant type that can represent different states. In Rust, a similar type can be defined as: enum Response<T> { Empty, Loading, Failure(String), Success(dat ...

What is the best way to retrieve the global styles.scss file from the assets folder for privacy, legal, and conditions pages

I have a static page called terms.html located at: $PROJECT_ROOT/src/assets/html/terms.html In addition, my global styles (used by all components) are found at: $PROJECT_ROOT/src/styles.scss To include the static html file in a component, I use the fol ...