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
14 changes: 12 additions & 2 deletions apps/oxlint/src/output_formatter/default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,18 @@ mod test_implementation {
let handler = GraphicalReportHandler::new_themed(GraphicalTheme::none());
let mut output = String::new();

self.diagnostics.sort_by_key(|diagnostic| Info::new(diagnostic).filename);
self.diagnostics.sort_by_key(|diagnostic| Info::new(diagnostic).start.line);
self.diagnostics.sort_by_cached_key(|diagnostic| {
let info = Info::new(diagnostic);
(
info.filename,
info.start.line,
info.start.column,
info.end.line,
info.end.column,
info.rule_id,
info.message,
)
});

for diagnostic in &self.diagnostics {
handler.render_report(&mut output, diagnostic.as_ref()).unwrap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ arguments: -c fixtures/typescript_eslint/eslintrc.json fixtures/typescript_eslin
working directory:
----------

! ]8;;https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-namespace.html\typescript-eslint(no-namespace)]8;;\: ES2015 module syntax is preferred over namespaces.
,-[fixtures/typescript_eslint/test.ts:1:1]
1 | namespace X {
: ^^^^^^^^^
2 | }
`----
help: Replace the namespace with an ES2015 module or use `declare module`

! ]8;;https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-unused-vars.html\eslint(no-unused-vars)]8;;\: Variable 'X' is declared but never used.
,-[fixtures/typescript_eslint/test.ts:1:11]
1 | namespace X {
Expand All @@ -15,14 +23,6 @@ working directory:
`----
help: Consider removing this declaration.

! ]8;;https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-namespace.html\typescript-eslint(no-namespace)]8;;\: ES2015 module syntax is preferred over namespaces.
,-[fixtures/typescript_eslint/test.ts:1:1]
1 | namespace X {
: ^^^^^^^^^
2 | }
`----
help: Replace the namespace with an ES2015 module or use `declare module`

x ]8;;https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-loss-of-precision.html\eslint(no-loss-of-precision)]8;;\: This number literal will lose precision at runtime.
,-[fixtures/typescript_eslint/test.ts:4:1]
3 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,6 @@ working directory: fixtures/overrides_env_globals
! ]8;;https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-global-assign.html\eslint(no-global-assign)]8;;\: Read-only global 'globalThis' should not be modified.
,-[test.js:2:1]
1 | // for env detection
2 | globalThis = 'abc';
: ^^^^^|^^^^
: `-- Read-only global 'globalThis' should not be modified.
3 | $ = 'abc';
`----

! ]8;;https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-global-assign.html\eslint(no-global-assign)]8;;\: Read-only global 'globalThis' should not be modified.
,-[test.ts:2:1]
1 | // for env detection
2 | globalThis = 'abc';
: ^^^^^|^^^^
: `-- Read-only global 'globalThis' should not be modified.
Expand All @@ -50,6 +41,15 @@ working directory: fixtures/overrides_env_globals
: `-- Read-only global 'Foo' should not be modified.
`----

! ]8;;https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-global-assign.html\eslint(no-global-assign)]8;;\: Read-only global 'globalThis' should not be modified.
,-[test.ts:2:1]
1 | // for env detection
2 | globalThis = 'abc';
: ^^^^^|^^^^
: `-- Read-only global 'globalThis' should not be modified.
3 | $ = 'abc';
`----

Found 5 warnings and 0 errors.
Finished in <variable>ms on 3 files with 87 rules using 1 threads.
----------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@ working directory: fixtures/overrides_with_plugin
`----
help: "Write a meaningful title for your test"

! ]8;;https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-unused-vars.html\eslint(no-unused-vars)]8;;\: Variable 'foo' is declared but never used. Unused variables should start with a '_'.
,-[index.ts:1:7]
1 | const foo = 123;
: ^|^
: `-- 'foo' is declared here
2 | // no-unused-vars error expected as `eslint` plugin and `correctness` categories are on by default (override is not applied.)
`----
help: Consider removing this declaration.

! ]8;;https://oxc.rs/docs/guide/usage/linter/rules/jest/expect-expect.html\eslint-plugin-jest(expect-expect)]8;;\: Test has no assertions
,-[index.test.ts:4:3]
3 |
Expand All @@ -41,6 +32,15 @@ working directory: fixtures/overrides_with_plugin
`----
help: "Write a meaningful title for your test"

! ]8;;https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-unused-vars.html\eslint(no-unused-vars)]8;;\: Variable 'foo' is declared but never used. Unused variables should start with a '_'.
,-[index.ts:1:7]
1 | const foo = 123;
: ^|^
: `-- 'foo' is declared here
2 | // no-unused-vars error expected as `eslint` plugin and `correctness` categories are on by default (override is not applied.)
`----
help: Consider removing this declaration.

Found 2 warnings and 2 errors.
Finished in <variable>ms on 2 files with 87 rules using 1 threads.
----------
Expand Down
Loading
Loading