@macklinu/oxfmt-config 0.0.0-stage → 1.0.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/README.md CHANGED
@@ -1,3 +1,41 @@
1
- # Temporary Holding Version
1
+ # @macklinu/oxfmt-config
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ My [Oxfmt](https://oxc.rs/docs/guide/usage/formatter) configuration for TypeScript projects.
4
+
5
+ ## Setup
6
+
7
+ Requires Oxfmt 0.77 and Node 22.18+ (22.x) or 24+ to load TypeScript configuration files.
8
+
9
+ ```sh
10
+ pnpm add -D @macklinu/oxfmt-config oxfmt@^0.77.0
11
+ ```
12
+
13
+ Create `oxfmt.config.ts` in your project root:
14
+
15
+ ```ts
16
+ import config from '@macklinu/oxfmt-config'
17
+
18
+ export default config
19
+ ```
20
+
21
+ Run `pnpm exec oxfmt --write .` to format your project, or `pnpm exec oxfmt --check .` to check formatting.
22
+
23
+ ## Style
24
+
25
+ - Use single quotes, including JSX attributes.
26
+ - Omit semicolons.
27
+ - Use Oxfmt's default `trailingComma: 'all'`.
28
+ - Sort imports into side effects, Node.js built-ins, packages, internal aliases, and relative imports.
29
+ - Sort `package.json` fields using Oxfmt's default order.
30
+ - Sort Tailwind CSS classes.
31
+ - Ignore `repos/**`, relative to your `oxfmt.config.ts`.
32
+
33
+ All other options use Oxfmt defaults. Tailwind sorting uses Oxfmt's default Tailwind setup; see [Oxfmt's sorting documentation](https://oxc.rs/docs/guide/usage/formatter/sorting#sort-tailwind-css-classes) for project-specific Tailwind configuration.
34
+
35
+ ## Import sorting
36
+
37
+ Separate import groups with blank lines and sort case-insensitively within each group. Preserve the relative order of side-effect imports, including CSS imports. Type imports stay in their source group rather than a separate types-first group.
38
+
39
+ The grouping follows `simple-import-sort` broadly, but uses Oxfmt's module classification and comparison rules. Node.js built-ins include both `node:` and bare imports such as `fs`.
40
+
41
+ Internal aliases use Oxfmt's default prefixes: `~/`, `@/`, and `#`. Unclassified imports share the internal group; parent, sibling, and index imports share the relative group.
@@ -0,0 +1,15 @@
1
+ declare const _default: {
2
+ singleQuote: true;
3
+ jsxSingleQuote: true;
4
+ semi: false;
5
+ sortImports: {
6
+ groups: (string | string[])[];
7
+ newlinesBetween: true;
8
+ ignoreCase: true;
9
+ sortSideEffects: false;
10
+ };
11
+ sortPackageJson: true;
12
+ sortTailwindcss: true;
13
+ ignorePatterns: string[];
14
+ };
15
+ export default _default;
package/dist/index.js ADDED
@@ -0,0 +1,21 @@
1
+ import { defineConfig } from 'oxfmt';
2
+ export default defineConfig({
3
+ singleQuote: true,
4
+ jsxSingleQuote: true,
5
+ semi: false,
6
+ sortImports: {
7
+ groups: [
8
+ ['side_effect', 'side_effect_style'],
9
+ 'builtin',
10
+ 'external',
11
+ ['internal', 'subpath', 'unknown'],
12
+ ['parent', 'sibling', 'index'],
13
+ ],
14
+ newlinesBetween: true,
15
+ ignoreCase: true,
16
+ sortSideEffects: false,
17
+ },
18
+ sortPackageJson: true,
19
+ sortTailwindcss: true,
20
+ ignorePatterns: ['repos/**'],
21
+ });
package/package.json CHANGED
@@ -1,6 +1,43 @@
1
1
  {
2
2
  "name": "@macklinu/oxfmt-config",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "1.0.0",
4
+ "description": "My personal Oxfmt configuration",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "publishConfig": {
9
+ "access": "public",
10
+ "provenance": true
11
+ },
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/macklinu/config.git",
15
+ "directory": "packages/oxfmt"
16
+ },
17
+ "exports": {
18
+ ".": {
19
+ "types": "./dist/index.d.ts",
20
+ "import": "./dist/index.js"
21
+ }
22
+ },
23
+ "files": [
24
+ "dist",
25
+ "README.md"
26
+ ],
27
+ "keywords": [
28
+ "oxfmt"
29
+ ],
30
+ "author": "Mackie Underdown <macklinu@users.noreply.github.com>",
31
+ "license": "MIT",
32
+ "peerDependencies": {
33
+ "oxfmt": "^0.77.0"
34
+ },
35
+ "devDependencies": {
36
+ "oxfmt": "0.77.0",
37
+ "typescript": "7.0.2"
38
+ },
39
+ "scripts": {
40
+ "build": "tsc -p tsconfig.json",
41
+ "typecheck": "tsc --noEmit"
42
+ }
6
43
  }