Comments (1)
First of all, thank you for the issue.
The eslint-plugin-mui-path-imports executes rules based on automatically generated json, and it is difficult to incorporate this proposal into those rules, so it will be put on hold at this time.
Below is the history of the creation of eslint-plugin-mui-path-imports.
When I created eslint-plugin-mui-path-imports, I tried to achieve the following
import { Box } from '@mui/material';
↓
import Box from "@mui/material/Box";
At this point, the following can be considered.
import { X } from '@mui/material';
↓
import X from "@mui/material/X";
In other words, we thought we could create an eslint rule that would remove the { and } and add /X after @mui/material.
Applying this rule also allowed us to support many packages in @mui/material, @mui/joy, @mui/lab and @mui/icons-material.
It was particularly effective when adapted to @mui/icons-material.
If I try to apply it to the code you have presented here, I find that it doesn't work.
import { ThemeProvider } from '@mui/material';
↓
import ThemeProvider from "@mui/material/ThemeProvider"; // got
import { ThemeProvider } from '@mui/material/styles'; // want
In the beginning I wanted to support everything, but that would not be enough time for me.
So I'm going to maintain this package to the extent that it can be generated automatically, and it would take a lot of time to deal with the syntax you've presented here, so I'm going to hold off on that for now.
However, when I actually load the syntax you provided in Next.js, it seems that the compile completes about 500ms earlier, so I would like to respond to it if possible.
wait - compiling...
event - compiled client and server successfully in 69 ms (1205 modules)
wait - compiling...
event - compiled client and server successfully in 556 ms (473 modules)
Note to future me.
以下の構文を読み込ませて、@mui/material/の後ろでTypeScriptに自動補完させた時に、stylesは候補に表示されるはず。それとpairで{ ThemeProvider }を読み込み自動テストするようにして、output.jsonの"Box": "@mui/material/Box"を"{ThemeProvider}": "@mui/material/styles"とすれば対応できそうな気がする。
import { } from '@mui/material/'
from eslint-plugin-mui-path-imports.
Related Issues (20)
- v0.0.5
- `@mui/lab` not included? HOT 2
- engines.nodeの12, 14をやめて、18を含める HOT 1
- .nvmrcを含める
- versionup
- versionup
- Support for Joy? HOT 2
- Set node version in github actions to 18
- Support autofix for styled and alpha helpers HOT 3
- Support ImportSpecifier, Unsupport ImportDefaultSpecifier
- Refactor
- auto generate
- Replace importSpecifier.lacal with importSpecifier.imported
- auto generate 2
- Supporting MUI v4 Packages? HOT 7
- Deprecate this repository
- local環境でテストを実行すると失敗する
- 以前のpackage.jsonの更新がpackage-lock.jsonに反映されていないので反映する
- バージョンup v0.0.3 -> v0.0.4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eslint-plugin-mui-path-imports.