tslint Questions

7

Solved

In my Angular2 App I'm importing one component like this: import { PersonsSingleAccountComponent} from '../persons-information/fragments/persons-single-account/persons-single-account-bookings/pe...
Hawkins asked 9/3, 2017 at 10:40

5

Solved

I have such config in tslint.json for one line rule one-line": [true, "check-open-brace", "check-catch", "check-else", "check-whitespace" ], When I have code lines like that: if(SomethingT...
Improper asked 8/2, 2016 at 1:32

3

Solved

I don't know which rule should be included in tslint.json. Can anyone show me the common or standard use of tslint.json? How to write a tslint.json file?
Lindeberg asked 23/2, 2016 at 22:5

4

Why does TSlint still says "The return type of an async function or method must be the global Promise type"? I can't understand what's wrong. UPDATED:
Outpoint asked 18/2, 2019 at 7:29

7

Solved

Please consider the below snippet. i need to set multiple CSS properties in typescript. for that i have tried the below code. public static setStyleAttribute(element: HTMLElement, attrs: { [key: s...
Henbit asked 6/6, 2016 at 10:44

3

Solved

I have a couple create-react-app + TypeScript apps that I've been working on over the past few months. At some point (I probably upgraded the lib) tslint started throwing errors on this.setState({ ...
Nondescript asked 18/7, 2018 at 19:46

3

I'm doing the following: // Connect to MongoDB mongoose.connect(MONGODB_URI, { useNewUrlParser: true, useCreateIndex: true }).then( () => { /** ready to use. The `mongoose.connect()` promise re...
Taryntaryne asked 25/5, 2019 at 16:0

3

Solved

My tslint gone crazy? It gives warning for every subscribtion I made in whole app. It doesn't matter if I use old or new syntax it still says that subscribe is deprecated... How to write a subscrip...
Sensor asked 12/3, 2021 at 17:51

3

Solved

I'm trying to disable TSlint (Version: typescript 3.5.2, tslint 5.18.0) for a block of code in a VueJS project but it doesn't seems to work (it still displays errors and warning for this block at c...
Spalato asked 4/7, 2019 at 10:47

2

Solved

When I try to run command ng lint --fix cli throws this error: An unhandled exception occurred: Cannot find builder "@angular-devkit/build-angular:tslint". See "C:\Users\MOE89A~1.ZAR...
Piane asked 28/11, 2021 at 8:21

3

Example: class MyClass { public log(): void { console.log(this); } } unittests.js const instance = new MyClass(); expect(instance.log).toHaveBeenCalled(); Avoid referencing unbound method...
Primine asked 2/12, 2019 at 7:6

2

Solved

I need to write an Angular Typescript rule to warn people if they utilize certain 'keywords/phrases'. For example, if keyword "Birthdate" or "SSN" is in the source file directly, it should give a w...
Stuppy asked 16/12, 2019 at 19:29

2

Solved

I have got a tslint error to my for loop when I try to resolve it it says to convert to for-of. I have seen many docs but its not helpful.How can I solve the lint error and I cannot do tslint:disab...
Warn asked 12/3, 2018 at 19:25

4

I keep getting this tslint error and don't see what's wrong with the code. Does anybody see an issues with the jsdoc asteriks below not being aligned correctly: /** * @ngdoc directive * @module ...
Annapurna asked 11/10, 2016 at 22:56

10

I recently started seeing, what seems like, TSLint errors. They look like this: Not using the local TSLint version found for '/Users/myname/myproject/client/src/app/likes/likee/likee.component.ts'...
Horseleech asked 10/12, 2020 at 4:8

2

Solved

How to get tslint.config based formatting in VSCode. I tried some extensions and it warns me about code quality, but not format/beautify my code on save
Kirst asked 18/4, 2018 at 8:49

3

I have a big web app made by both legacy JavaScript code (including eslint) and new TypeScript code (including tslint). My problem is that my IDE (WebStorm) is automatically applying both linters ...
Threedimensional asked 3/7, 2019 at 11:20

2

Solved

I have the Typescript code below: import * as express from 'express'; import * as bodyParser from 'body-parser'; ... const app: express.Application = express(); app.use(bodyParser.json()); In...
Abeu asked 15/6, 2020 at 20:32

2

Solved

Recently in our project we migrated to use the @typescript-eslint/parser to slowly migrate from tslint. Everything has mostly been smooth but I have a small problem/question I can't work out. Do I...
Alcoran asked 23/3, 2020 at 22:16

1

I'm running into significant issues with my migration from TSLint to ESLint for my Angular project. The way I'm working is I'm creating a brand new project (currently in Angular 9), and then I upgr...
Duntson asked 2/12, 2020 at 17:36

3

What settings need to be configured to add a new line before and after method declaration in classes in typescript files using prettier plugin in vs code editor? How can we achieve by writing any ...
Aron asked 12/10, 2018 at 4:3

2

I'm using these rules in tsconfig in order to highlight unused variables and imports in vscode. "noUnusedLocals": true, /* Report errors on unused locals. */ "noUnusedParameters": true, /* Repo...
Divulge asked 19/8, 2017 at 23:22

4

Solved

I'm not asking what's technically possible; I know you can do const a = []; const b = {}; a.push['sup']; b.test = 'earth'; What I'm wondering is whether there's any convention for preferring let...
Whinchat asked 3/10, 2017 at 20:40

3

Solved

I have created a new Angular4 project using Angular-CLI recently. The problem I am having is after installing angular2-notifications , I get an error when running the ng lint command. Error : ...
Udela asked 1/6, 2017 at 0:48

3

Solved

I am getting the lint error: don't use object as a type When I use object as a type, example follows: export const myFunc = (obj: object): string => { return obj.toString() } Any idea what t...
Undetermined asked 16/11, 2020 at 4:0

© 2022 - 2024 — McMap. All rights reserved.