@r0hitsharma/oxfmt-config 0.12.0-rohit-fork-ci.1

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 ADDED
@@ -0,0 +1,41 @@
1
+ # @r0hitsharma/oxfmt-config
2
+
3
+ Shared Oxfmt (Oxc formatter) configuration for consistent code formatting.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install --save-dev @r0hitsharma/oxfmt-config oxfmt
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ Use the configuration in your `oxfmt.config.ts`:
14
+
15
+ ```typescript
16
+ import baseConfig from '@r0hitsharma/oxfmt-config';
17
+ import { defineConfig } from 'oxfmt';
18
+
19
+ export default defineConfig({
20
+ ...baseConfig,
21
+ });
22
+ ```
23
+
24
+ ## What the preset sets
25
+
26
+ | Option | Value | Effect |
27
+ | --- | --- | --- |
28
+ | `printWidth` | `80` | wrap target, in columns |
29
+ | `singleQuote` | `true` | `'a'` rather than `"a"` |
30
+ | `semi` | `true` | keep statement semicolons |
31
+ | `trailingComma` | `'all'` | trailing commas everywhere they are legal, including function arguments |
32
+ | `sortImports.enabled` | `true` | reorder import statements on format |
33
+
34
+ `sortImports` rewrites the order of your imports, so expect a large first diff
35
+ when adopting this config in an existing codebase.
36
+
37
+ ## Format code
38
+
39
+ ```bash
40
+ oxfmt . --write
41
+ ```
@@ -0,0 +1,10 @@
1
+ declare const formatConfig: {
2
+ printWidth: number;
3
+ singleQuote: boolean;
4
+ semi: boolean;
5
+ trailingComma: string;
6
+ sortImports: {
7
+ enabled: boolean;
8
+ };
9
+ };
10
+ export default formatConfig;
package/dist/index.js ADDED
@@ -0,0 +1,10 @@
1
+ const formatConfig = {
2
+ printWidth: 80,
3
+ singleQuote: true,
4
+ semi: true,
5
+ trailingComma: 'all',
6
+ sortImports: {
7
+ enabled: true,
8
+ },
9
+ };
10
+ export default formatConfig;
package/index.ts ADDED
@@ -0,0 +1,11 @@
1
+ const formatConfig = {
2
+ printWidth: 80,
3
+ singleQuote: true,
4
+ semi: true,
5
+ trailingComma: 'all',
6
+ sortImports: {
7
+ enabled: true,
8
+ },
9
+ };
10
+
11
+ export default formatConfig;
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@r0hitsharma/oxfmt-config",
3
+ "publishConfig": {
4
+ "access": "public"
5
+ },
6
+ "type": "module",
7
+ "files": [
8
+ "dist",
9
+ "index.ts"
10
+ ],
11
+ "scripts": {
12
+ "build": "tsc -p tsconfig.build.json",
13
+ "clean": "rm -rf dist",
14
+ "prepare": "npm run build",
15
+ "type:check": "tsc -p tsconfig.json --noEmit",
16
+ "lint": "oxlint -c oxlint.config.ts --max-warnings=0 index.ts",
17
+ "lint:fix": "oxlint -c oxlint.config.ts --fix index.ts",
18
+ "format": "oxfmt -c oxfmt.config.ts --write index.ts",
19
+ "format:check": "oxfmt -c oxfmt.config.ts --check index.ts"
20
+ },
21
+ "exports": {
22
+ ".": {
23
+ "types": "./dist/index.d.ts",
24
+ "default": "./dist/index.js"
25
+ }
26
+ },
27
+ "devDependencies": {
28
+ "@r0hitsharma/tsconfig": "*",
29
+ "oxfmt": "0.67.0",
30
+ "oxlint": "1.82.0"
31
+ },
32
+ "version": "0.12.0-rohit-fork-ci.1",
33
+ "repository": {
34
+ "url": "https://github.com/r0hitsharma/uikit"
35
+ }
36
+ }