-
-
Notifications
You must be signed in to change notification settings - Fork 26
feat: update UI, fix generator, add dependencies, and change utilities #182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Hi @hyperz111!, thanks for the Pull Request The pull request title isn't properly formatted. We ask that you update the pull request title to match this format, as we use it to generate changelogs and automate releases.
To Fix: You can fix this problem by clicking 'Edit' next to the pull request title at the top of this page. Read more about contributing to ESLint here |
import fs from "node:fs/promises"; | ||
import semverSatisfies from "semver/functions/satisfies.js"; | ||
import colors from "ansi-colors"; | ||
import pkg from "../package.json" with {type:"json"}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this supported in node.js v18?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the officially supported version is ^18.18.0 || ^20.9.0 || >=21.1.0
. but I feel it's fine - as it is only executed once during configuration generation and does not appear in the generated files. thoughts? @eslint/eslint-team
if (!semverSatisfies(myNodeVersion, compatibleVersionRange)) { | ||
warn(`Need Node.js version ${compatibleVersionRangeText}. But your Node.js version is ${myNodeVersion}. Please upgrade your Node.js first.`); | ||
// eslint-disable-next-line n/no-process-exit -- Exit gracefully | ||
process.exit(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
process.exit(0); | |
process.exit(1); |
Hello, can i use Note
|
I'm open to it. can you explain what's the benefits? (and maybe better open a new issue - let's try not to do too many things in one pr). |
@@ -3,6 +3,7 @@ | |||
|
|||
import path from "node:path"; | |||
import { fileURLToPath } from "node:url"; | |||
import { defineConfig } from "eslint/config"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defineConfig
has been imported in line 1.
Update UI, Fix Generator, Add Dependencies, and Change Utilities
In this PR, i do:
What's changes?
Now if you close the prompt by pressing
ctrl+c
/cmd+c
, this is not give this message.But give this message.
Now logging utilities is have
success()
function. And some change for some function.Now when you create config using flat style. This is NOT have 2 lines between
import
andexport
contents.Before:
After:
Edit plural for dependencies message.
Before:
After:
Show warning if your Node.js version is NOT compatible.
Import
package.json
instead readpackage.json
(./bin/create-config.js
).Now questions prompt UI is updated. See UI Updates
Add
ansi-colors
package,enquirer
(Used UI Prompt Library) dependency.UI Updates
red
.radio
.bold
.