Skip to content

Commit 847b580

Browse files
Copilotlimonte
andcommitted
chore: prettier -> oxfmt
Co-authored-by: limonte <6059356+limonte@users.noreply.github.com>
1 parent ab47078 commit 847b580

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1537
-1459
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ root = true
33
[*]
44
charset = utf-8
55
indent_style = space
6-
indent_size = 4
6+
indent_size = 2
77
end_of_line = lf
88
insert_final_newline = true
99
trim_trailing_whitespace = true

.github/workflows/ci.yml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,37 +18,37 @@ jobs:
1818
id-token: write # to enable use of OIDC for trusted publishing and npm provenance
1919

2020
steps:
21-
- uses: actions/checkout@v5
21+
- uses: actions/checkout@v5
2222

23-
# because npm 10.8.2 (default) doesn't work with trusted publishing, 11.6.2 works
24-
- name: Setup Node.js
25-
uses: actions/setup-node@v4
26-
with:
27-
node-version: 'lts/*'
23+
# because npm 10.8.2 (default) doesn't work with trusted publishing, 11.6.2 works
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: 'lts/*'
2828

29-
- name: Install npm dependencies
30-
run: yarn install
29+
- name: Install npm dependencies
30+
run: yarn install
3131

32-
- name: Build library package
33-
run: yarn build:lib --configuration=production
32+
- name: Build library package
33+
run: yarn build:lib --configuration=production
3434

35-
- name: Copy readme and license files
36-
run: yarn build:copy-files
35+
- name: Copy readme and license files
36+
run: yarn build:copy-files
3737

38-
- name: Run library tests
39-
run: yarn test:lib --configuration=ci
38+
- name: Run library tests
39+
run: yarn test:lib --configuration=ci
4040

41-
- name: Run demo app tests
42-
run: yarn test:demo --configuration=ci
41+
- name: Run demo app tests
42+
run: yarn test:demo --configuration=ci
4343

44-
- name: Show package.json
45-
run: cat dist/ngx-sweetalert2/package.json
44+
- name: Show package.json
45+
run: cat dist/ngx-sweetalert2/package.json
4646

47-
- name: Build library package for publishing
48-
run: yarn build:lib --configuration production
47+
- name: Build library package for publishing
48+
run: yarn build:lib --configuration production
4949

50-
- name: Run automated release process with semantic-release
51-
if: github.event_name == 'push' && contains(github.ref, 'main')
52-
env:
53-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54-
run: yarn semantic-release
50+
- name: Run automated release process with semantic-release
51+
if: github.event_name == 'push' && contains(github.ref, 'main')
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
run: yarn semantic-release

.oxfmtrc.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"$schema": "./node_modules/oxfmt/configuration_schema.json",
3+
"printWidth": 120,
4+
"tabWidth": 2,
5+
"singleQuote": true,
6+
"trailingComma": "es5",
7+
"sortPackageJson": false,
8+
"ignorePatterns": ["dist"]
9+
}

.prettierignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

.prettierrc

Lines changed: 0 additions & 5 deletions
This file was deleted.

.releaserc.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
"plugins": [
44
"@semantic-release/commit-analyzer",
55
"@semantic-release/release-notes-generator",
6-
["@semantic-release/npm", {
7-
"pkgRoot": "dist/ngx-sweetalert2"
8-
}],
6+
[
7+
"@semantic-release/npm",
8+
{
9+
"pkgRoot": "dist/ngx-sweetalert2"
10+
}
11+
],
912
["@semantic-release/github"]
1013
]
1114
}

ADVANCED_USAGE.md

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,11 @@ import { SwalComponent, provideSweetAlert2ForFeature } from '@sweetalert2/ngx-sw
1515
providers: [
1616
...provideSweetAlert2ForFeature({
1717
dismissOnDestroy: false, // Different from root configuration
18-
})
18+
}),
1919
],
2020
template: `
21-
<swal #featureSwal
22-
title="Feature Modal"
23-
text="This modal won't auto-dismiss when component is destroyed">
24-
</swal>
25-
`
21+
<swal #featureSwal title="Feature Modal" text="This modal won't auto-dismiss when component is destroyed"> </swal>
22+
`,
2623
})
2724
export class FeatureComponent {}
2825
```
@@ -40,9 +37,9 @@ export const appConfig: ApplicationConfig = {
4037
provideSweetAlert2({
4138
provideSwal: () => import('sweetalert2'), // Lazy load
4239
fireOnInit: false,
43-
dismissOnDestroy: true
44-
})
45-
]
40+
dismissOnDestroy: true,
41+
}),
42+
],
4643
};
4744
```
4845

@@ -57,9 +54,9 @@ export const appConfig: ApplicationConfig = {
5754
provideSweetAlert2({
5855
provideSwal: () => import('sweetalert2/dist/sweetalert2.all.min.js'),
5956
fireOnInit: false,
60-
dismissOnDestroy: true
61-
})
62-
]
57+
dismissOnDestroy: true,
58+
}),
59+
],
6360
};
6461
```
6562

@@ -77,11 +74,12 @@ describe('MyComponent', () => {
7774
imports: [MyComponent],
7875
providers: [
7976
provideSweetAlert2({
80-
provideSwal: () => Promise.resolve({
81-
fire: jasmine.createSpy('fire')
82-
}),
83-
})
84-
]
77+
provideSwal: () =>
78+
Promise.resolve({
79+
fire: jasmine.createSpy('fire'),
80+
}),
81+
}),
82+
],
8583
}).compileComponents();
8684
});
8785

@@ -104,9 +102,7 @@ import { SwalDirective } from '@sweetalert2/ngx-sweetalert2';
104102
@Component({
105103
selector: 'simple-component',
106104
imports: [SwalDirective], // Only imports the directive
107-
template: `
108-
<button [swal]="['Hello', 'World!']">Click me</button>
109-
`
105+
template: ` <button [swal]="['Hello', 'World!']">Click me</button> `,
110106
})
111107
export class SimpleComponent {}
112108
```
@@ -122,7 +118,7 @@ import { SwalComponent, SwalDirective } from '@sweetalert2/ngx-sweetalert2';
122118
template: `
123119
<button [swal]="mySwal">Show Modal</button>
124120
<swal #mySwal title="Hello" text="World!"></swal>
125-
`
121+
`,
126122
})
127123
export class AdvancedComponent {}
128124
```
@@ -140,11 +136,12 @@ import { SwalComponent, SwalPortalDirective } from '@sweetalert2/ngx-sweetalert2
140136
<swal title="Dynamic Content">
141137
<div *swalPortal>
142138
<p>This content is rendered inside the SweetAlert modal!</p>
143-
<p>Current time: {{ currentTime | date:'medium' }}</p>
139+
<p>Current time: {{ currentTime | date: 'medium' }}</p>
144140
</div>
145141
</swal>
146-
`
142+
`,
147143
})
148144
export class PortalExampleComponent {
149145
currentTime = new Date();
150146
}
147+
```

MIGRATION.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import { SweetAlert2Module } from '@sweetalert2/ngx-sweetalert2';
1515
imports: [
1616
SweetAlert2Module.forRoot({
1717
fireOnInit: false,
18-
dismissOnDestroy: true
19-
})
18+
dismissOnDestroy: true,
19+
}),
2020
],
2121
// ... other module configuration
2222
})
@@ -32,7 +32,7 @@ import { Component } from '@angular/core';
3232
template: `
3333
<button [swal]="['Hello', 'World!']">Click me</button>
3434
<swal #mySwal title="Hello" text="World!"></swal>
35-
`
35+
`,
3636
})
3737
export class MyComponent {}
3838
```
@@ -48,10 +48,10 @@ export const appConfig: ApplicationConfig = {
4848
providers: [
4949
provideSweetAlert2({
5050
fireOnInit: false,
51-
dismissOnDestroy: true
51+
dismissOnDestroy: true,
5252
}),
5353
// ... other providers
54-
]
54+
],
5555
};
5656
```
5757

@@ -66,7 +66,7 @@ import { SwalComponent, SwalDirective } from '@sweetalert2/ngx-sweetalert2';
6666
template: `
6767
<button [swal]="['Hello', 'World!']">Click me</button>
6868
<swal #mySwal title="Hello" text="World!"></swal>
69-
`
69+
`,
7070
})
7171
export class MyComponent {}
7272
```
@@ -99,21 +99,23 @@ Both approaches can coexist in the same application.
9999
## Testing Updates
100100

101101
### Before
102+
102103
```typescript
103104
beforeEach(() => {
104105
TestBed.configureTestingModule({
105106
imports: [SweetAlert2Module.forRoot()],
106-
declarations: [MyComponent]
107+
declarations: [MyComponent],
107108
});
108109
});
109110
```
110111

111112
### After
113+
112114
```typescript
113115
beforeEach(() => {
114116
TestBed.configureTestingModule({
115117
imports: [MyComponent], // Import the standalone component
116-
providers: [provideSweetAlert2()]
118+
providers: [provideSweetAlert2()],
117119
});
118120
});
119121
```

0 commit comments

Comments
 (0)