Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions apps/oxlint/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
use std::{ffi::OsStr, io::BufWriter};

pub use oxc_linter::{
ExternalLinter, ExternalLinterLintFileCb, ExternalLinterLoadPluginCb, LintFileResult,
PluginLoadResult,
};

mod command;
mod lint;
mod output_formatter;
Expand All @@ -9,10 +16,7 @@ pub mod cli {
pub use crate::{command::*, lint::LintRunner, result::CliRunResult};
}

pub use oxc_linter::{
ExternalLinter, ExternalLinterLintFileCb, ExternalLinterLoadPluginCb, LintFileResult,
PluginLoadResult,
};
use cli::{CliRunResult, LintRunner};

#[cfg(all(feature = "oxlint2", not(feature = "disable_oxlint2")))]
mod raw_fs;
Expand All @@ -21,9 +25,6 @@ mod raw_fs;
#[global_allocator]
static GLOBAL: mimalloc_safe::MiMalloc = mimalloc_safe::MiMalloc;

use cli::{CliRunResult, LintRunner};
use std::{ffi::OsStr, io::BufWriter};

pub fn lint(external_linter: Option<ExternalLinter>) -> CliRunResult {
init_tracing();
init_miette();
Expand Down
4 changes: 2 additions & 2 deletions apps/oxlint/src/output_formatter/gitlab.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use std::hash::{DefaultHasher, Hash, Hasher};

use oxc_diagnostics::{
Error, Severity,
reporter::{DiagnosticReporter, DiagnosticResult, Info},
};

use std::hash::{DefaultHasher, Hash, Hasher};

use crate::output_formatter::InternalFormatter;

#[derive(Debug, Default)]
Expand Down
7 changes: 5 additions & 2 deletions apps/oxlint/src/tester.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#[cfg(test)]
use crate::cli::{LintRunner, lint_command};
use std::{env, path::PathBuf};

#[cfg(test)]
use cow_utils::CowUtils;
#[cfg(test)]
use lazy_regex::Regex;

#[cfg(test)]
use std::{env, path::PathBuf};
use crate::cli::{LintRunner, lint_command};

#[cfg(test)]
pub struct Tester {
cwd: PathBuf,
Expand Down
3 changes: 2 additions & 1 deletion crates/oxc_codegen/src/comment.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use rustc_hash::{FxHashMap, FxHashSet};
use std::borrow::Cow;

use rustc_hash::{FxHashMap, FxHashSet};

use oxc_ast::{Comment, CommentKind, ast::Program};
use oxc_syntax::identifier::is_line_terminator;

Expand Down
6 changes: 4 additions & 2 deletions crates/oxc_formatter/src/utils/member_chain/groups.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
use std::cell::RefCell;

use oxc_span::{GetSpan, Span};

use super::chain_member::ChainMember;
use crate::{
formatter::{Format, FormatResult, Formatter, prelude::*},
generated::ast_nodes::AstNode,
parentheses::NeedsParentheses,
write,
};
use oxc_span::{GetSpan, Span};
use std::cell::RefCell;

#[derive(Default)]
pub(super) struct MemberChainGroupsBuilder<'a, 'b> {
Expand Down
15 changes: 8 additions & 7 deletions crates/oxc_language_server/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use std::{str::FromStr, sync::Arc};

use futures::future::join_all;
use log::{debug, info, warn};
use options::{Options, Run, WorkspaceOption};
use rustc_hash::FxBuildHasher;
use serde_json::json;
use std::{str::FromStr, sync::Arc};
use tokio::sync::{OnceCell, RwLock, SetError};
use tower_lsp_server::{
Client, LanguageServer, LspService, Server,
Expand All @@ -17,11 +17,6 @@ use tower_lsp_server::{
ServerInfo, Unregistration, Uri, WorkspaceEdit,
},
};
// #
use capabilities::Capabilities;
use code_actions::CODE_ACTION_KIND_SOURCE_FIX_ALL_OXC;
use commands::{FIX_ALL_COMMAND_ID, FixAllCommandArgs};
use worker::WorkspaceWorker;

mod capabilities;
mod code_actions;
Expand All @@ -32,6 +27,12 @@ mod options;
mod tester;
mod worker;

use capabilities::Capabilities;
use code_actions::CODE_ACTION_KIND_SOURCE_FIX_ALL_OXC;
use commands::{FIX_ALL_COMMAND_ID, FixAllCommandArgs};
use options::{Options, Run, WorkspaceOption};
use worker::WorkspaceWorker;

type ConcurrentHashMap<K, V> = papaya::HashMap<K, V, FxBuildHasher>;

const OXC_CONFIG_FILE: &str = ".oxlintrc.json";
Expand Down
6 changes: 4 additions & 2 deletions crates/oxc_linter/src/rules/import/no_absolute_path.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
use std::path::Path;

use serde_json::Value;

use oxc_ast::{
AstKind,
ast::{Argument, Expression},
};
use oxc_diagnostics::OxcDiagnostic;
use oxc_macros::declare_oxc_lint;
use oxc_span::{GetSpan, Span};
use serde_json::Value;
use std::path::Path;

use crate::{AstNode, context::LintContext, rule::Rule};

Expand Down
6 changes: 4 additions & 2 deletions crates/oxc_linter/src/rules/react/jsx_filename_extension.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
use std::ffi::OsStr;

use serde_json::Value;

use oxc_ast::AstKind;
use oxc_diagnostics::OxcDiagnostic;
use oxc_macros::declare_oxc_lint;
use oxc_span::{CompactStr, GetSpan, Span};
use serde_json::Value;
use std::ffi::OsStr;

use crate::{context::LintContext, rule::Rule};

Expand Down
3 changes: 2 additions & 1 deletion crates/oxc_minifier/src/peephole/replace_known_methods.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use cow_utils::CowUtils;
use std::borrow::Cow;

use cow_utils::CowUtils;

use oxc_allocator::TakeIn;
use oxc_ast::ast::*;
use oxc_ecmascript::{
Expand Down
8 changes: 6 additions & 2 deletions crates/oxc_transformer/src/options/es_features.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
// Auto generated by `tasks/compat_data/src/lib.rs`.
#![allow(clippy::enum_glob_use, clippy::match_same_arms)]
use super::{Engine, EngineTargets};

use std::sync::OnceLock;

use browserslist::Version;
use rustc_hash::FxHashMap;
use std::sync::OnceLock;

use super::{Engine, EngineTargets};

#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
pub enum ESFeature {
ES5MemberExpressionLiterals,
Expand Down
3 changes: 2 additions & 1 deletion crates/oxc_transformer/src/typescript/enum.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use rustc_hash::FxHashMap;
use std::cell::Cell;

use rustc_hash::FxHashMap;

use oxc_allocator::{StringBuilder, TakeIn, Vec as ArenaVec};
use oxc_ast::{NONE, ast::*};
use oxc_ast_visit::{VisitMut, walk_mut};
Expand Down
Loading