@qlik/oxfmt-config 0.1.4 → 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/CHANGELOG.md +18 -0
- package/README.md +114 -4
- package/package.json +11 -4
- package/tsconfig.json +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @qlik/oxfmt-config
|
|
2
2
|
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9d137bd: Bumping minor versions after comprimised packages has been unpublished
|
|
8
|
+
|
|
9
|
+
## 0.1.6
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 4fa171a: chore: update npm dependencies
|
|
14
|
+
|
|
15
|
+
## 0.1.5
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 9549105: Update repository metadata from an SSH URL to the public git+https Git URL
|
|
20
|
+
|
|
3
21
|
## 0.1.4
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# @qlik/oxfmt-config
|
|
2
2
|
|
|
3
|
-
Oxfmt config to share among projects for consistent formatting. The config is based on oxfmt's default values except for `printWidth` which is set to 120 (default is 100), and enables package
|
|
3
|
+
Oxfmt config to share among projects for consistent formatting. The config is based on oxfmt's default values except for `printWidth` which is set to 120 (default is 100), and enables `package.json` sorting.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Usage
|
|
6
6
|
|
|
7
|
-
Install `@qlik/oxfmt-config` as a devDependency in package.json
|
|
7
|
+
Install `@qlik/oxfmt-config` as a devDependency in `package.json`.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
If the repo already has a `tsconfig.json`, prefer `oxfmt.config.ts`. Otherwise, use `oxfmt.config.js`.
|
|
10
10
|
|
|
11
11
|
```ts
|
|
12
12
|
import config from "@qlik/oxfmt-config";
|
|
@@ -14,6 +14,116 @@ import { defineConfig } from "oxfmt";
|
|
|
14
14
|
|
|
15
15
|
export default defineConfig({
|
|
16
16
|
...config,
|
|
17
|
+
// sortImports: true,
|
|
18
|
+
// jsdoc: {
|
|
19
|
+
// commentLineStrategy: "keep",
|
|
20
|
+
// },
|
|
17
21
|
ignorePatterns: ["pnpm-lock.yaml"],
|
|
18
22
|
});
|
|
19
23
|
```
|
|
24
|
+
|
|
25
|
+
## Migration From Prettier
|
|
26
|
+
|
|
27
|
+
Follow the manual steps below, or paste the AI prompt into a Copilot agent chat.
|
|
28
|
+
|
|
29
|
+
The ideal end-state is:
|
|
30
|
+
|
|
31
|
+
- `oxfmt` and `@qlik/oxfmt-config` installed
|
|
32
|
+
- `prettier`, `@qlik/prettier-config`, and prettier-only plugins/config removed
|
|
33
|
+
- a very small `oxfmt.config.ts` or `oxfmt.config.js`
|
|
34
|
+
- `ignorePatterns` containing only repo-specific exclusions that still need explicit formatter ignores
|
|
35
|
+
- `format:write` and `format:check` running `oxfmt` and `oxfmt --check`
|
|
36
|
+
|
|
37
|
+
### Manual steps
|
|
38
|
+
|
|
39
|
+
1. Inspect the current Prettier setup:
|
|
40
|
+
- `.prettierrc*`, `prettier.config.*`, and `package.json#prettier`
|
|
41
|
+
- `.prettierignore`
|
|
42
|
+
- `package.json` scripts and dependencies
|
|
43
|
+
- CI and editor settings that invoke Prettier
|
|
44
|
+
- whether the repo already has a `tsconfig.json`
|
|
45
|
+
- any `printWidth` other than 120
|
|
46
|
+
2. Update dependencies:
|
|
47
|
+
- add `oxfmt` and `@qlik/oxfmt-config`
|
|
48
|
+
- remove `prettier`, `@qlik/prettier-config`, prettier plugins, and other prettier-only packages
|
|
49
|
+
3. Create the local oxfmt config:
|
|
50
|
+
- if a `tsconfig.json` is present, create `oxfmt.config.ts`; otherwise create `oxfmt.config.js`
|
|
51
|
+
- prefer `oxfmt.config.ts/js` over `.oxfmtrc.*`
|
|
52
|
+
- import the shared config from `@qlik/oxfmt-config` and keep the file compact
|
|
53
|
+
- if the repo uses a `printWidth` other than 120, carry it over directly under `...config` with a TODO to consider switching back to the shared default
|
|
54
|
+
- otherwise keep the config order as `...config`, commented `sortImports`, commented `jsdoc`, then `ignorePatterns`; if `printWidth` is needed, place it between `...config` and commented `sortImports`
|
|
55
|
+
4. Migrate ignore patterns:
|
|
56
|
+
- start from `.prettierignore`
|
|
57
|
+
- move only the patterns that still need explicit formatter ignores into `ignorePatterns`
|
|
58
|
+
- drop entries already covered by `.gitignore` or other VCS ignore defaults
|
|
59
|
+
- delete `.prettierignore` after the moved patterns are preserved
|
|
60
|
+
5. Update scripts and automation:
|
|
61
|
+
- replace Prettier commands with `oxfmt`
|
|
62
|
+
- use `oxfmt --check` for CI or read-only validation
|
|
63
|
+
- keep the command shape simple: `oxfmt` and `oxfmt --check`
|
|
64
|
+
6. Delete obsolete Prettier config:
|
|
65
|
+
- remove `.prettierrc*`, `prettier.config.*`, and `package.json#prettier`
|
|
66
|
+
- remove repo-local editor settings or CI steps that only exist for Prettier
|
|
67
|
+
7. Run the formatter and the repo's normal validation commands.
|
|
68
|
+
|
|
69
|
+
### AI Prompt
|
|
70
|
+
|
|
71
|
+
````text
|
|
72
|
+
I want to migrate this project from Prettier / @qlik/prettier-config to oxfmt using @qlik/oxfmt-config.
|
|
73
|
+
|
|
74
|
+
Make the final setup as small and clean as possible, and explain non-trivial changes.
|
|
75
|
+
|
|
76
|
+
1. Inspect the current formatter setup:
|
|
77
|
+
- `.prettierrc*`, `prettier.config.*`, and `package.json#prettier`
|
|
78
|
+
- `.prettierignore`
|
|
79
|
+
- scripts, dependencies, CI/editor integrations
|
|
80
|
+
- whether the repo has a tsconfig
|
|
81
|
+
- any `printWidth` other than 120
|
|
82
|
+
|
|
83
|
+
2. Replace Prettier with oxfmt:
|
|
84
|
+
- add `oxfmt` and `@qlik/oxfmt-config`
|
|
85
|
+
- remove `prettier`, `@qlik/prettier-config`, prettier plugins, and other prettier-only tooling
|
|
86
|
+
- create `oxfmt.config.ts` if the repo has a tsconfig; otherwise create `oxfmt.config.js`
|
|
87
|
+
- prefer `oxfmt.config.ts/js` over `.oxfmtrc.*`
|
|
88
|
+
- use this shape:
|
|
89
|
+
|
|
90
|
+
```ts
|
|
91
|
+
import config from "@qlik/oxfmt-config";
|
|
92
|
+
import { defineConfig } from "oxfmt";
|
|
93
|
+
|
|
94
|
+
export default defineConfig({
|
|
95
|
+
...config,
|
|
96
|
+
// TODO: Consider using the shared @qlik/oxfmt-config default printWidth again.
|
|
97
|
+
// printWidth: 100,
|
|
98
|
+
// sortImports: true,
|
|
99
|
+
// jsdoc: {
|
|
100
|
+
// commentLineStrategy: "keep",
|
|
101
|
+
// },
|
|
102
|
+
ignorePatterns: [],
|
|
103
|
+
});
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
- if the current repo uses a `printWidth` other than 120, uncomment or add that `printWidth` directly under `...config` and keep the TODO above it
|
|
107
|
+
- otherwise keep the order as `...config`, commented `sortImports`, commented `jsdoc`, `ignorePatterns`
|
|
108
|
+
|
|
109
|
+
3. Migrate ignores and scripts:
|
|
110
|
+
- port `.prettierignore` into `ignorePatterns`
|
|
111
|
+
- drop entries already covered by `.gitignore` or other VCS ignore defaults
|
|
112
|
+
- delete `.prettierignore`
|
|
113
|
+
- replace formatter scripts with `oxfmt` and `oxfmt --check`
|
|
114
|
+
|
|
115
|
+
4. Delete obsolete Prettier setup:
|
|
116
|
+
- remove `.prettierrc*`, `prettier.config.*`, and `package.json#prettier`
|
|
117
|
+
- remove repo-local editor or CI settings that only exist for Prettier
|
|
118
|
+
|
|
119
|
+
5. Apply and validate:
|
|
120
|
+
- run `oxfmt`
|
|
121
|
+
- run `oxfmt --check`
|
|
122
|
+
- run the repo's normal lint, type-check, and test commands
|
|
123
|
+
- summarize removed packages/files and any follow-up cleanup
|
|
124
|
+
|
|
125
|
+
Important:
|
|
126
|
+
- Prefer deletion over preserving historical Prettier setup.
|
|
127
|
+
- Keep repo-specific config minimal.
|
|
128
|
+
- Avoid unrelated refactors.
|
|
129
|
+
````
|
package/package.json
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qlik/oxfmt-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Qlik's shared oxfmt config",
|
|
5
5
|
"license": "ISC",
|
|
6
|
-
"repository":
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/qlik-oss/dev-tools-js.git"
|
|
9
|
+
},
|
|
7
10
|
"type": "module",
|
|
8
11
|
"main": "./oxfmt.config.js",
|
|
9
12
|
"types": "./oxfmt.config.d.ts",
|
|
@@ -11,6 +14,9 @@
|
|
|
11
14
|
"access": "public",
|
|
12
15
|
"registry": "https://registry.npmjs.org/"
|
|
13
16
|
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"oxfmt": "^0.63.0"
|
|
19
|
+
},
|
|
14
20
|
"peerDependencies": {
|
|
15
21
|
"oxfmt": ">=0.38.0"
|
|
16
22
|
},
|
|
@@ -18,7 +24,8 @@
|
|
|
18
24
|
"node": ">=22.18.0"
|
|
19
25
|
},
|
|
20
26
|
"scripts": {
|
|
21
|
-
"format:check": "
|
|
22
|
-
"format:write": "
|
|
27
|
+
"format:check": "oxfmt --check .",
|
|
28
|
+
"format:write": "oxfmt .",
|
|
29
|
+
"check-types": "tsc --noEmit"
|
|
23
30
|
}
|
|
24
31
|
}
|
package/tsconfig.json
ADDED