Skip to content

Fix typo in omitParts config option#50

Merged
dawsbot merged 1 commit intodawsbot:masterfrom
dben89x:master
Feb 1, 2022
Merged

Fix typo in omitParts config option#50
dawsbot merged 1 commit intodawsbot:masterfrom
dben89x:master

Conversation

@dben89x
Copy link
Copy Markdown
Contributor

@dben89x dben89x commented Feb 1, 2022

There's a typo in the omitParts configuration option. This fixes that.

@dawsbot dawsbot merged commit 108cabd into dawsbot:master Feb 1, 2022
@dawsbot
Copy link
Copy Markdown
Owner

dawsbot commented Feb 1, 2022

I do not have publish permissions for the package, but it's now merged. @jakob101 could do a new version deploy if this is an important fix.

Can you describe the importance of this fix @dben89x ? 🙏

@dben89x
Copy link
Copy Markdown
Contributor Author

dben89x commented Feb 2, 2022

@dawsbot yes, it adds the option to omit index files from paths. The usage is explained in further detail here. I'd really like to be able to use this function, since without it I always have to manually delete the index.ts part of the path on every component import.

For instance, my folder structure is as follows:

FooComponent
  index.ts
  index.scss
  index.test.ts

When attempting to import FooComponent, I need to import it as ../../../fooFolder/FooComponent. However, without this omission option, it's always imported as ../../../fooFolder/FooComponent/index.ts, and I always have to manually delete index.ts. With the omission option, it omits the index file and just imports ../../../fooFolder/FooComponent instead.

I think this is a common enough pattern to justify its importance, as is evidenced by the following eslint rule. This is also the default behavior of Atom's popular autocomplete-paths extension.

@dawsbot
Copy link
Copy Markdown
Owner

dawsbot commented Feb 2, 2022

That's a great feature, thanks for the write-up @dben89x 🙏

I'll see what I can do to publish this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants