All Questions
131
questions
0
votes
0
answers
22
views
Prettier and eslint / tslint plugins turn off randomly
I have Intellij IDEA 2023.2.3, and I usually use prettier, eslint/tslint on automatic mode, and we have .eslintrc, .prettierrc.json, and tsconfig.json files in our root directory that intellij should ...
0
votes
1
answer
35
views
ES/TS Linting rule to check if i'm not iffing an array instead of array.length >= 1?
I've noticed a common mistake I make where I have a set of different ifs and some of them are strings or booleans, but some of them are an array.
But sometimes I forget it will always be defined and I ...
1
vote
0
answers
39
views
Is there a way to lint event listener types in JS/TS?
I use eslint and tslint to help me avoid silly mistakes.
However, today, I made a mistake when declaring an event listener to catch uncaught promise rejections:
window.addEventListener('...
0
votes
0
answers
199
views
Found no valid, enabled rules for this file type and file path in the resolved configuration
There is gitlab runner pipeline for code-verification which is using script tslint **/**/*.ts -t json -o report.json || true. I have migrated my angular project from version 12 to 15, tslint to eslint ...
4
votes
1
answer
1k
views
error attempting to use convert-tslint-to-eslint
The first step
ng add @angular-eslint/schematics
executes successfully but the second step
ng g @angular-eslint/schematics:convert-tslint-to-eslint
produces this error:
Error: The `...
1
vote
1
answer
501
views
Angular 15: error "subscribe is deprecated" still present after changes
I use Webstorm editor and I work with Angular 15.
I get the following message for subscribe function : "Deprecated symbol used"
I found this post and on the rxjs site that the method has ...
0
votes
1
answer
197
views
Migration from v12 to v16: TS errors in template
I would to migrate a big app from Angular 12 to Angular 16. The app is made through Ionic (also migrated from 5 to 7).
To do this, I performed a migration of:
TSlint to ESlint
Typescript 4.3 to 5.0
...
0
votes
1
answer
145
views
Convert Gulp-TSLint to Gulp-ESLint
I have a Gulp task that needs updating from gulp-tslint to gulp-eslint as outlined below
const { src } = require('gulp');
const config = require('./config');
const plugins = require('gulp-load-...
0
votes
1
answer
317
views
How to add tslint-disable and prettier-ignore both for a single line
How can I disable tslint/eslint and ignore the prettier for a single line, both rules at the same line?
I want to align all the properties of the object using vscode plugin but prettier reformats it ...
0
votes
0
answers
53
views
Trying to migrate from tslint to eslint in angular@13. Getting lots of dependency errors
enter image description here
I've tried to run "npm i" after cleaning the cache. but not working. Is there anything i'm missing?
Do i need to update the version of the @angular/cdk or flex-...
3
votes
1
answer
1k
views
ESLint : Timeout on starting language service process in WebStorm
I'm having this error in WebStorm with React and TypeScript:
This is how my node environment is setup in WebStorm:
This is my ESLint configuration in WebStorm and TSLint is not working properly, it ...
-1
votes
1
answer
335
views
How to turn off eslint rule?
How do you turn off an eslint rule, for example no-inferrable-types which comes from the extension "eslint:recommended"?
For example if my .eslintrc.json contains:
"extends": [
...
4
votes
3
answers
530
views
Why TypesScript allows an invalid comparison - boolean === undefined?
Faced with the strange behavior of TS.
const isItLanding = false;
if (isItLanding === undefined) { // valid
return ...;
}
But here
const isItLanding = 1;
if (isItLanding === 'undefined') { // ...
0
votes
1
answer
158
views
How to get proper linting from commandline for vscode?
Have searched far and wide and found numerous articles, videos etc. tangent to what I look for, but never a perfect solution.
My main question is how to get proper linting (like the one that's inbuilt ...
0
votes
0
answers
64
views
How to catch undefined after conditional?
Consider following example:
function myFunc (b: number): string {
let a: { c: any }
if (b < 20) a = { c: 100 }
console.log(a.c) // depending on 'b' this may throw error
return 'ok'
}
I ...