-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ignore ts error in dalgen (#264)
<!-- Thank you for your pull request. Please review below requirements. Bug fixes and new features should include tests and possibly benchmarks. Contributors guide: https://github.com/eggjs/egg/blob/master/CONTRIBUTING.md 感谢您贡献代码。请确认下列 checklist 的完成情况。 Bug 修复和新功能必须包含测试,必要时请附上性能测试。 Contributors guide: https://github.com/eggjs/egg/blob/master/CONTRIBUTING.md --> ##### Checklist <!-- Remove items that do not apply. For completed items, change [ ] to [x]. --> - [ ] `npm test` passes - [ ] tests and/or benchmarks are included - [ ] documentation is changed or added - [ ] commit message follows commit guidelines ##### Affected core subsystem(s) <!-- Provide affected core subsystem(s). --> ##### Description of change <!-- Provide a description of the change below this comment. -->
- Loading branch information
Showing
8 changed files
with
115 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Table, Column, ColumnType } from '@eggjs/tegg/dal'; | ||
|
||
@Table({ | ||
comment: 'foo table', | ||
}) | ||
export class Bar { | ||
@Column({ | ||
type: ColumnType.INT, | ||
}, { | ||
primaryKey: true, | ||
}) | ||
id: number; | ||
|
||
@Column({ | ||
type: ColumnType.VARCHAR, | ||
length: 100, | ||
}) | ||
name: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Table, Index, Column, ColumnType, IndexType } from '@eggjs/tegg/dal'; | ||
|
||
@Table({ | ||
comment: 'foo table', | ||
}) | ||
@Index({ | ||
keys: [ 'name' ], | ||
type: IndexType.UNIQUE, | ||
}) | ||
export class Foo { | ||
@Column({ | ||
type: ColumnType.INT, | ||
}, { | ||
primaryKey: true, | ||
}) | ||
id: number; | ||
|
||
@Column({ | ||
type: ColumnType.INT, | ||
length: 100, | ||
}) | ||
name: number; | ||
} |
11 changes: 11 additions & 0 deletions
11
test/fixtures/dal-with-ts-error/app/modules/dal/FooService.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { SingletonProto } from '@eggjs/tegg'; | ||
import { Foo } from './Foo'; | ||
|
||
@SingletonProto() | ||
export class FooService { | ||
foo() { | ||
const foo = new Foo(); | ||
foo.id = '233'; | ||
foo.name = '233'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "dal", | ||
"eggModule": { | ||
"name": "dal" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "dal", | ||
"egg": { | ||
"typescript": true | ||
}, | ||
"repository": "[email protected]:eggjs/egg-bin.git", | ||
"devDependencies": { | ||
"@eggjs/tsconfig": "^1.3.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"extends": "@eggjs/tsconfig", | ||
"compilerOptions": { | ||
"baseUrl": "." | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters