Skip to content

Commit

Permalink
docs: suggest biome migrate commands after biome init (#2437)
Browse files Browse the repository at this point in the history
  • Loading branch information
Conaclos authored Apr 14, 2024
1 parent 58c4b0a commit b7f69c8
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 49 deletions.
39 changes: 23 additions & 16 deletions crates/biome_cli/src/commands/init.rs
Original file line number Diff line number Diff line change
@@ -1,40 +1,47 @@
use crate::{CliDiagnostic, CliSession};
use biome_configuration::PartialConfiguration;
use biome_console::{markup, ConsoleExt, HorizontalLine};
use biome_console::{markup, ConsoleExt};
use biome_fs::ConfigName;
use biome_service::configuration::create_config;

pub(crate) fn init(mut session: CliSession, emit_jsonc: bool) -> Result<(), CliDiagnostic> {
let fs = &mut session.app.fs;
create_config(fs, PartialConfiguration::init(), emit_jsonc)?;
let file_created = if emit_jsonc {
format!("{}: ", ConfigName::biome_jsonc())
ConfigName::biome_jsonc()
} else {
format!("{}: ", ConfigName::biome_json())
ConfigName::biome_json()
};

session.app.console.log(markup! {
"\n"<Inverse>"Welcome to Biome! Let's get you started..."</Inverse>"
"
Welcome to Biome! Let's get you started...
"<Info><Emphasis>"Files created "</Emphasis></Info>{HorizontalLine::new(106)}"
"<Info><Emphasis>"Files created "</Emphasis></Info>"
"<Dim>"- "</Dim><Emphasis>{file_created}</Emphasis>"Your project configuration. Documentation: "<Hyperlink href="https://biomejs.dev/reference/configuration">"https://biomejs.dev/reference/configuration"</Hyperlink>"
"<Dim>"- "</Dim><Emphasis>{file_created}</Emphasis>"
Your project configuration. See "<Hyperlink href="https://biomejs.dev/reference/configuration">"https://biomejs.dev/reference/configuration"</Hyperlink>"
"<Info><Emphasis>"Next Steps "</Emphasis></Info>{HorizontalLine::new(109)}"
"<Info><Emphasis>"Next Steps "</Emphasis></Info>"
"<Dim>"1."</Dim>" "<Emphasis>"Setup an editor extension"</Emphasis>"
Get live errors as you type and format when you save. Learn more: "<Hyperlink href="https://biomejs.dev/guides/getting-started#editor-setup">"https://biomejs.dev/guides/getting-started#editor-setup"</Hyperlink>"
Get live errors as you type and format when you save.
Learn more at "<Hyperlink href="https://biomejs.dev/guides/integrate-in-editor/">"https://biomejs.dev/guides/integrate-in-editor/"</Hyperlink>"
"<Dim>"2."</Dim>" "<Emphasis>"Try a command"</Emphasis>"
"<Italic>"biome ci"</Italic>" checks for lint errors and verifies formatting. Run " <Italic>"biome --help"</Italic>" for a full list of commands and options.
"<Italic>"biome check"</Italic>" checks formatting, import sorting, and lint rules.
"<Italic>"biome --help"</Italic>" displays the available commands.
"<Dim>"3."</Dim>" "<Emphasis>"Read the documentation"</Emphasis>"
Our website serves as a comprehensive source of guides and documentation: "<Hyperlink href="https://biomejs.dev">"https://biomejs.dev"</Hyperlink>"
"<Dim>"3."</Dim>" "<Emphasis>"Migrate from ESLint and Prettier"</Emphasis>"
"<Italic>"biome migrate eslint"</Italic>" migrates your ESLint configuration to Biome.
"<Italic>"biome migrate prettier"</Italic>" migrates your Prettier configuration to Biome.
"<Dim>"4."</Dim>" "<Emphasis>"Get involved in the community"</Emphasis>"
Ask questions, get support, or contribute by participating on GitHub ("<Hyperlink href="https://github.com/biomejs/biome">"https://github.com/biomejs/biome"</Hyperlink>"),
or join our community Discord ("<Hyperlink href="https://discord.gg/BypW39g6Yc">"https://discord.gg/BypW39g6Yc"</Hyperlink>")"
});
"<Dim>"4."</Dim>" "<Emphasis>"Read the documentation"</Emphasis>"
Find guides and documentation at "<Hyperlink href="https://biomejs.dev/guides/getting-started/">"https://biomejs.dev/guides/getting-started/"</Hyperlink>"
"<Dim>"5."</Dim>" "<Emphasis>"Get involved with the community"</Emphasis>"
Ask questions and contribute on GitHub: "<Hyperlink href="https://github.com/biomejs/biome">"https://github.com/biomejs/biome"</Hyperlink>"
Seek for help on Discord: "<Hyperlink href="https://discord.gg/BypW39g6Yc">"https://discord.gg/BypW39g6Yc"</Hyperlink>"
"
});
Ok(())
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,30 @@ expression: content
Welcome to Biome! Let's get you started...
Files created ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Files created
- biome.json: Your project configuration. Documentation: https://biomejs.dev/reference/configuration
- biome.json
Your project configuration. See https://biomejs.dev/reference/configuration
Next Steps ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Next Steps
1. Setup an editor extension
Get live errors as you type and format when you save. Learn more: https://biomejs.dev/guides/getting-started#editor-setup
Get live errors as you type and format when you save.
Learn more at https://biomejs.dev/guides/integrate-in-editor/
2. Try a command
biome ci checks for lint errors and verifies formatting. Run biome --help for a full list of commands and options.
biome check checks formatting, import sorting, and lint rules.
biome --help displays the available commands.
3. Read the documentation
Our website serves as a comprehensive source of guides and documentation: https://biomejs.dev
3. Migrate from ESLint and Prettier
biome migrate eslint migrates your ESLint configuration to Biome.
biome migrate prettier migrates your Prettier configuration to Biome.
4. Get involved in the community
Ask questions, get support, or contribute by participating on GitHub (https://github.com/biomejs/biome),
or join our community Discord (https://discord.gg/BypW39g6Yc)
```
4. Read the documentation
Find guides and documentation at https://biomejs.dev/guides/getting-started/
5. Get involved with the community
Ask questions and contribute on GitHub: https://github.com/biomejs/biome
Seek for help on Discord: https://discord.gg/BypW39g6Yc
```
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,30 @@ expression: content
Welcome to Biome! Let's get you started...
Files created ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Files created
- biome.json: Your project configuration. Documentation: https://biomejs.dev/reference/configuration
- biome.json
Your project configuration. See https://biomejs.dev/reference/configuration
Next Steps ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Next Steps
1. Setup an editor extension
Get live errors as you type and format when you save. Learn more: https://biomejs.dev/guides/getting-started#editor-setup
Get live errors as you type and format when you save.
Learn more at https://biomejs.dev/guides/integrate-in-editor/
2. Try a command
biome ci checks for lint errors and verifies formatting. Run biome --help for a full list of commands and options.
biome check checks formatting, import sorting, and lint rules.
biome --help displays the available commands.
3. Read the documentation
Our website serves as a comprehensive source of guides and documentation: https://biomejs.dev
3. Migrate from ESLint and Prettier
biome migrate eslint migrates your ESLint configuration to Biome.
biome migrate prettier migrates your Prettier configuration to Biome.
4. Get involved in the community
Ask questions, get support, or contribute by participating on GitHub (https://github.com/biomejs/biome),
or join our community Discord (https://discord.gg/BypW39g6Yc)
```
4. Read the documentation
Find guides and documentation at https://biomejs.dev/guides/getting-started/
5. Get involved with the community
Ask questions and contribute on GitHub: https://github.com/biomejs/biome
Seek for help on Discord: https://discord.gg/BypW39g6Yc
```
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,30 @@ expression: content
Welcome to Biome! Let's get you started...
Files created ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Files created
- biome.jsonc: Your project configuration. Documentation: https://biomejs.dev/reference/configuration
- biome.jsonc
Your project configuration. See https://biomejs.dev/reference/configuration
Next Steps ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Next Steps
1. Setup an editor extension
Get live errors as you type and format when you save. Learn more: https://biomejs.dev/guides/getting-started#editor-setup
Get live errors as you type and format when you save.
Learn more at https://biomejs.dev/guides/integrate-in-editor/
2. Try a command
biome ci checks for lint errors and verifies formatting. Run biome --help for a full list of commands and options.
biome check checks formatting, import sorting, and lint rules.
biome --help displays the available commands.
3. Read the documentation
Our website serves as a comprehensive source of guides and documentation: https://biomejs.dev
3. Migrate from ESLint and Prettier
biome migrate eslint migrates your ESLint configuration to Biome.
biome migrate prettier migrates your Prettier configuration to Biome.
4. Get involved in the community
Ask questions, get support, or contribute by participating on GitHub (https://github.com/biomejs/biome),
or join our community Discord (https://discord.gg/BypW39g6Yc)
```
4. Read the documentation
Find guides and documentation at https://biomejs.dev/guides/getting-started/
5. Get involved with the community
Ask questions and contribute on GitHub: https://github.com/biomejs/biome
Seek for help on Discord: https://discord.gg/BypW39g6Yc
```

0 comments on commit b7f69c8

Please sign in to comment.