tslint Questions

3

We can't use bitwise operators in templates, but why are they not allowed by tslint within TypeScript code? "no-bitwise": true,
Humperdinck asked 3/12, 2017 at 20:14

2

Solved

I'm using the @Output decorator in an angular 9 project and the code this this: @Output('myMethod') myMethod: EventEmitter<any> = new EventEmitter(); Typescript gives my an error and force...
Tailrace asked 27/5, 2020 at 13:59

2

I am working on an Angular project in VS Code, using the "Prettier" plugin for code formatting, and the ESLint/TSLint plugins for standards enforcement. I know this isn't an "error" but I strongl...
Hinckley asked 14/6, 2019 at 19:53

7

Solved

I notice in my application that TsLint is suggesting: static $inject = [ '$http', '$q', '$scope', 'configService', 'stateService', 'utilityService' ]; for the above that: Message 2 TsLin...
Alienism asked 22/8, 2014 at 19:0

7

Solved

I have a function that checks for the current stage in a sequential stream, based on a particular discipline that is passed in, and, according to that value, assigns the next value in my Angular 2 ...
Fransiscafransisco asked 30/6, 2017 at 18:47

5

Solved

tslint is currently throwing the following error Shadowed name: 'err' Here is the code fs.readdir(fileUrl, (err, files) => { fs.readFile(path.join(fileUrl, files[0]), function (err, data) {...
Fishworm asked 28/5, 2018 at 8:26

2

Solved

I'm working with VSCode, Prettier and TSLint. When I do have chained functions call with more than 2 calls like let m = moment().startOf("day").subtract(30, "days"); Prettier breaks into let ...
Gustie asked 20/1, 2019 at 0:41

3

I have many unused params for my functions and constructors, usualy, an underscore does the trick 1) but here I still get the error message I tried this (or adding an underscore) /* tslint:disa...
Makowski asked 26/7, 2017 at 7:39

1

Solved

I want to config Organize Imports's order. Right now, it moves node_modules related import statement at the very top, and local ts file at very bottom: Normal: import myFunction from './myFunction'...
Receiver asked 5/6, 2019 at 9:7

1

Solved

The output of my ng test is as follows: > ng test 24 12 2019 14:20:07.854:WARN [karma]: No captured browser, open http://localhost:9876/ 24 12 2019 14:20:07.860:INFO [karma-server]: Karma v4.4...
Endear asked 24/12, 2019 at 14:38

1

The company I work at is on the brink of starting a new enterprise Angular application. While reading up on linting, I read that TSLint is being deprecated. Since TSLint is included in Angular by ...
Belvabelvedere asked 5/2, 2020 at 9:36

2

I'm setting up some tslint rules, in order for my team and I to better adhere to our code contract. Is there any weay to use tslint, or vs code in general, to force the use of multiline contructors...
Halfpint asked 11/1, 2018 at 7:1

6

Solved

Lint error message: src/app/detail/edit/edit.component.ts[111, 5]: for (... in ...) statements must be filtered with an if statement Code snippet (It is a working code. It is also available ...
Funicle asked 23/11, 2016 at 17:8

1

I use tslint to check my react typescript app. I created this and it works but i get this message from tslint: "Multiline JS expressions inside JSX are forbidden". I wonder how I should change the ...
Ball asked 17/12, 2019 at 13:34

3

Solved

Today I see this warning in a project being refreshed after 3 months. no-unused-variable is deprecated. Since TypeScript 2.9. Please use the built-in compiler checks instead. But my tsconfig.j...
Karlynkarma asked 31/7, 2018 at 19:59

3

Solved

Local environment: IDE: vscode Language mode: JavasSript React import React from 'react'; A syntax error message appears: Replace `'react'` with `"react"`eslint(prettier/prettier) How can...
Cavalla asked 20/11, 2019 at 8:23

3

Solved

After eslint adds typescript check, there will be an error when the attribute variable in the class definition is Array. this is my eslintrc.js module.exports = { root: true, env: { nod...
Ferro asked 21/3, 2019 at 12:35

3

Solved

The TSLint.json config file (https://github.com/palantir/tslint) supports extends and a rulesDirectory array like so { "extends": [ "tslint-microsoft-contrib", "tslint-config-security" ...
Inapposite asked 8/7, 2018 at 22:40

1

Is there a way to have "no-floating-promises" turned on but let it ignore Jasmine promises like "toEqual", "toBe", etc.? I want to use it, but it complains about my expect statements all over the p...
Eulogium asked 8/7, 2019 at 16:13

3

I just coded the following loop which works just fine: let position = 0; // tslint:disable-next-line:no-conditional-assignment while ((position = source.indexOf('something interesting', position))...
Unbecoming asked 5/11, 2019 at 3:22

2

Solved

Is there a TSLint/ESLint rule to prevent unnecessary boolean comparison like: if (result === false) { // do something }
Doyenne asked 5/2, 2016 at 9:39

2

I keep getting error "space indentation expected" while running ng lint. It is a quite amount of lines that having the same issue in my application. How can I solve this warning? Is anyone having ...
Cacuminal asked 6/10, 2017 at 12:17

3

Solved

I have a lot of code that I'm porting to Typescript with missing types. For now, I'd like my IDE (WebStorm) to just highlight places that need typing, and I'll slowly get them fixed up. If tsconfi...
Wilona asked 23/3, 2017 at 21:24

3

I tried to perform the following to exclude node_modules from tslint. But none of them resolved the issue. I am confused if it is because of the way I call the node_modules folder. First attempt...
Ortensia asked 13/3, 2018 at 8:48

1

I'm trying to set up tslint to work on a small sample React/Typescript project, following a tutorial online. When I either run yarn lint or simply enter tslint --project in the terminal, I keep get...
Claudio asked 27/8, 2019 at 18:36

© 2022 - 2024 — McMap. All rights reserved.