Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: projects might have strictPropertyInitialization set to true #329

Merged
merged 1 commit into from
Aug 24, 2022

Conversation

cyjake
Copy link
Owner

@cyjake cyjake commented Aug 24, 2022

att

@cyjake cyjake force-pushed the fix-usage-with-strict-property-init branch from 701dc67 to 0387c47 Compare August 24, 2022 05:00
@@ -25,18 +25,9 @@ export interface AbstractDataType<T> {
*/

export abstract class DataType {
dataType: string;
dataType: string = '';
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

compilerOptions.strictPropertyInitialization complains about unset class field

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which is quite common in our test models, such as

class Foo extends Bone {
  @Column()
  id: bigint;
}

added a default value to make downstream projects happy for now

* @returns {boolean}
*/
static is(params: any): boolean {
return params instanceof DataType;
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

further refactor the default export class DataTypes and the base class DataType, which can be imported as import DataTypes, { DataType } from './data_types';

existing code that relies on const { DataTypes } = require('./data_types') is changed to const { default: DataTypes } = require('./data_types') accordingly

@JimmyDaddy JimmyDaddy merged commit c1fdf01 into master Aug 24, 2022
@JimmyDaddy JimmyDaddy deleted the fix-usage-with-strict-property-init branch August 24, 2022 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants