All Questions
Tagged with typescript eslint
1,550
questions
0
votes
1
answer
15
views
How to create a stable function that is not required in dependency arrays of hooks by the ESlint rule react-hooks/exhaustive-deps
In React + TypeScript, I am trying to create a custom hook which returns stable updater function with referential types and stable signature such as those provenients from useState or useDispatch so ...
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 ...
-2
votes
0
answers
31
views
How to clear the clutter from root directory of a vite project? [closed]
When I create a new Vite project with typescript and eslint i get a lot of config files in the root directory of my project.
It bothers me as I like my code well organized, so I just want these config ...
-1
votes
0
answers
32
views
ESLint - Wrong unnecessary conditional error
I'm having some issues with ESLint while linting Typescript interface array. Look at the following example:
interface SomeKind {
one: string
two: string
}
const someKinds: SomeKind[] = []
...
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 ...
1
vote
0
answers
33
views
ESLint: @stylistic/type-annotation-spacing and @stylistic/key-spacing conflict
This is my current eslint config. I am currently using the latest version of ESLint. I would like to be able to use these two rules in combination but they conflict. I also tried to write a custom ...
2
votes
2
answers
208
views
Prettier is removing typescript generic annotation from react class component
I'm trying to make an ErrorBoundary using a class component like this
class ErrorBoundary extends Component<ErrorBoundaryProps,ErrorBoundaryState>
But every time I format it with prettier, the ...
0
votes
0
answers
12
views
NX automatically adds undesidered eslint plugin causing performance issues
It happened several times already that somehow NX added this:
"plugins": [
{
"plugin": "@nx/eslint/plugin",
"options": {
"...
-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 ...
0
votes
0
answers
13
views
Disable eslint `require-jsdoc` for nested functions
I'm trying to disable jsdoc warnings for nested functions. For example, in this file it spits a warning on the commented line.
// Notifications.ts
import * as Device from "expo-device";
...
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" ...
1
vote
1
answer
27
views
ESLint: Why is no-unused-expressions failing?
In my code I have a series of ternary operators using the addition/subtraction assignment operator to modify the value for a variable corresponding to the pixel position of an element in an SVG.
A few ...
0
votes
4
answers
63
views
How to bypass useEffect dependency for custom hook?
Here's my sample code:
const { getConversionList, conversionList } = useConversion();
useEffect(() => {
getConversionList();
}, []);
useConversion is a GraphQL resolver hook, I'm getting ...