All Questions
Tagged with typescript typescript-eslint
455
questions
0
votes
0
answers
20
views
Yarn 4.3.1 says a package (typescript-eslint) doesn't provide another (typescript) to its dependencies
After installing some packages with yarn 4.3.1 it says:
Some peer dependencies are incorrectly met by dependencies; run yarn explain peer-requirements for details.
After running yarn explain peer-...
0
votes
1
answer
28
views
Is there a linter for a missing typescript Type member?
I am trying to find a way to trigger a console lint error (or even a build error) when a Type member is called, but does not exist. Currently, I would have to know and open the offending file to see ...
0
votes
1
answer
30
views
typescript eslint stops working when I add a rule
I've installed typescript-eslint and it works great when I have the following config:
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
export default ...
-3
votes
1
answer
55
views
Adding ignores to the typescript-eslint recommended configuration?
I'm trying to add an ignores object to the typescript-eslint configuration
I figured this would do the trick:
import eslint from "@eslint/js";
import tseslint from "typescript-eslint&...
-3
votes
2
answers
64
views
Why 'eslint' + 'typescript-eslint' used for TypeScript linting when 'tsc' appears to work better? [duplicate]
Goal: To create a strict TypeScript linter script
eslint checks for poor JavaScript code patterns.
The docs suggests initialising eslint with npm init @eslint/config@latest
This also installs ...
1
vote
2
answers
72
views
Eslint 9 add a rule to existing configuration
I have a ES9 config that looks like this (eslint.config.js):
import globals from 'globals';
import pluginJs from '@eslint/js';
import tseslint from 'typescript-eslint';
import stylistic from '@...
-1
votes
1
answer
47
views
Catching errors with the lint:eslint script in the lit typescript starter project?
I'm testing the lint:eslint script in the lit element typescript starter project.
I added a property with undefined any like this below the name property:
/**
* The name to say "Hello" ...
0
votes
0
answers
55
views
Do i need the `languageOptions.globals` field in eslint flat config when using typescript-eslint?
Is it necessary to have languageOptions.globals in my eslint flat config when using the type-script-eslint plugin? Doesn't typescript eliminate the need for this field? Or should i keep this in my ...
0
votes
0
answers
24
views
eslint for array access
I have a problem that I think can be boiled down to this code snippet
public a() {
return {a: 0};
}
public b() {
return this.a()[0];
}
A while back the a function returned an array, but got ...
0
votes
0
answers
20
views
union and intersection type multiple line formatting with eslint
I'm using eslint.
// package.json
"eslint": "^9.0.0"
In cases like before, I would like to display an error line or change it to after.
// before
type MyTypes = 'whoami' | 'hello' ...
3
votes
2
answers
870
views
"Unsafe assignment of an error typed value" typescript-eslint error
At the time of asking this question, "Unsafe assignment of an error typed value" returned zero Google results, so it seems worth an SO question.
The error is produced by linting the ...
0
votes
0
answers
20
views
TypeScript, ESLint and unused value [duplicate]
Here's my type for a project that uses Google Maps. onMarkerAdd is a callback function, which returns nothing and changes the state, as you can see below.
export type MapProps = {
markers: ...
0
votes
0
answers
47
views
Getting no-extraneous imports issue while starting typescript project i
At first project was running fine even with the extraneous import issue. But now server is not starting because I added some code into "eslint.json" file with some modification in rules
&...
1
vote
1
answer
68
views
eslint 9 + typescritp without type module
I'm trying to upgrade eslint to v9 for next-json
I followed the official Getting started guideline, but in order to make it work I need to set "type": "module" in the package.json ...
0
votes
1
answer
60
views
Radix UI type error when trying to "react-accordion"
I am trying to import react accordion root component and then export it back in my project while renaming it as Accordion but currently i receive type error Unsafe assignment of an `any` value
Not ...