I have a resource that is a folder of images. When a user imports an image using the pattern below, it pulls in the whole package.
import {thisIcon} from "../../myResource/dist";
So, I want to put an eslint rule that flags this in the same what that the code below can be used to stop this practice with lodash and similar packages.
"lean-imports/import":[1,[
"lodash"
]]
The lean-imports package seems to use string matching, so this works for my purposes …
"lean-imports/import":[1,[
"lodash",
"../myResources/dist",
"../../myResources/dist",
"../../../myResources/dist",
"../../../../myResources/dist",
"../../../../../myResources/dist",
"../../../../../../myResources/dist",
"../../../../../../../myResources/dist"
]]
Is there a way to do pattern matching to make this work instead of doing this?