Million Lint Checker is a command line tool that automatically detects whether Million Lint works on your repository or not.
It works by doing the following things -
- Detects package manager and does local setup using @antfu/ni
- Runs @million/lint
- Randomly interacts (fuzzes) with the frontend and detects Million Lint suggestions in the shadow DOM using puppeteer
- Run
npx million-lint-check@latest setup $PORT
, where$PORT
is the port your frontend will run on in development.
- For some projects setup will have to be done manually. Once the project is at a state where a simple
npm run dev
is sufficient to run it, this tool can be used. - This only works with VSCode
- I've only tested this on the project below ;_; (should work for all
nr dev
projects)
We'll test the CLI on crnsh/github-h-index
as an example
git clone https://github.com/crnsh/github-h-index.git
cd github-h-index
code .
(This is temporarily necessary)npx million-lint-check@latest setup 3000
Running development server...
Development server started in the background.
Opening browser and interacting with components...
> [email protected] dev
> next dev
▲ Next.js 14.1.1
- Local: http://localhost:3000
⚡ Million Lint v0.0.66
✓ Ready in 0.18ms
✓ Ready in 2.2s
○ Compiling / ...
✓ Compiled / in 1158ms (380 modules)
✓ Compiled in 180ms (380 modules)
Successfully connected to http://localhost:3000 after 1 attempt(s).
Randomly interacting with page...
Finding element...
Million Lint is working as expected!
Shutting down development server...