@wellmade/oxfmt-config 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Wellmade
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,54 @@
1
+ # @wellmade/oxfmt-config
2
+
3
+ Shared [oxfmt](https://oxc.rs/) config — Oxc's Rust-based formatter.
4
+
5
+ Mirrors `@wellmade/prettier-config`'s choices wherever oxfmt supports the equivalent option. Wellmade dogfoods this on its own internal projects to evaluate oxfmt as a Prettier successor; a parity-test in this package fails CI if the two configs drift.
6
+
7
+ ## Install
8
+
9
+ ```sh
10
+ npm install --save-dev oxfmt @wellmade/oxfmt-config
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ oxfmt does not yet support `extends` in its JSON config (verified against oxfmt 0.52 — `extends` is silently ignored). The only path that actually composes today is a JS/TS runtime config file:
16
+
17
+ ```ts
18
+ // oxfmt.config.ts (or oxfmt.config.js / .mjs)
19
+ import wellmade from '@wellmade/oxfmt-config';
20
+ export default wellmade;
21
+ ```
22
+
23
+ Run:
24
+
25
+ ```sh
26
+ npx oxfmt .
27
+ ```
28
+
29
+ When oxfmt grows JSON `extends` support upstream, we'll add a `.oxfmtrc.json` sibling export and document both paths.
30
+
31
+ ## What's in it
32
+
33
+ | Option | Value | Why |
34
+ | ----------------- | --------- | ------------------------------------------------------------ |
35
+ | `printWidth` | `100` | Sweet spot for side-by-side diff review. |
36
+ | `tabWidth` | `2` | Community default. |
37
+ | `semi` | `true` | Explicit > clever ASI. |
38
+ | `singleQuote` | `true` | JS strings; JSX falls back to double per oxfmt default. |
39
+ | `trailingComma` | `'all'` | Cleaner diffs, smaller AI patches. |
40
+ | `bracketSameLine` | `false` | JSX `>` on its own line. |
41
+ | `endOfLine` | `'lf'` | Cross-platform consistency. |
42
+
43
+ These match `@wellmade/prettier-config` exactly. A test in this package asserts parity for every shared option — if Prettier grows an option oxfmt doesn't have (or vice versa), the test stays green; if both have the same option with different values, CI fails.
44
+
45
+ ## Status
46
+
47
+ `0.x`. oxfmt itself is 0.x, with honest documentation about which Prettier options it doesn't yet support. Output is "near-Prettier" but not byte-identical. Wellmade is using this on its own work before recommending it to customer projects.
48
+
49
+ ## What's intentionally *not* in it
50
+
51
+ - **No `experimentalTernaries`.** Prettier 3.1+ ships this; oxfmt doesn't have an equivalent yet.
52
+ - **No per-file overrides yet.** Prettier's `overrides` for `.svg`, `.md`, `package.json` don't have a 1:1 oxfmt equivalent; revisit when oxfmt's config surface widens.
53
+ - **No Tailwind variant.** No plugin support in oxfmt yet.
54
+ - **No JSON config file.** Until oxfmt supports `extends`, shipping one would imply composition that doesn't actually work.
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@wellmade/oxfmt-config",
3
+ "version": "0.2.0",
4
+ "description": "Wellmade's shared oxfmt config — Oxc's Rust-based formatter, mirroring @wellmade/prettier-config's intent.",
5
+ "license": "MIT",
6
+ "author": {
7
+ "name": "Wellmade",
8
+ "url": "https://www.wellmade.be"
9
+ },
10
+ "homepage": "https://github.com/wellmade-studio/standards-js/tree/main/packages/oxfmt-config",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/wellmade-studio/standards-js.git",
14
+ "directory": "packages/oxfmt-config"
15
+ },
16
+ "bugs": {
17
+ "url": "https://github.com/wellmade-studio/standards-js/issues"
18
+ },
19
+ "type": "module",
20
+ "exports": {
21
+ ".": "./src/index.js"
22
+ },
23
+ "main": "./src/index.js",
24
+ "files": [
25
+ "src/",
26
+ "LICENSE",
27
+ "README.md"
28
+ ],
29
+ "scripts": {
30
+ "lint": "echo 'no-op'",
31
+ "format": "echo 'no-op'",
32
+ "test": "node --test ./test.js"
33
+ },
34
+ "peerDependencies": {
35
+ "oxfmt": ">=0.52.0 <1"
36
+ },
37
+ "devDependencies": {
38
+ "@wellmade/prettier-config": "*"
39
+ },
40
+ "publishConfig": {
41
+ "access": "public"
42
+ },
43
+ "keywords": [
44
+ "oxfmt",
45
+ "oxc",
46
+ "formatter",
47
+ "rust",
48
+ "wellmade"
49
+ ]
50
+ }
package/src/index.js ADDED
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Wellmade's shared oxfmt config, as a JS object.
3
+ *
4
+ * oxfmt does not yet support `extends` in its JSON config (verified
5
+ * against oxfmt 0.52 — extends is silently ignored). The only way to
6
+ * share oxfmt config today is to import this object from a JS/TS
7
+ * runtime config file:
8
+ *
9
+ * // oxfmt.config.ts
10
+ * import wellmade from '@wellmade/oxfmt-config';
11
+ * export default wellmade;
12
+ *
13
+ * Note that JS/TS oxfmt configs require Node.js at runtime. When oxfmt
14
+ * grows JSON `extends` support upstream we'll add the JSON sibling
15
+ * back and document both paths.
16
+ *
17
+ * Mirrors @wellmade/prettier-config's choices wherever oxfmt supports
18
+ * the equivalent option.
19
+ *
20
+ * @see https://oxc.rs/docs/guide/usage/formatter
21
+ */
22
+ export const baseConfig = {
23
+ printWidth: 100,
24
+ tabWidth: 2,
25
+ useTabs: false,
26
+
27
+ semi: true,
28
+ singleQuote: true,
29
+ quoteProps: 'as-needed',
30
+ trailingComma: 'all',
31
+
32
+ bracketSpacing: true,
33
+ bracketSameLine: false,
34
+ arrowParens: 'always',
35
+
36
+ endOfLine: 'lf',
37
+ };
38
+
39
+ export default baseConfig;