Stop prettier-standard from deleting semicolons within Typescript interfaces

In my current Typescript project, I have defined an interface called CurrencyAmountProps.

interface CurrencyAmountProps {
  value: number;
  currency: string;
}

To format my Typescript files, I am using a command line tool called prettier-standard.

The issue I am facing is that when I run the prettier-standard command, it removes semicolons after the value and currency lines in the interface definition.

Although this is technically valid in Typescript, it causes problems when I try to extract formatted messages using react-intl-cra.

I am looking for a way to exempt interfaces from having their semicolons removed by prettier-standard. How can I achieve this?

Answer №1

If your configuration allows, you could experiment with tslint's "ignore-interfaces" option. More information can be found in the documentation

"semicolon": [true, "never", "ignore-interfaces"]

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

What is the most efficient way to set default props for a component?

According to the official documentation, the best practice for setting default props for a component is as follows: interface Props { /** * default value set to 100 */ size?: number } function Avatar({ size = 100 }: Props) { // ... } An ...

Expanding ngFor in Angular 2

Is it possible to pass two arguments with ngFor? Here is an example that I would like to achieve: <mat-card *ngFor="let room of arr; let floor of floorArr"> <mat-card-content> <h3>Room Number: {{room}}</h3> <p>Floor ...

Angular is experiencing difficulty locating the routing path for the auxiliary `router-outlet`

Exploring the intricacies of routing in Angular to gain a deeper understanding of the concept. Encountering an issue where I am receiving an exception NG04002: Cannot match any routes. URL Segment: 'about' when attempting to click on the About li ...

Why doesn't TypeScript perform type checking on a two-dimensional array?

Here's a simple code snippet I've been using to create a 2D array: type cell = { id: string; }; const board: cell[][]; board = Array(10) .fill("") .map((x) => Array(10).fill(ANY TYPE CAN GO HERE WHY?)); Oddly enough, when I popu ...

What is the proper way to supply a header parameter in Angular?

Encountering difficulties when trying to pass my header parameter in Angular. The error I'm receiving from my API states "Session Id is required" as shown below. Here is the endpoint: [HttpDelete("")] public IActionResult EndSession( ...

What is the best way to delegate the anonymous function logic contained within the subscribe() method?

Imagine you have a code block similar to this: constructor(private _http: HttpClient) { this.fetchUsers(5); } employees: any[] = []; fetchUsers(count: number) { this._http.get(`https://jsonplaceholder.typicode.com/users`).subscribe( ...

Unlocking the Potential of Vue Class Components: Exploring Advanced Customization Options

Currently, I am working on a project using Vue 2 with Typescript. However, I am facing an issue where I cannot add options to the component. <script lang="ts"> import { Component, Vue } from "vue-property-decorator"; import HelloW ...

There seems to be an issue as the function Response.cookie is

I am a newcomer to using NestJS and currently utilizing it to manage a REST API server. My goal is to send some HTTP-only cookies in the response, so I referred to the official documentation for guidance. The documentation suggests using the cookie method ...

Creating an RxJS observable stream from an event emitted by a child element in an Angular 2 component template

Currently incorporating Angular 2.0.0-rc.4 alongside RxJS 5.0.0-beta.6. In the midst of exploring various methods for generating observable streams from events, I find myself inundated with choices and would like to gather opinions. Recognizing that there ...

What is the best way to tally up the letters within a table?

Currently, I am working on a task to count letters and display them in a table. The existing table is functional but has too many rows and incorrect counts. A 2 ...

The module 'crypto-js' or its corresponding type declarations cannot be located

I have a new project that involves generating and displaying "QR codes". In order to accomplish this, I needed to utilize a specific encoder function from the Crypto library. Crypto While attempting to use Crypto, I encountered the following error: Cannot ...

What is the proper way to define props for a component to match those of an "img" element in TypeScript using Vue?

Is there a way to implement type inference for a component that passes all its props to an img element? I attempted the following methods: defineProps<ImgHTMLAttributes>() // and defineProps<HTMLImageElement>() However, both resulted in the e ...

Decide on the chosen option within the select tag

Is there a way to pre-select an option in a combobox and have the ability to change the selection using TypeScript? I only have two options: "yes" or "no", and I would like to determine which one is selected by default. EDIT : This combobox is for allow ...

What is causing the TypeScript error in the MUI Autocomplete example?

I am attempting to implement a MUI Autocomplete component (v5.11) using the example shown in this link: import * as React from 'react'; import TextField from '@mui/material/TextField'; import Autocomplete from '@mui/material/Autoco ...

Circular reference in Angular/TypeScript

I encountered a circular dependency issue in my Angular project and tried various solutions, including exporting all dependent classes from a "single file" as suggested here. Unfortunately, this approach did not work for me. I then explored other solutions ...

The importance of removing unnecessary import statements in Typescript/Angular

Visual Code beautifully showcases the detection of unused imports: https://i.sstatic.net/3sIfO.png Could delegating the task of removing all unused imports in a moderately large Angular 7 project to a junior developer or intern result in more than just im ...

What is the best way to show the previous month along with the year?

I need help with manipulating a date in my code. I have stored the date Nov. 1, 2020 in the variable fiscalYearStart and want to output Oct. 2020. However, when I wrote a function to achieve this, I encountered an error message: ERROR TypeError: fiscalYear ...

A guide to transforming an object into a JSON query using Elasticsearch

Currently, I am developing a Search Application using Angular7 and elasticsearchJS. Within my data Service, the elasticsearch JSON query body is generated from user inputs. While it functions properly with a simple string query in this.query, there seems t ...

TypeScript unable to loop through object with string keys

My TypeScript service is responsible for populating an associative array: fun populateData(){ let tempArr; tempArr = []; this.service.get('Post', 1, 'true').subscribe( (response) => { this.loadingIcon = false; ...

I keep getting a TypeORM error indicating a null value in a column that violates a not-null constraint. Can someone help me figure out what mistake I'm making

I've been utilizing TypeORM to develop a task system that involves various entities such as owning committee, related committees, project leads, and employee entries. My expectation is to pass a unit test successfully with the following code executio ...