Prevent eslint removing distinction between String and string
I have the following function in typescript:
ESLint Stylistic is ignoring ts files
I’m using the new ESLint flat style with @stylistic/eslint-plugin
but it fails to detect ts files and when I try to run it directly against a ts file it gives me the error:
ESLint – Wrong unnecessary conditional error
I’m having some issues with ESLint while linting Typescript interface array. Look at the following example:
Configure @typescript-eslint/quotes for double-quotes
I’ve not yet gone down the flat-config path but I’m setting up ESLint for a new NextJS Typescript project in VSCode and find that I cannot configure the “@typescript-eslint/quotes” rule to enforce double-quotes rather than single-quotes.
Eslint rule to enforce only one usage of process.env
I have a webpack plugin to define some custom variables like process.env.MY_VAR
and they won’t be reachable by the plugin with the process.env['MY_VAR']
so I need a eslint rule to throw an error when the second form is used, and suggest to use the first one only.
Ensuring typescript method arguments have types
In our Typescript based project, we are looking to ensure that class methods are typed or have a default resolvable type assignment, but are not sure what eslint rule code do this.
ESLint rule to enforce functions with more than one argument take props object?
Is there any sort of ESLint rule which I could use which says something like:
Unexpected any. Specify a different type
I want infer something in typescript like this:
TypeScript ESLint: Rule to sort interface props alphabetically, with functions going last?
I’m looking for an ESLint rule with similar capabilities to react/jsx-sort-props
but for interfaces and types, where I can require to sort interface members alphabetically, with members of type function
going last.
How to Resolve ESLint ‘Type ‘T[K]’ is not assignable to type ‘never” Warning in TypeScript?
I got annoying Eslint warning for below two lines.
Does anyone know how to solve this issue ? Any hints are more than welcome!