@yoo-digital/oxfmt-config 0.0.0-stage → 0.1.1-canary.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 +21 -0
- package/README.md +62 -2
- package/oxfmt.config.d.mts +5 -0
- package/oxfmt.config.mjs +32 -0
- package/package.json +86 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 YOO AG
|
|
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
CHANGED
|
@@ -1,3 +1,63 @@
|
|
|
1
|
-
#
|
|
1
|
+
# YOO Oxfmt Configuration
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
_This package contains a reusable [oxfmt](https://oxc.rs/docs/guide/usage/formatter) configuration for projects @ YOO._
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@yoo-digital/oxfmt-config)
|
|
6
|
+
|
|
7
|
+
## Introduction
|
|
8
|
+
|
|
9
|
+
The configuration builds on oxfmt's defaults and adds the following settings:
|
|
10
|
+
|
|
11
|
+
- Single quotes in JavaScript and TypeScript, double quotes in CSS, SCSS and HTML
|
|
12
|
+
- One attribute per line in HTML and JSX
|
|
13
|
+
- Sorted imports, without blank lines between import groups
|
|
14
|
+
- `package.json` files are not sorted
|
|
15
|
+
- HTML files use a print width of 120
|
|
16
|
+
- Angular component templates are formatted with the Angular parser (see [Angular templates](#angular-templates))
|
|
17
|
+
|
|
18
|
+
## Using the Configuration
|
|
19
|
+
|
|
20
|
+
Install the configuration together with oxfmt:
|
|
21
|
+
|
|
22
|
+
```text
|
|
23
|
+
pnpm add -D @yoo-digital/oxfmt-config oxfmt
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Create an `oxfmt.config.mts` file in the root of your project:
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
export { default } from '@yoo-digital/oxfmt-config';
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Then run `oxfmt` to format your project, or `oxfmt --check` to verify the formatting (e.g. in CI).
|
|
33
|
+
|
|
34
|
+
## Extending the Configuration
|
|
35
|
+
|
|
36
|
+
oxfmt has no `extends` option. Spread the configuration and add your project-specific options:
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
import yooOxfmtConfig from '@yoo-digital/oxfmt-config';
|
|
40
|
+
import { defineConfig } from 'oxfmt';
|
|
41
|
+
|
|
42
|
+
export default defineConfig({
|
|
43
|
+
...yooOxfmtConfig,
|
|
44
|
+
// overrides
|
|
45
|
+
});
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
For a complete overview of configuration options please refer to the [official documentation](https://oxc.rs/docs/guide/usage/formatter/config).
|
|
49
|
+
|
|
50
|
+
## Ignoring files
|
|
51
|
+
|
|
52
|
+
oxfmt respects `.gitignore` files. Use the `ignorePatterns` option to ignore additional files.
|
|
53
|
+
|
|
54
|
+
## Angular templates
|
|
55
|
+
|
|
56
|
+
Angular component templates are formatted with the Angular parser, which supports control flow blocks
|
|
57
|
+
(`@if`, `@for`, …), bindings and pipes. Templates are detected by these patterns:
|
|
58
|
+
|
|
59
|
+
- `**/*.component.html`
|
|
60
|
+
- `**/src/app/**/*.html` (Angular 20+ naming without the `.component` suffix, e.g. `app.html`)
|
|
61
|
+
|
|
62
|
+
All other `*.html` files, such as `src/index.html`, are formatted as plain HTML. If your templates live elsewhere,
|
|
63
|
+
add your own entry to `associations` with `language: 'angular-html'`.
|
package/oxfmt.config.mjs
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
import { defineConfig } from 'oxfmt';
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
singleQuote: true,
|
|
6
|
+
singleAttributePerLine: true,
|
|
7
|
+
sortPackageJson: false,
|
|
8
|
+
sortImports: {
|
|
9
|
+
newlinesBetween: false,
|
|
10
|
+
},
|
|
11
|
+
associations: [
|
|
12
|
+
{
|
|
13
|
+
files: ['**/*.component.html', '**/src/app/**/*.html'],
|
|
14
|
+
language: 'angular-html',
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
overrides: [
|
|
18
|
+
{
|
|
19
|
+
files: ['**/*.scss', '**/*.css'],
|
|
20
|
+
options: {
|
|
21
|
+
singleQuote: false,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
files: ['**/*.html'],
|
|
26
|
+
options: {
|
|
27
|
+
singleQuote: false,
|
|
28
|
+
printWidth: 120,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,89 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yoo-digital/oxfmt-config",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.1-canary.0",
|
|
4
|
+
"description": "Reusable oxfmt configuration for projects within YOO AG",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"keywords": [
|
|
10
|
+
"Oxfmt",
|
|
11
|
+
"Formatter"
|
|
12
|
+
],
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git@github.com:yoo-digital/config.git",
|
|
16
|
+
"directory": "packages/oxfmt-config"
|
|
17
|
+
},
|
|
18
|
+
"author": {
|
|
19
|
+
"name": "YOO AG",
|
|
20
|
+
"email": "info@yoo.digital",
|
|
21
|
+
"url": "https://www.yoo.digital/"
|
|
22
|
+
},
|
|
23
|
+
"contributors": [
|
|
24
|
+
{
|
|
25
|
+
"name": "Björn Bühler",
|
|
26
|
+
"email": "bjoern.buehler@yoo.digital"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "Cédric Madörin",
|
|
30
|
+
"email": "cedric.madoerin@yoo.digital"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "Emanuel Marsicovetere",
|
|
34
|
+
"email": "emanuel.marsicovetere@yoo.digital"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"name": "Hervé Brunner",
|
|
38
|
+
"email": "herve.brunner@yoo.digital"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"name": "Kelvin Louis",
|
|
42
|
+
"email": "kelvin.louis@yoo.digital"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "Robin Hahne",
|
|
46
|
+
"email": "robin.hahne@yoo.digital"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "Sacha Schmid",
|
|
50
|
+
"email": "sacha.schmid@yoo.digital"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "Tobias Maier",
|
|
54
|
+
"email": "tobias.maier@yoo.digital"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"name": "Tobias Wahl",
|
|
58
|
+
"email": "tobias.wahl@yoo.digital"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"name": "Yanick Recher",
|
|
62
|
+
"email": "yanick.recher@yoo.digital"
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"exports": {
|
|
66
|
+
".": {
|
|
67
|
+
"types": "./oxfmt.config.d.mts",
|
|
68
|
+
"import": "./oxfmt.config.mjs"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"types": "./oxfmt.config.d.mts",
|
|
72
|
+
"files": [
|
|
73
|
+
"LICENSE",
|
|
74
|
+
"README.md",
|
|
75
|
+
"oxfmt.config.d.mts",
|
|
76
|
+
"oxfmt.config.mjs"
|
|
77
|
+
],
|
|
78
|
+
"engines": {
|
|
79
|
+
"node": ">=24",
|
|
80
|
+
"pnpm": ">=11"
|
|
81
|
+
},
|
|
82
|
+
"devDependencies": {
|
|
83
|
+
"oxfmt": "~0.76.0",
|
|
84
|
+
"typescript": "~6.0.3"
|
|
85
|
+
},
|
|
86
|
+
"peerDependencies": {
|
|
87
|
+
"oxfmt": ">=0.76.0 <1"
|
|
88
|
+
}
|
|
6
89
|
}
|