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.

Support .eslintrc.ts

See original GitHub issue

The version of ESLint you are using. 6

The problem you want to solve. Allowing typescript users to write strongly typed .eslintrc configuration files that “just work” in the same manner as .eslintrc.js.

Your take on the correct solution to problem. use ts-node to bootstrap .ts files if it’s available.

This would be following in the footsteps of other libraries, including:

While I’ve used ts-node, I’ve never implemented this sort of feature before. I know that webpack-nano uses rechior to achieve this feature. That in turn uses interpret, which is also what webpack uses.

I would additionally propose this happens by default, w/o requiring a config value - eslint would search for a .js file first, followed by a .ts file, since in TS land this usually represents a compiled TS file.

Are you willing to submit a pull request to implement this change?

Gladly, but would most likely require some guidance from others having never worked w/ eslint core directly (including general github & ci processes).


Overall, I think that this feature makes sense to support given the work being done to merge tslint into eslint via @typescript-eslint.

Ultimately, I’d love to see a day where I can write a .eslintrc.ts and have everything work as they would if I’d had a .js as the extension.

I think it’s reasonable to require the installation of additional dependencies in the application being linted for this feature; as such if there’s a way to implement this feature as a separate package over at @typescript-eslint then I’m game for that 😄

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:25 (23 by maintainers)

github_iconTop GitHub Comments

6reactions
eslint-deprecated[bot]commented, Sep 9, 2019

Unfortunately, it looks like there wasn’t enough interest from the team or community to implement this change. While we wish we’d be able to accommodate everyone’s requests, we do need to prioritize. We’ve found that issues failing to reach accepted status after 21 days tend to never be accepted, and as such, we close those issues. This doesn’t mean the idea isn’t interesting or useful, just that it’s not something the team can commit to.

Thanks for contributing to ESLint and we appreciate your understanding.

5reactions
g-planecommented, Aug 8, 2019

TL; DR: Just a joke.


@G-Rath

I think you may want the GitHub languages status for your codebase to keep 100% TypeScript with blue bar. Like this, right? 图片

I’m also a fan of doing this.

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 enables you to enforce a set of style, formatting, and coding standards for your codebase. It looks...
Read more >
typescript-eslint
ESLint statically analyzes your code to quickly find problems. It allows creating a series of assertions called lint rules around what your code...
Read more >
eslintrc.js to eslintrc.ts : r/typescript - Reddit
I'm trying to replace all require with import statements, per my ESLint rules, and changing all extensions from .js to .ts where possible....
Read more >
@typescript-eslint/eslint-plugin - npm
TypeScript plugin for ESLint. Latest version: 5.47.1, last published: 2 days ago. Start using @typescript-eslint/eslint-plugin in your ...
Read more >
Lint and Style Your TypeScript Code with ESLint and Prettier
Tools like ESLint and Prettier can help automate and assert that code style be the same, and common pitfalls are caught.
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