Skip to content

Commit

Permalink
Merge branch 'master' into feature/eslint92
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel7grant committed Aug 9, 2024
2 parents dcdf75e + 98b1d9c commit df06da5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
- Add extension to every import to comply with ES specification
- Add examples to be used as simple setup and end-to-end tests

## [0.3.1] - 2024-08-06

### Changed

- Ignore array on JSON columns
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-typeorm-typescript",
"version": "0.3.0",
"version": "0.3.1",
"description": "An ESLint plugin to catch mistakes if the TypeORM column types and TypeScript types aren't consistent.",
"main": "dist/index.js",
"type": "module",
Expand Down
12 changes: 10 additions & 2 deletions src/rules/enforce-column-types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,14 @@ ruleTester.run('enforce-column-types', enforceColumnTypes, {
}`,
},
{
name: 'should ignore unknown types',
name: 'should allow unknown types',
code: `class Entity {
@Column({ type: 'json' })
unknownField: unknown;
}`,
},
{
name: 'should ignore unknown array types',
name: 'should allow unknown array types',
code: `class Entity {
@Column({ type: 'json' })
unknownArray: unknown[];
Expand All @@ -191,6 +191,14 @@ ruleTester.run('enforce-column-types', enforceColumnTypes, {
referenceNullable: JsonObject | null;
}`,
},
{
name: 'should allow reference array types',
code: `type JsonObject = {};
class Entity {
@Column({ type: 'jsonb' })
referenceArray: JsonObject[];
}`,
},
{
name: 'should ignore transformed types',
code: `class Entity {
Expand Down

0 comments on commit df06da5

Please sign in to comment.