A helpful eslint rule to require radashi namespace import with underscore #290
aeharding
started this conversation in
Show and tell
Replies: 1 comment 1 reply
-
I’m not too keen on making this a standard—perhaps more like a suggestion. For example, I personally always destructure functions. Also, this is something specific to ESLint, and in this project, we’re using Biome.js. Since it can be done with just two lines of code, maybe adding a page in the project documentation could be a simpler approach. If a lot of people show interest in this pattern, we could consider creating a package for ESLint or Biome.js in the future. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there!
I am experimenting with Radashi and I like it so far.
One of my initial problems was a few of the functions have really generic names that often clash with variables I define - for example,
title()
.For this reason, I decided that instead of
I will do
However IDE import completion often prefers the former approach. So, I tried to get an eslint rule for it! The rule is defined as the following (credit to eslint/eslint#19105 (comment)):
Result:
P.S. If this is a preferred pattern for Radashi, it would be possible to make a simple export with this rule in the Radashi project. With eslint v9, the devex would look something like this:
Beta Was this translation helpful? Give feedback.
All reactions