From 7a74ad34f98a09f9a14aca0e1a55e36fa4eb70a2 Mon Sep 17 00:00:00 2001 From: Grant Date: Tue, 6 Aug 2024 00:58:16 +0200 Subject: [PATCH 1/3] Add one more test for array test --- src/rules/enforce-column-types.test.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/rules/enforce-column-types.test.ts b/src/rules/enforce-column-types.test.ts index f0629d3..a8194bc 100644 --- a/src/rules/enforce-column-types.test.ts +++ b/src/rules/enforce-column-types.test.ts @@ -159,14 +159,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[]; @@ -188,6 +188,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 { From b8c4d8c36f75f5f878d6018fe61fc738ddbd8ad7 Mon Sep 17 00:00:00 2001 From: Grant Date: Tue, 6 Aug 2024 00:59:37 +0200 Subject: [PATCH 2/3] Update CHANGELOG --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a7e144a..bcaeba4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## [Unreleased] +## [0.3.1] - 2024-08-06 + ### Changed - Ignore array on JSON columns From 98b1d9c23c12ae7fc05fd72b7727807cfd93a258 Mon Sep 17 00:00:00 2001 From: Grant Date: Tue, 6 Aug 2024 00:59:43 +0200 Subject: [PATCH 3/3] 0.3.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index aee2fec..38930bb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "eslint-plugin-typeorm-typescript", - "version": "0.3.0", + "version": "0.3.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "eslint-plugin-typeorm-typescript", - "version": "0.3.0", + "version": "0.3.1", "license": "ISC", "dependencies": { "@typescript-eslint/parser": "^7.13.0", diff --git a/package.json b/package.json index 91f7547..1299137 100644 --- a/package.json +++ b/package.json @@ -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", "files": [