VSCODE displays warnings with the severity of errors

My issue with VSCODE is that it displays warnings as if they were errors, particularly linter warnings.

https://i.sstatic.net/RuaWV.png

I am trying to customize the underline color for linter warnings. I attempted to modify my settings.json by adding the following configuration:

    "workbench.colorCustomizations": {
        "editorError.foreground": "#ff0000",
        "editorWarning.foreground": "#ffc400",
        "editorInfo.foreground": "#35ffab"
    },

However, it appears that VSCODE is treating these warnings as errors instead of warnings.

Answer №1

By default, the severity level of

@typescript-eslint/no-unused-vars
is set to error.

If you want to change this to a warning, you can modify your .eslintrc.js file as shown below:

module.exports = {
  ...
  rules: {
    ...
    "@typescript-eslint/no-unused-vars": ["warn"]
  }
}

Note: You may need to restart vscode for the changes to take effect.

Answer №2

Finally figured out the solution.

It turns out that the default Typescript linter, which displays warnings properly, was unexpectedly disabled. The culprit behind the error messages appearing as errors was ESLint, a linter designed to fail if there are any lint issues. After resolving this by disabling ESLint and enabling the default validator (see image attached), everything is now working smoothly.

https://i.sstatic.net/56kxz.png

No more red underlines or errors in the problems window - warnings are now displayed correctly. https://i.sstatic.net/ITHS6.png

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

Tips for customizing the appearance of date and time formats

Does anyone know how to retrieve this specific time format using Angular2 TypeScript? 2016-9-25T05:10:04.106Z I've tried searching online but couldn't find a straightforward solution. When attempting this in TypeScript, the following results a ...

JavaScript Generated From TypeScript Encountering TypeError

Why is the JavaScript code produced by this TypeScript snippet causing a TypeError upon execution? class Foo { public foo: { bar: number }; constructor() { this.foo["bar"] = 123; } } new Foo(); Even though I'm compiling it with the ...

Changing the Row's Background Color in Angular When the Button is Clicked

My code includes a list where each row has a button to open a sidebar. Due to the large number of elements in the list, I want the background color of the row to turn yellow when the button is clicked, as a way to indicate what has been selected. Currently ...

What could be causing this TypeError to appear in my Angular unit testing?

this.columnDefs.forEach((columnDef) => { columnDef.floatingFilter = this.hasFloatingFilter; }); this.gridApi.setColumnDefs(this.columnDefs); ERROR: 'ERROR', TypeError: this.gridApi.setColumnDefs is not a function TypeError: this.gridApi.set ...

Issues arise during Angular2 building process, such as failure to locate the name 'document' and unresolved references

Recently, I've been incorporating Jasmine unit tests into my Angular 2 project and made updates to some NPM packages. As a result, I've encountered two distinct errors that seem to be interconnected, so I thought it best to address both in one qu ...

Cannot assign argument of type 'string | undefined' to parameter expecting type 'string'. Typescript is being strict

While attempting to update an object using the SDK and having 'strict' mode enabled in typescript, I encountered the following error: const offer = client.offer(oldOfferDefinition!.id); await offer.replace(newOfferDefinition); error TS2345: Argu ...

Angular 10 encountering an issue with subject instantiation

I am encountering an issue with my Angular application. Everything runs smoothly with `ng serve`, and the application builds correctly using `ng build --prod`. However, when I attempt to run the generated sources in the browser, an error occurs: TypeError: ...

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 ...

What is the best way to iterate through an array and dynamically output the values?

I am facing an issue with a function that retrieves values from an array, and I wish to dynamically return these values. const AvailableUserRoles = [ { label: 'Administrator', value: 1 }, { label: 'Count', value: ...

Leveraging IntersectionObserver to identify the video in view on the screen

Our Objective I aim to implement a swipe functionality for videos where the URL changes dynamically based on the ID of the currently displayed video. Challenges Faced Although I managed to achieve this with code, there is an issue where the screen flashe ...

Angular 14 encountered an unexpected issue: There was an unhandled exception with the script file node_modules/tinymce/themes/modern/theme.min.js missing

After attempting to run ng serve, an error message appears: ⠋ Generating browser application bundles (phase: setup) ...An unhandled exception occurred: Script file node_modules/tinymce/themes/modern/theme.min.js does not exist. ⠋ Generating browser ap ...

Updating Elements in an Array Using JavaScript is Not Functioning as Expected

In my Angular application, I have included some lines of TypeScript code which involve Boolean variables in the constructor and an array of objects. Each object in this array contains input variables. selftest: boolean; failed: boolean; locoStateItem ...

Next.js threw a wrench in my plans when the HTML syntax was completely disrupted upon saving the index.js

I have encountered an issue in my VSCode environment while working on a next.js project. Whenever I attempt to save the index.js file, the HTML syntax crashes. I am at a loss on how to resolve this issue, so any assistance would be greatly appreciated. Tha ...

Error: Spy creation was anticipated to have been invoked

Currently, I am in the process of writing unit test cases for an Angular 7 Component that utilizes an async service. Unfortunately, I encountered the following error: Error: Expected spy create to have been called once. It was called 0 times. Below is t ...

Encountering the net::ERR_CLEARTEXT_NOT_PERMITTED error message within Ionic 3

Since updating ionic and cli, I have been encountering the net::ERR_CLEARTEXT_NOT_PERMITTED error every time I try to call a Rest API on my physical android device. ...

Tips for showcasing a string value across various lines within a paragraph using the <br> tag for line breaks

I'm struggling to show a string in a paragraph that includes tags to create new lines. Unfortunately, all I see is the br tags instead of the desired line breaks. Here is my TypeScript method. viewEmailMessage(messageId: number): void { c ...

Vue's Global mixins causing repetitive fires

In an effort to modify page titles, I have developed a mixin using document.title and global mixins. The contents of my mixin file (title.ts) are as follows: import { Vue, Component } from 'vue-property-decorator' function getTitle(vm: any): s ...

You are not allowed to have a union type as the parameter type for an index signature. If needed, consider using a mapped

I'm attempting to implement the following structure: enum Preference { FIRST = 'first', SECOND = 'second', THIRD = 'third' } interface PreferenceInfo { isTrue: boolean; infoString: string; } interface AllPref ...

How to Properly Initialize a Variable for Future Use in a Component?

After initializing my component, certain variables remain unassigned until a later point. I am seeking a way to utilize these variables beyond the initialization process, but I am unsure of how to do so. Below is my attempted code snippet, which throws a ...

Executing Typescript build process in VSCode on Windows 10 using Windows Subsystem for Linux

My configuration for VSCode (workspace settings in my case) is set up to utilize bash as the primary terminal: { "terminal.integrated.shell.windows": "C:\\WINDOWS\\Sysnative\\bash.exe" } This setup allo ...