Commit Graph

17 Commits

Author SHA1 Message Date
Matt Godbolt
53c7dd328b Configure Biome import organiser with grouped imports (#8431)
Enable Biome's `organizeImports` with groups matching the original
ESLint `import/order` configuration:

1. **Node builtins** (`node:fs`, `path`, etc.)
2. *(blank line)*
3. **Third-party packages** (`express`, `@sentry/node`, etc.)
4. *(blank line)*
5. **Local/relative imports** (`../foo.js`, `./bar.js`, aliases)

This resolves the inconsistency where Biome wasn't enforcing import
grouping, meaning new files would lose the blank-line separation that
the old ESLint config enforced.

### Impact
- **354 files** updated out of 738 checked (~48%)
- **+188 / -240 lines** (net -52) — almost entirely single blank line
additions/removals between import groups
- No import reordering; purely group separator consistency

Fixes #7373

🤖 Generated by LLM (Claude, via OpenClaw)
2026-02-01 20:50:46 -06:00
narpfel
028bd96400 Update rustfmt to 1.89 and 2024 edition (#8059)
Resolves #8058.
2025-08-25 21:23:40 -05:00
Matt Godbolt
8734c3e492 Update biome (#7956)
- latest biome, and fix its configuration
- fixes "static" content to be globally configured too (instead of
per-line)
- fixes issues:
  - imports fixed up
  - `Date.now()` vs `+new Date()`
  - some unused things `_` prefixed
 
After discussion with the team, turned off the unused parameter warning.
2025-07-28 10:34:46 -05:00
partouf
9bc017cc18 fix edition 2024-04-22 20:01:30 +02:00
Patrick Quist
b8325cf0c6 eslint root setting and fixes (#6307) 2024-04-16 21:26:53 +02:00
Mats Jun
3c15839a77 Use rustfmt from the latest rust release (#6326)
The current Rust formatter on site doesn't support modern rust syntax
like async/await. This is because the formatter in production runs using
Rust 2015. Forcing edition=2018 allows more modern rust code to be
formatted properly.

Rustfmt is also shipped directly as a Rust component now, so we don't
have to install it separately.

For what it's worth, attempting to "Ctrl Shift I" format the code in
this shortlink demonstrates the problem https://godbolt.org/z/aP4669KEW
2024-04-14 12:54:08 +02:00
Spydr
0bf769e245 New Language: V (#5297)
V (`vlang`) is a simple, fast and safe general purpose programming
language compiling to human-readable C.

#### Key features of V:

- simplicity, "only one way to do things"
- performance as fast as C
- safety: no null, no globals, no undefined behavior, immutability
- automatic C to V translation, good C interoperability
- hot code reloading
- flexible memory management (GC by default, manual, arena allocation,
autofree)
- other compilation backends like JavaScript, `native` (wip), `wasm`
(wip) or interpreted

#### Links:

Source code: https://github.com/vlang/v
Official website: https://vlang.io
Web playground: https://play.vlang.io/

infra PR: https://github.com/compiler-explorer/infra/pull/1058

#### Things this PR adds:

- General support for V
- Code inspection for the C, Go and JavaScript backends
- Support for the v formatter `v fmt`
- Some V example code

#### Things not implemented:

- Support for binary-output backends like `native` and `wasm`
- Support for running programs

<!-- THIS COMMENT IS INVISIBLE IN THE FINAL PR, BUT FEEL FREE TO REMOVE
IT
Thanks for taking the time to improve CE. We really appreciate it.
Before opening the PR, please make sure that the tests & linter pass
their checks,
  by running `make check`.
In the best case scenario, you are also adding tests to back up your
changes,
  but don't sweat it if you don't. We can discuss them at a later date.
Feel free to append your name to the CONTRIBUTORS.md file
Thanks again, we really appreciate this!
-->

---------

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2023-08-15 22:16:36 -05:00
Mats Jun Larsen
633eb82d18 Transition to ECMAScript Modules (#4780)
Makes the Compiler Explorer app, and all the tooling ESM compatible.
Things that have been done:

1. The package.json has `type: module` now
2. All relative imports have a .js ending
3. All directory imports are now directory/index.js to comply with ESM
standards
4. Dependency node-graceful is now imported into tree, because the
package is broken under esm
5. Dependency p-queue has been bumped to 7.x with ESM support
6. Dependency profanities has been bumped to 3.x with ESM support
7. Webpack config is now both ESM and CommonJS compatible
8. Non-ESM compatible imports have been rewritten
9. ESLint configuration has been tweaked to not fail on .js imports
10. Mocha is now hacked together and ran with ts-node-esm
11. Webpack is now hacked together and ran with ts-node-esm
12. Webpack config is now ESM compatible, so that it can be used in the
dev server
13. Cypress code still runs commonjs, and has been excluded from the
tsconfig
14. All sinon mock tests have been commented out, because sinon module
mocks do not work with ESModules (because ESModules are immutable)

A lot of tests are now giving warnings/errors to stdout, yet still pass.
Docenizer codegenerator scripts have been updated, but I did not re-run
them, and instead just changed their code.

---------

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2023-02-27 18:06:38 -06:00
Mats Jun Larsen
87203f71cb Tsify lib/handlers/formatting.js (#4656) 2023-01-29 19:21:47 +01:00
Florian Albrechtskirchinger
49edec404d Repair http(s) includes after formatting (#3924)
Co-authored-by: Mats Larsen <me@supergrecko.com>
2022-07-29 15:52:50 +02:00
Mats Larsen
02ba6faf1f Port lib/formatters to TypeScript (#3741) 2022-06-05 16:09:35 +02:00
Matt Godbolt
f2c1e0bd31 The Grand Reformat (#3643)
* The Grand Reformat

- everything made prettier...literally
- some tweaks to include a few more files, including documentation
- minor changes to format style
- some tiny `// prettier-ignore` changes to keep a few things the way we like them
- a couple of super minor tweaks to embedded document types to ensure they format correctly
2022-05-09 23:13:50 -05:00
Michael Debertol
c432d624b9 add the formatter for dart (#3362) 2022-02-13 20:05:03 +01:00
Mats Larsen
1406669452 Move BaseFormatter into /lib/formatters (#3250) 2022-01-24 21:07:52 -06:00
Mats Larsen
63b3c90dc2 Add Go formatting with Gofmt (#2966)
Fixes #1009

Supports formatting go code, using gofmt as backend.
2021-10-05 15:41:16 +02:00
Mats Larsen
e7b9cbda91 Respect tab width and tabs/spaces settings for format APIs (#2957)
Site settings for tab width and tabs vs spaces are now being used when sent to the /api/format APIs.

This patch also includes some tiny internal refactoring on the bits related to the formatting API.
2021-09-26 23:56:39 +02:00
Mats Larsen
53b9e0ac59 Support multiple formatter types for /api/format (#2818)
* Make /api/format handle multiple formatter types
* Ignore preferred style if the formatter is a 'one true style' formatter
* Add tests for base formatter
* Document /api/formats and /api/format/<formatter> usage
* Document adding a new formatter
* Update amazon config

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2021-08-24 18:46:38 -05:00