Adding TSLint to AngularCLI for on-the-fly code analysis (step-by-step guide)

Desired Outcome:

I am using sublime IDE and would like my typescript code to be automatically linted as I type, instead of relying on a watcher or any ng commands.

I have an angularcli project and I am examining the .angular-cli.json file.

In the lint array section, I have added a reference to my new tslint.json file:

  "lint": [
    {
      "project": "tslint.json"
    }
  ]

Subsequently, I created a tslint.json file and included a testing rule:

{
  "rules": {
    "semicolon": [
        true,
        "always"
     ]
  }
}

I attempted to run ng lint because my package.json contains the following:

 "scripts": {
    "lint": "gulp lint"
  }

However, running ng lint resulted in the following error message:

nvalidConfigError: Parsing '/Users/markoddi/Public/appscatter_ui2/.angular-cli.json' failed. Ensure the file is valid JSON. Error: Unexpected token / in JSON at position 1135

To summarize, I require assistance in setting up tslint to run during coding.

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

A more efficient method for refreshing Discord Message Embeds using a MessageComponentInteraction collector to streamline updates

Currently, I am working on developing a horse race command for my discord bot using TypeScript. The code is functioning properly; however, there is an issue with updating an embed that displays the race and the participants. To ensure the update works co ...

How can I access the value from useEffect in a function component in React?

I have been attempting to retrieve an element using useEffect in React, here's a simplified example demonstrating the issue: import React from 'react'; const App: React.FC = () => { React.useEffect(() => { const resizeElement: ...

Drag and Drop File Upload with Angular 2

I'm currently working on incorporating a drag and drop upload feature for angular 2, similar to the one found at: Given that I am using angular 2, my preference is to utilize typescript as opposed to jquery. After some research, I came across a libra ...

utilizing a simple input field with typescript

This situation is really getting on my nerves. I have a hidden input box that looks like this: <input type='hidden' id='iFrameDrivenImageValue' value='n/a'> Now, I am attempting to read its value from .ts file in order ...

Error TS2393 in Typescript: Multiple function declarations found within a Node/Express application

In my TypeScript node + express application, I have implemented a function in some API routes that looks like this: function cleanReqBody(req) { req.body.createdBy = req.user; req.body.modifiedBy = req.user; req.body.modified = new Date(); } Howeve ...

The search functionality in Angular 2 using Typescript is not working properly, as the button is not triggering the

I've been working on developing a search feature that utilizes text input to look up information about corporations through a government API (https://github.com/usagov/Corporate-Consumer-Contact-API-Documentation). Within my project, I have an HTML p ...

Guide to configuring an Angular Material Footer using Flex-Layout

Could someone help me with setting up the footer in my Angular Material app? I want it to: stick to the bottom when the content height is smaller than the view-port move down or get pushed down when the content height exceeds the view-port One important ...

Matching packages with mismatched @types in Webpack 2: A comprehensive guide

Having trouble implementing SoundJS (from the createJS framework) in my TypeScript project using webpack 2. In my vendors.ts file, I have the following import: import "soundjs"; Among other successful imports. The @types definitions installed via npm a ...

Leveraging the information retrieved from Promise.all calls

Using the service method below, I send two parallel queries to the server with Promise.all. The returned results are stored in the productCategoryData array, which is then logged to the console for verification. Service method public getProductCategoryDa ...

The Intersection Observer API is caught in a never-ending cycle of rendering

I am experimenting with the intersection observer API in order to selectively display elements in a CSS grid as the user scrolls, but I seem to have run into a problem of encountering an endless rendering loop. Below is the code snippet I am working with. ...

Benefits of Angular Signals - Why is it advantageous?

I'm grappling with the concept of Angular Signals and their benefits. While many examples demonstrate counting, I'm curious about why signals are preferable to using variables like myCount and myCountDouble as shown below? Check out my code on S ...

In Angular2, you can dynamically show or hide previous and next buttons based on the contents of the first and last div

I need a solution to dynamically hide or show previous and next buttons based on the div tags created. Each value in a list is being used to generate individual div tags using ngFor loop in Angular 2. The list being utilized is: appUlist:string[] = ["Cal ...

Determine the data type of sibling attributes by analyzing the types of other siblings

I am in the process of creating a simple abstraction that displays patches to an object. type MyObject = { attributeA: string; attributeB: boolean; attributeC: number; }; type MyObjectKeys = keyof MyObject; type Difference<Key extends MyObjectKey ...

Guidelines on extracting a value from Ionic4 storage using a fat arrow

Currently, I am in the process of developing an Ionic 4 Angular application and utilizing Ionic 4 storage. In this context, I have successfully implemented setting and getting key-value pairs using Ionic storage. However, I am facing a challenge when tryin ...

The specialized middleware in Next.js gets dispatched to the browser

Attempting to retrieve user information based on the current session, I created a small _middleware.ts file. In order to get the users' data, I imported a prisma (ORM) client. However, upon loading the page in the browser, an error message appeared: ...

Countdown timer options for Ionic and Angular 2

I am in need of a simple Angular 2 (4) / Ionic 2 Countdown timer for my project, but unfortunately I haven't been able to come across any open-source options. That's why I'm turning to you all for suggestions. Here is an example of what I h ...

Having difficulty customizing Mui Accordion with Styled Utility implementation

I am having trouble overriding the CSS for an Accordion using Mui styled utility. I am trying to apply a custom CSS class, but there seems to be an underlying class that is causing issues in my code. Here is the Mui class snippet: <div class="MuiPa ...

Angular 2 module transpilation services

In my angular 2 application, there is a module called common. Here is how the project structure looks like: main --app /common --config //.ts configs for modules --services //angular services --models --store //ngrx store /co ...

A guide on selecting the best UI container based on API data in React using TypeScript

I have been developing a control panel that showcases various videos and posts sourced from an API. One div displays video posts with thumbnails and text, while another shows text-based posts. Below is the code for both: <div className=""> &l ...

extract() of the incoming information

I'm currently tackling a project in Angular that involves user input into an input field. The task is to truncate the text at 27 characters and add "..." at the end if it exceeds that limit. I've attempted to achieve this using the slice() method ...