tslint Questions

2

Solved

I'm trying to tighten up my TS code by using a stricter lint ruleset, but I'm struggling with what should be legitimate uses of dynamism. I'm making a type guard to detect if something is iterable...
Rutherford asked 9/2, 2019 at 23:36

6

Solved

I upgraded my tslint to 4.0.2 and now I get a lot of errors like the following Could not find implementations for the following rules specified in the configuration: directive-selector-name comp...
Fadeless asked 2/12, 2016 at 4:9

1

Solved

I am importing the @types/history and using the createBrowserHistory() function it provides, in my React application. I get a tslint error saying, ERROR in C:/Users/eshan/my-website/src/App.tsx E...
Hamil asked 3/2, 2019 at 3:13

2

Solved

I tried use tslint --fix but get bash: tslint: command not found.... I installed tslint using command: yarn global add tslint typescript. My machine use Centos 7.
Epigraph asked 11/12, 2017 at 12:37

1

Solved

I'm banging my head for hours trying to enable linting for a TypeScript project created with create-react-app. The wmonk/create-react-app-typescript repo is now deprecated Therefore, I followed ...

1

I need to not allow tslint to fix found errors. For example, if it found comma missing, I need it to only tell me that it found it, and not actually fix it. I found the "--no-fix" parameter in its...
Monochasium asked 5/4, 2018 at 14:8

2

Solved

I'm using the following typescript method to generate UUIDs. The code itself is basically the typescript version of this stackoverflow answer. generateUUID(): string { let date = new Date().getTi...
Kress asked 19/12, 2016 at 13:44

1

Solved

clearFile() { (<HTMLInputElement>document.getElementById('uploadFile')).value = ""; } Gives [tslint] misplaced opening brace . And if I use the opening braces in same line of funct...
Minimum asked 11/12, 2018 at 13:47

1

I'm in a project that uses knockout.js (using TypeScript), and since knockout observables are just functions, people often run into issues accessing the length property of the observable function b...
Werby asked 5/12, 2018 at 19:18

3

Solved

Stateless React components should be named in PascalCase, so React can distinguish between native elements and components. Typescripts naming convention dictates that we should use lowerCamelCase o...
Stagger asked 6/9, 2017 at 6:47

2

Solved

Take the following Typescript arrow function: /** * Returns a probably unique component name. * * @param baseName a suggested name to make unique. * @returns a probably unique name. */ expor...
Prosperity asked 19/7, 2018 at 17:35

1

Solved

Tslint (probably as well as eslint) has a --fix param, that fixes style errors. Is there any reason I should also consider using prettier, other than "prettier has more style rules"?
Soemba asked 16/8, 2018 at 10:38

0

I have a TFS 2017 Build definition created for HTML (TypeScript,Javascript) which executes the sonar task and after executing the sonar build definition, i get the Error: No valid rules have been s...
Phyllotaxis asked 5/11, 2018 at 14:47

2

Solved

We recently upgraded our Angular 2 project to @angular/cli version 1.0. We also upgraded tslint from 2.x to 5.x. Now we receive the following tslint error at design time (in VSCode Output terminal)...
Curculio asked 10/4, 2017 at 18:0

2

Solved

I am using props in Vue Class components. The props are defined in the constructor without a value. This compiles and works fine, but since the latest VS Code / TSLint update, I get the following w...
Leannleanna asked 19/5, 2018 at 13:48

1

Solved

I have the following rules in my tslint.json : "member-ordering": [ true, { "order": [ "public-before-private", "static-before-instance", "variables-before-functions" ] } ], However I ...
Impassible asked 17/10, 2018 at 19:34

1

VS Code does not recognize the ES7 bind syntax out of the box. Instead, it shows up as a syntax error: Example of highlighted error in code [ts] Declaration or statement expected. I've searche...

3

How to disable Named imports must be alphabetized - tslint ? I am getting error: Named imports must be alphabetized. I don't know how to disable this error. My tsconfig.json configuration is: ...
Armes asked 29/6, 2018 at 14:21

1

Solved

I am newbie to typescript. I have tslint.json file created but don't have an idea about how to run this file using command line. Please advise which command do I need to use to run this config
Eddi asked 30/9, 2018 at 7:15

1

I have a project with this structure: -src -dist -node_modules -gulpfile.js -tslint.json My typescript files reside in src and are transpiled in a gulp task into dist folder. I've installed tsli...
Megdal asked 27/9, 2018 at 13:12

1

Solved

What is the significance of two tslint.json(inside src folder) and inside project folder? What is the differnece between them?
Croaky asked 26/9, 2018 at 20:57

2

Solved

I'm trying to create a component with an attribute as a selector, like this: @Component({ selector: '[my-attribute-selector]', template: `` }) export class MyComponent { // Some cool stuff } ...
Tanah asked 7/2, 2018 at 11:20

1

Solved

How can I exclude typescript files from being transpiled but still ensure that they work properly with the linter in the Atom editor? I'm getting this error in my *.spec.ts files: An async func...
Endolymph asked 14/9, 2018 at 23:14

1

I work a lot with TypeScript files and JavaScript files using modules. My TS/ESLint rules enforce the use of single quotes, but WebStorm always completes the code with double quotes. Is there a wa...
Fruit asked 13/9, 2018 at 13:49

4

Solved

What is the meaning of tslint: "Warning: The 'no-use-before-declare' rule requires type information."? I did some basic googling but I'm not clear on what this means or its implications.
Cage asked 12/10, 2017 at 17:44

© 2022 - 2024 — McMap. All rights reserved.