You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Checklist
- Contains unit tests ❌
- Contains breaking changes ❌
- Did you update version and changelog? ✅
- PR title properly formatted (`[XX-000]: description`)? ✅
## This PR contains
- [x] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Other (describe)
## What is the purpose of this PR?
Avoid linting errors when running the `release` command. As a
side-effect, the generated types will now respect the widget's prettier
config.
## Relevant changes
Before writing the generated types to the definition file, the type
generator now runs prettier to format the source.
## What should be covered while testing?
#### Widget with many client types
**Prerequisites**
- A widget (new or existing)
**Steps**
1. Modify the widget xml to include properties of these
[types](https://docs.mendix.com/apidocs-mxsdk/apidocs/pluggable-widgets-property-types):
- Expression Property
- Action Property
- Attribute Property
- List Datasource
- Linked ActionProperty
- Linked AttributeProperty
- Association Property with ReferenceSet
- File Property
- Image Property
- Icon Property
- Selection Property (Multi and Single)
2. Run `npx @mendix/pluggable-widgets-tools build`
3. Run `npx @mendix/pluggable-widgets-tools lint`
**Result**
- With this version of PWT: Step 3 should run without errors
- With earlier version of PWT: Step 3 will report formatting errors on
the typings file
#### Widget with custom prettier rules
**Prerequisites**
- A widget (new or existing)
**Steps**
1. Edit the widget's `prettier.config.js`, add the following settings:
```js
{
semi: false,
singleQuote: true
}
```
4. Run `npx @mendix/pluggable-widgets-tools build`
5. Run `npx @mendix/pluggable-widgets-tools lint`
**Result**
- With this version of PWT: Step 3 should run without errors
- With earlier version of PWT: Step 3 will report formatting errors on
the typings file
Copy file name to clipboardExpand all lines: packages/pluggable-widgets-tools/CHANGELOG.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
19
19
- The `jest-jasmine2` runner has been removed. Tests using Jasmine-specific globals (`jasmine.createSpy()`, `jasmine.objectContaining()`, etc.) will throw `ReferenceError: jasmine is not defined`. Replace with Jest equivalents: `jest.fn()`, `expect.objectContaining()`.
20
20
- Consumers who extended the base config with `globals['ts-jest']` options must migrate those settings to the `@swc/jest` transform config.
21
21
22
+
### Fixed
23
+
24
+
- We updated the type generator to format types according to prettier. Inconsistencies would block the `release` command.
0 commit comments