question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Introduce `@typescript-eslint` rules that extend eslint rules

See original GitHub issue

@typesctript-eslint contains a subset of rules that extend basic rules provided by eslint, these rules usually work better and provide additional checks. The checks that are these extend-rules are listed in ESLint typescript rules at the bottom (the rules that have a reddish background).

The goal of this issue should be to implement these rules, starting with the ones that we use already but only the simple eslint version and then all the other ones that can also be enabled, some of these might help us to get rid of our own listing.

For some of these there might be one more problem that we do not have all files covered with tsconfig.json. And some of these need a decision on which style we want to use (this is visible in the sheet)

Steps to follow to create a PR:

  1. Ask @Hudda to assign you to one of the issue (Assuming got assigned to "@typescript-eslint/<rule>)
  2. Add "@typescript-eslint/<rule>: […]` in the .eslintrc file.
  3. Run python -m scripts.linters.pre_commit_linter --only-check-file-extensions=js --path=. --verbose to check existing issues in the codebase. (This can take 3-5 mins mins to complete.)
  4. If the above script takes too much time or you have a slow machine then consider pushing the code to GitHub and GitHub actions will run these checks for you.
  5. Fix all the issues found by running the above command.
  6. Commit all the changes and create a PR.

List of rules to enable:

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:62 (44 by maintainers)

github_iconTop GitHub Comments

1reaction
vojtechjelinekcommented, Nov 10, 2021

@vojtechjelinek I am using the following configuration for the ‘member-delimiter-style’ rule:

image

I would like to know if these are appropriate. More specifically, the underlined part is what I’d like to know about. With it set to true: image

With it set to false: image

Which one should I be using?

I think false is better, also it seems to be used in the default config . I think we can just use the default config.

1reaction
vojtechjelinekcommented, Sep 28, 2021

@Lawful2002 Hey, sorry about this, but actually I think @Hudda is wrong. What you need to do is to enable the @typescript-eslint/space-before-function-paren and disable the space-before-function-paren check. The rules for the @typescript-eslint/space-before-function-paren should stay the same as for space-before-function-paren.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use ESLint with TypeScript | Khalil Stemmler
ESLint is a JavaScript linter that you can use to lint either TypeScript or JavaScript code. In this post, we'll walk through how...
Read more >
Working with Rules - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
7 Recommended ESLint Rules for React TypeScript Project
This article explains 7 recommended ESLint rules for TypeScript React project. Although the changes are very small, but it would speed up your ......
Read more >
typescript-eslint/README.md at main - GitHub
An ESLint plugin which provides lint rules for TypeScript codebases. NPM Version NPM Downloads. See https://typescript-eslint.io/architecture/utils for our ...
Read more >
TypeScript ESLint | Mashup Garage Playbook
typescript -eslint is a tool for using ESLint and Typescript together without ... @typescript-eslint/parser \ eslint-config-react \ eslint-plugin-react ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found