lint: fix offenses for @typescript-eslint/no-unused-vars rule in tests folder (#11755)

This commit is contained in:
Piotr Kuczynski 2025-11-09 21:54:36 +01:00 committed by GitHub
parent 69dfc42eb9
commit 08a9397491
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
216 changed files with 310 additions and 335 deletions

View File

@ -11,12 +11,12 @@ export class Counters {
@Column()
favorites: number
@Column((type) => Information, { prefix: "info" })
@Column(() => Information, { prefix: "info" })
information: Information
@Column((type) => Information, { prefix: "testData" })
@Column(() => Information, { prefix: "testData" })
data: Information
@Column((type) => Information, { prefix: "" })
@Column(() => Information, { prefix: "" })
dataWithoutPrefix: Information
}

View File

@ -14,12 +14,12 @@ export class Post {
@Column()
text: string
@Column((type) => Counters)
@Column(() => Counters)
counters: Counters
@Column((type) => Counters, { prefix: "testCounters" })
@Column(() => Counters, { prefix: "testCounters" })
otherCounters: Counters
@Column((type) => Counters, { prefix: "" })
@Column(() => Counters, { prefix: "" })
countersWithoutPrefix: Counters
}

View File

@ -11,6 +11,6 @@ export class SimpleCounters {
@Column()
favorites: number
@Column((type) => Information, { prefix: "info" })
@Column(() => Information, { prefix: "info" })
information: Information
}

View File

@ -14,6 +14,6 @@ export class SimplePost {
@Column()
text: string
@Column((type) => SimpleCounters)
@Column(() => SimpleCounters)
counters: SimpleCounters
}

View File

@ -1,13 +1,12 @@
import { EventSubscriber } from "../../../../../../src/decorator/listeners/EventSubscriber"
import { EntitySubscriberInterface } from "../../../../../../src/subscriber/EntitySubscriberInterface"
import { InsertEvent } from "../../../../../../src/subscriber/event/InsertEvent"
@EventSubscriber()
export class TestBlogSubscriber implements EntitySubscriberInterface {
/**
* Called after entity insertion.
*/
beforeInsert(event: InsertEvent<any>) {
beforeInsert() {
// Do nothing
}
}

View File

@ -1,13 +1,12 @@
import { EventSubscriber } from "../../../../../../src/decorator/listeners/EventSubscriber"
import { EntitySubscriberInterface } from "../../../../../../src/subscriber/EntitySubscriberInterface"
import { InsertEvent } from "../../../../../../src/subscriber/event/InsertEvent"
@EventSubscriber()
export class TestQuestionSubscriber implements EntitySubscriberInterface {
/**
* Called before entity insertion.
*/
beforeInsert(event: InsertEvent<any>) {
beforeInsert() {
// Do nothing
}
}

View File

@ -1,13 +1,12 @@
import { EventSubscriber } from "../../../../../../src/decorator/listeners/EventSubscriber"
import { EntitySubscriberInterface } from "../../../../../../src/subscriber/EntitySubscriberInterface"
import { InsertEvent } from "../../../../../../src/subscriber/event/InsertEvent"
@EventSubscriber()
export class TestVideoSubscriber implements EntitySubscriberInterface {
/**
* Called after entity insertion.
*/
beforeInsert(event: InsertEvent<any>) {
beforeInsert() {
// Do nothing
}
}

View File

@ -1,13 +1,12 @@
import { EntitySubscriberInterface } from "../../../../src/subscriber/EntitySubscriberInterface"
import { EventSubscriber } from "../../../../src/decorator/listeners/EventSubscriber"
import { InsertEvent } from "../../../../src/subscriber/event/InsertEvent"
@EventSubscriber()
export class FirstConnectionSubscriber implements EntitySubscriberInterface {
/**
* Called after entity insertion.
*/
beforeInsert(event: InsertEvent<any>) {
beforeInsert() {
// Do nothing
}
}

View File

@ -1,13 +1,12 @@
import { EntitySubscriberInterface } from "../../../../src/subscriber/EntitySubscriberInterface"
import { EventSubscriber } from "../../../../src/decorator/listeners/EventSubscriber"
import { InsertEvent } from "../../../../src/subscriber/event/InsertEvent"
@EventSubscriber()
export class SecondConnectionSubscriber implements EntitySubscriberInterface {
/**
* Called after entity insertion.
*/
beforeInsert(event: InsertEvent<any>) {
beforeInsert() {
// Do nothing
}
}

View File

@ -18,10 +18,10 @@ export class Category {
@Column()
isRemoved: boolean = false
@ManyToMany((type) => Post, (post) => post.categories)
@ManyToMany(() => Post, (post) => post.categories)
posts: Post[]
@ManyToMany((type) => Image, (image) => image.categories)
@ManyToMany(() => Image, (image) => image.categories)
@JoinTable()
images: Image[]

View File

@ -16,7 +16,7 @@ export class Image {
@Column()
isRemoved: boolean = false
@ManyToMany((type) => Category, (category) => category.images)
@ManyToMany(() => Category, (category) => category.images)
categories: Category[]
@RelationCount((image: Image) => image.categories)

View File

@ -17,7 +17,7 @@ export class Post {
@Column()
isRemoved: boolean = false
@ManyToMany((type) => Category, (category) => category.posts)
@ManyToMany(() => Category, (category) => category.posts)
@JoinTable()
categories: Category[]

View File

@ -18,10 +18,10 @@ export class Category {
@Column()
isRemoved: boolean = false
@ManyToMany((type) => Post, (post) => post.categories)
@ManyToMany(() => Post, (post) => post.categories)
posts: Post[]
@ManyToMany((type) => Image)
@ManyToMany(() => Image)
@JoinTable()
images: Image[]

View File

@ -17,11 +17,11 @@ export class Post {
@Column()
isRemoved: boolean = false
@ManyToMany((type) => Category, (category) => category.posts)
@ManyToMany(() => Category, (category) => category.posts)
@JoinTable()
categories: Category[]
@ManyToMany((type) => Category)
@ManyToMany(() => Category)
@JoinTable()
subcategories: Category[]

View File

@ -16,6 +16,6 @@ export class Post {
@Column()
text: string
@Column((type) => PostInformation, { prefix: "info" })
@Column(() => PostInformation, { prefix: "info" })
information: PostInformation = new PostInformation()
}

View File

@ -8,7 +8,7 @@ export class PostInformation {
@Index()
description: string
@Column((type) => PostCounter, { prefix: "counters" })
@Column(() => PostCounter, { prefix: "counters" })
counters: PostCounter = new PostCounter()
@BeforeInsert()

View File

@ -20,7 +20,7 @@ export class Counters {
@Column(() => Subcounters, { prefix: "subcnt" })
subcounters: Subcounters
@ManyToMany((type) => User, (user) => user.likedPosts)
@ManyToMany(() => User, (user) => user.likedPosts)
@JoinTable()
likedUsers: User[]
}

View File

@ -12,6 +12,6 @@ export class User {
@Column()
name: string
@ManyToMany((type) => Post, (post) => post.counters.likedUsers)
@ManyToMany(() => Post, (post) => post.counters.likedUsers)
likedPosts: Post[]
}

View File

@ -19,6 +19,6 @@ export class Counters {
@Column(() => Subcounters, { prefix: "subcnt" })
subcounters: Subcounters
@ManyToMany((type) => User, (user) => user.likedPosts)
@ManyToMany(() => User, (user) => user.likedPosts)
likedUsers: User[]
}

View File

@ -13,7 +13,7 @@ export class User {
@Column()
name: string
@ManyToMany((type) => Post, (post) => post.counters.likedUsers)
@ManyToMany(() => Post, (post) => post.counters.likedUsers)
@JoinTable()
likedPosts: Post[]
}

View File

@ -21,7 +21,7 @@ export class Counters {
@Column(() => Subcounters, { prefix: "subcnt" })
subcounters: Subcounters
@ManyToMany((type) => User, (user) => user.likedPosts)
@ManyToMany(() => User, (user) => user.likedPosts)
@JoinTable()
likedUsers: User[]
}

View File

@ -12,6 +12,6 @@ export class User {
@Column()
name: string
@ManyToMany((type) => Post, (post) => post.counters.likedUsers)
@ManyToMany(() => Post, (post) => post.counters.likedUsers)
likedPosts: Post[]
}

View File

@ -20,7 +20,7 @@ export class Counters {
@Column(() => Subcounters, { prefix: "subcnt" })
subcounters: Subcounters
@ManyToMany((type) => User, (user) => user.likedPosts)
@ManyToMany(() => User, (user) => user.likedPosts)
@JoinTable()
likedUsers: User[]
}

View File

@ -15,6 +15,6 @@ export class User {
@Column()
name: string
@ManyToMany((type) => Post, (post) => post.counters.likedUsers)
@ManyToMany(() => Post, (post) => post.counters.likedUsers)
likedPosts: Post[]
}

View File

@ -21,7 +21,7 @@ export class Counters {
@Column(() => Subcounters, { prefix: "subcnt" })
subcounters: Subcounters
@ManyToMany((type) => User, (user) => user.likedPosts)
@ManyToMany(() => User, (user) => user.likedPosts)
@JoinTable()
likedUsers: User[]
}

View File

@ -15,6 +15,6 @@ export class User {
@Column()
name: string
@ManyToMany((type) => Post, (post) => post.counters.likedUsers)
@ManyToMany(() => Post, (post) => post.counters.likedUsers)
likedPosts: Post[]
}

View File

@ -16,6 +16,6 @@ export class Post {
@Column()
text: string
@Column((type) => PostInformation, { prefix: "info" })
@Column(() => PostInformation, { prefix: "info" })
information?: PostInformation
}

View File

@ -6,7 +6,7 @@ export class PostInformation {
@Column({ nullable: true })
description?: string
@Column((type) => PostCounter, { prefix: "counters" })
@Column(() => PostCounter, { prefix: "counters" })
counters?: PostCounter
@BeforeInsert()

View File

@ -17,7 +17,7 @@ export class Post {
@OneToOne(() => Category)
category: Category
@ManyToMany((type) => Category)
@ManyToMany(() => Category)
category2: Category
@RelationCount((post: Post) => post.category)

View File

@ -19,7 +19,7 @@ export class Post {
@JoinColumn()
category: Category
@ManyToMany((type) => Category)
@ManyToMany(() => Category)
@JoinTable()
categories: Category[] = []
}

View File

@ -13,7 +13,7 @@ export class Question {
@Column()
title: string
@ManyToMany((type) => Category, { persistence: false })
@ManyToMany(() => Category, { persistence: false })
@JoinTable()
categories: Category[] = []
}

View File

@ -20,7 +20,7 @@ export class Counters {
@Column(() => Subcounters, { prefix: "sub" })
subcounters: Subcounters
@ManyToMany((type) => User, (user) => user.likedPosts)
@ManyToMany(() => User, (user) => user.likedPosts)
@JoinTable()
likedUsers: User[]
}

View File

@ -10,7 +10,7 @@ export class Subcounters {
@Column()
watches: number
@ManyToMany((type) => User)
@ManyToMany(() => User)
@JoinTable({ name: "post_cnt_subcnt_wtch_users" })
watchedUsers: User[]
}

View File

@ -12,6 +12,6 @@ export class User {
@Column()
name: string
@ManyToMany((type) => Post, (post) => post.counters.likedUsers)
@ManyToMany(() => Post, (post) => post.counters.likedUsers)
likedPosts: Post[]
}

View File

@ -27,7 +27,7 @@ export class Post extends BaseEntity {
})
text: string
@ManyToMany((type) => Category)
@ManyToMany(() => Category)
@JoinTable()
categories: Category[]
}

View File

@ -18,7 +18,7 @@ export class Post extends BaseEntity {
})
text: string
@ManyToMany((type) => Category)
@ManyToMany(() => Category)
@JoinTable()
categories: Category[]
}

View File

@ -1,7 +1,6 @@
import { MigrationInterface } from "../../../../../src/migration/MigrationInterface"
import { QueryRunner } from "../../../../../src/query-runner/QueryRunner"
export class ExampleMigration1530542855524 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {}
public async down(queryRunner: QueryRunner): Promise<void> {}
public async up() {}
public async down() {}
}

View File

@ -1,7 +1,6 @@
import { MigrationInterface } from "../../../../../src/migration/MigrationInterface"
import { QueryRunner } from "../../../../../src/query-runner/QueryRunner"
export class ExampleMigrationTwo1530542855524 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {}
public async down(queryRunner: QueryRunner): Promise<void> {}
public async up() {}
public async down() {}
}

View File

@ -12,7 +12,7 @@ export class Post {
@Column()
title: string
@Column((type) => Counters)
@Column(() => Counters)
counters: Counters[]
@Column()
@ -24,9 +24,9 @@ export class Post {
@Column()
booleans: boolean[]
@Column((type) => Counters, { array: true })
@Column(() => Counters, { array: true })
other1: Counters[]
@Column((type) => Counters, { array: true })
@Column(() => Counters, { array: true })
other2: Counters[]
}

View File

@ -6,7 +6,7 @@ export class Counters {
@Column()
likes: number
@Column((type) => Information)
@Column(() => Information)
information?: Information
@BeforeInsert()

View File

@ -16,9 +16,9 @@ export class Post {
@Column()
text: string
@Column((type) => Counters)
@Column(() => Counters)
counters?: Counters
@Column((type) => Tags)
@Column(() => Tags)
tags?: Tags[]
}

View File

@ -12,9 +12,9 @@ export class Counters {
@Column()
favorites: number
@Column((type) => Information)
@Column(() => Information)
information: Information
@Column((type) => ExtraInformation)
@Column(() => ExtraInformation)
extraInformation: ExtraInformation
}

View File

@ -2,6 +2,6 @@ import { Column } from "../../../../../../src/decorator/columns/Column"
import { EditHistory } from "./EditHistory"
export class ExtraInformation {
@Column((type) => EditHistory)
@Column(() => EditHistory)
lastEdit: EditHistory
}

View File

@ -15,6 +15,6 @@ export class Post {
@Column()
text: string
@Column((type) => Counters)
@Column(() => Counters)
counters: Counters
}

View File

@ -98,7 +98,7 @@ describe("multi-database > basic-functionality", () => {
it("should correctly attach and create database files", () =>
Promise.all(
connections.map(async (connection) => {
connections.map(async () => {
const expectedMainPath = path.join(
tempPath,
(connections[0].options.database as string).match(

View File

@ -15,7 +15,7 @@ export class Post {
@Column()
name: string
@ManyToMany((type) => Category)
@ManyToMany(() => Category)
@JoinTable({ database: "yoman" })
categories: Category[]
}

View File

@ -15,7 +15,7 @@ export class Post {
@Column()
name: string
@ManyToMany((type) => Category)
@ManyToMany(() => Category)
@JoinTable({ schema: "yoman" })
categories: Category[]
}

View File

@ -12,6 +12,6 @@ export class Category {
@Column()
name: string
@ManyToMany((type) => Post, (post) => post.categories)
@ManyToMany(() => Post, (post) => post.categories)
posts: Post[]
}

View File

@ -13,7 +13,7 @@ export class Post {
@Column()
title: string
@ManyToMany((type) => Category, (category) => category.posts, {
@ManyToMany(() => Category, (category) => category.posts, {
cascade: ["insert"],
})
@JoinTable()

View File

@ -19,7 +19,7 @@ export class User {
@OneToMany(() => Photo, (photo) => photo.user, { cascade: true })
manyPhotos: Photo[]
@ManyToMany((type) => Photo, { cascade: true })
@ManyToMany(() => Photo, { cascade: true })
@JoinTable()
manyToManyPhotos: Photo[]
}

View File

@ -23,7 +23,7 @@ export class User {
@OneToMany(() => Photo, (photo) => photo.user, { cascade: true })
manyPhotos: Photo[]
@ManyToMany((type) => Photo, { cascade: true })
@ManyToMany(() => Photo, { cascade: true })
@JoinTable()
manyToManyPhotos: Photo[]
}

View File

@ -11,6 +11,6 @@ export class PostComplex {
@Column({ default: "Hello Complexity" })
text: string
@Column((type) => PostEmbedded)
@Column(() => PostEmbedded)
embed: PostEmbedded
}

View File

@ -12,6 +12,6 @@ export class Category {
@Column()
name: string
@ManyToMany((type) => Post, (post) => post.categories)
@ManyToMany(() => Post, (post) => post.categories)
posts: Post[]
}

View File

@ -13,7 +13,7 @@ export class Post {
@Column()
title: string
@ManyToMany((type) => Category, (category) => category.posts)
@ManyToMany(() => Category, (category) => category.posts)
@JoinTable()
categories: Category[] | null
}

View File

@ -15,6 +15,6 @@ export class Category {
@Column()
position: number
@ManyToMany((type) => Post, (post) => post.categories)
@ManyToMany(() => Post, (post) => post.categories)
posts: Post[]
}

View File

@ -17,10 +17,10 @@ export class Post {
@Column()
description: string
@Column((type) => Counters)
@Column(() => Counters)
counters: Counters
@ManyToMany((type) => Category, (category) => category.posts, {
@ManyToMany(() => Category, (category) => category.posts, {
cascade: ["update"],
})
@JoinTable()

View File

@ -11,6 +11,6 @@ export class Photo {
@Column()
url: string
@Column((type) => Counters)
@Column(() => Counters)
counters: Counters
}

View File

@ -11,6 +11,6 @@ export class Photo {
@Column()
url: string
@Column((type) => Counters)
@Column(() => Counters)
counters: Counters
}

View File

@ -17,10 +17,10 @@ export class Category {
@Column()
isRemoved: boolean = false
@ManyToMany((type) => Post, (post) => post.categories)
@ManyToMany(() => Post, (post) => post.categories)
posts: Post[]
@ManyToMany((type) => Image)
@ManyToMany(() => Image)
@JoinTable()
images: Image[]

View File

@ -26,7 +26,7 @@ export class Post {
@JoinColumn()
author: User
@ManyToMany((type) => Category, (category) => category.posts)
@ManyToMany(() => Category, (category) => category.posts)
@JoinTable()
categories: Category[]

View File

@ -17,10 +17,10 @@ export class Category {
@Column()
isRemoved: boolean = false
@ManyToMany((type) => Post, (post) => post.categories)
@ManyToMany(() => Post, (post) => post.categories)
posts: Post[]
@ManyToMany((type) => Image)
@ManyToMany(() => Image)
@JoinTable()
images: Image[]

View File

@ -26,7 +26,7 @@ export class Post {
@JoinColumn()
author: User
@ManyToMany((type) => Category, (category) => category.posts)
@ManyToMany(() => Category, (category) => category.posts)
@JoinTable()
categories: Category[]

View File

@ -17,10 +17,10 @@ export class Category {
@Column()
isRemoved: boolean = false
@ManyToMany((type) => Post, (post) => post.categories)
@ManyToMany(() => Post, (post) => post.categories)
posts: Post[]
@ManyToMany((type) => Image, (image) => image.categories)
@ManyToMany(() => Image, (image) => image.categories)
@JoinTable()
images: Image[]

View File

@ -15,7 +15,7 @@ export class Image {
@Column()
isRemoved: boolean = false
@ManyToMany((type) => Category, (category) => category.images)
@ManyToMany(() => Category, (category) => category.images)
categories: Category[]
categoryCount: number

View File

@ -16,7 +16,7 @@ export class Post {
@Column()
isRemoved: boolean = false
@ManyToMany((type) => Category, (category) => category.posts)
@ManyToMany(() => Category, (category) => category.posts)
@JoinTable()
categories: Category[]

View File

@ -14,10 +14,10 @@ export class Category {
@Column()
name: string
@ManyToMany((type) => Post, (post) => post.categories)
@ManyToMany(() => Post, (post) => post.categories)
posts: Post[]
@ManyToMany((type) => Image)
@ManyToMany(() => Image)
@JoinTable()
images: Image[]

View File

@ -20,11 +20,11 @@ export class Post {
tagId: number
@ManyToMany((type) => Category, (category) => category.posts)
@ManyToMany(() => Category, (category) => category.posts)
@JoinTable()
categories: Category[]
@ManyToMany((type) => Category)
@ManyToMany(() => Category)
@JoinTable()
subcategories: Category[]

View File

@ -11,7 +11,7 @@ export class Category {
@PrimaryColumn()
name: string
@ManyToMany((type) => Post, (post) => post.counters.categories)
@ManyToMany(() => Post, (post) => post.counters.categories)
posts: Post[]
postIds: number[]

View File

@ -18,7 +18,7 @@ export class Counters {
@Column()
favorites: number
@ManyToMany((type) => Category, (category) => category.posts)
@ManyToMany(() => Category, (category) => category.posts)
@JoinTable({ name: "counter_categories" })
categories: Category[]

View File

@ -11,7 +11,7 @@ export class Subcounters {
@Column()
watches: number
@ManyToMany((type) => User, (user) => user.posts)
@ManyToMany(() => User, (user) => user.posts)
@JoinTable({ name: "subcnt_users" })
watchedUsers: User[]

View File

@ -11,7 +11,7 @@ export class User {
@PrimaryColumn()
name: string
@ManyToMany((type) => Post, (post) => post.counters.subcntrs.watchedUsers)
@ManyToMany(() => Post, (post) => post.counters.subcntrs.watchedUsers)
posts: Post[]
postIds: number[]

View File

@ -12,7 +12,7 @@ export class Category {
@Column()
name: string
@ManyToMany((type) => Post, (post) => post.counters.categories)
@ManyToMany(() => Post, (post) => post.counters.categories)
posts: Post[]
postIds: number[]

View File

@ -14,7 +14,7 @@ export class Counters {
@Column()
favorites: number
@ManyToMany((type) => Category, (category) => category.posts)
@ManyToMany(() => Category, (category) => category.posts)
@JoinTable({ name: "counter_categories" })
categories: Category[]

View File

@ -14,7 +14,7 @@ export class Subcounters {
@Column()
watches: number
@ManyToMany((type) => User)
@ManyToMany(() => User)
@JoinTable({ name: "subcnt_users" })
watchedUsers: User[]

View File

@ -20,10 +20,10 @@ export class Category {
@Column()
isRemoved: boolean = false
@ManyToMany((type) => Post, (post) => post.categories)
@ManyToMany(() => Post, (post) => post.categories)
posts: Post[]
@ManyToMany((type) => Image, (image) => image.categories)
@ManyToMany(() => Image, (image) => image.categories)
@JoinTable()
images: Image[]

View File

@ -12,7 +12,7 @@ export class Image {
@Column()
name: string
@ManyToMany((type) => Category, (category) => category.images)
@ManyToMany(() => Category, (category) => category.images)
categories: Category[]
categoryIds: number[]

View File

@ -19,11 +19,11 @@ export class Post {
@Column()
isRemoved: boolean = false
@ManyToMany((type) => Category, (category) => category.posts)
@ManyToMany(() => Category, (category) => category.posts)
@JoinTable()
categories: Category[]
@ManyToMany((type) => Category)
@ManyToMany(() => Category)
@JoinTable()
subcategories: Category[]

View File

@ -12,6 +12,6 @@ export class Image {
@Column()
url: string
@ManyToMany((type) => Post, (post) => post.images)
@ManyToMany(() => Post, (post) => post.images)
posts: Post[]
}

View File

@ -18,7 +18,7 @@ export class Post {
@ManyToOne(() => Category, (category) => category.posts)
category: Category
@ManyToMany((type) => Image, (image) => image.posts)
@ManyToMany(() => Image, (image) => image.posts)
@JoinTable()
images: Image[]
}

View File

@ -12,7 +12,7 @@ export class Photo {
@Column()
url: string
@Column((type) => Counters)
@Column(() => Counters)
counters: Counters
@DeleteDateColumn()

View File

@ -13,7 +13,7 @@ export class Post {
@Column()
title: string
@ManyToMany((type) => Category)
@ManyToMany(() => Category)
@JoinTable()
categories: Category[]
}

View File

@ -11,6 +11,6 @@ export class Photo {
@Column()
url: string
@Column((type) => Counters)
@Column(() => Counters)
counters: Counters
}

View File

@ -13,7 +13,7 @@ export class Category {
@Column()
name: string
@ManyToMany((type) => Post, (post) => post.categories2)
@ManyToMany(() => Post, (post) => post.categories2)
@JoinTable()
posts2: Post[]
}

View File

@ -17,11 +17,11 @@ export class Post {
@Column()
title: string
@ManyToMany((type) => Category, { eager: true })
@ManyToMany(() => Category, { eager: true })
@JoinTable()
categories1: Category[]
@ManyToMany((type) => Category, (category) => category.posts2, {
@ManyToMany(() => Category, (category) => category.posts2, {
eager: true,
})
categories2: Category[]

View File

@ -13,7 +13,7 @@ export class Category {
@Column()
name: string
@ManyToMany((type) => Post, (post) => post.categories2)
@ManyToMany(() => Post, (post) => post.categories2)
@JoinTable()
posts2: Post[]
}

View File

@ -17,11 +17,11 @@ export class Post {
@Column()
title: string
@ManyToMany((type) => Category, { eager: true })
@ManyToMany(() => Category, { eager: true })
@JoinTable()
categories1: Category[]
@ManyToMany((type) => Category, (category) => category.posts2, {
@ManyToMany(() => Category, (category) => category.posts2, {
eager: true,
})
categories2: Category[]

View File

@ -17,7 +17,7 @@ export class Category {
@OneToOne(() => Post, (post) => post.oneCategory)
onePost: Promise<Post>
@ManyToMany((type) => Post, (post) => post.twoSideCategories)
@ManyToMany(() => Post, (post) => post.twoSideCategories)
twoSidePosts: Promise<Post[]>
@OneToMany(() => Post, (post) => post.twoSideCategory)

View File

@ -19,11 +19,11 @@ export class Post {
@Column()
text: string
@ManyToMany((type) => Category)
@ManyToMany(() => Category)
@JoinTable()
categories: Promise<Category[]>
@ManyToMany((type) => Category, (category) => category.twoSidePosts)
@ManyToMany(() => Category, (category) => category.twoSidePosts)
@JoinTable()
twoSideCategories: Promise<Category[]>

View File

@ -19,14 +19,14 @@ export class Category {
@OneToOne(() => Post, (post) => post.oneCategory)
onePost: Promise<Post>
@ManyToMany((type) => Post, (post) => post.twoSideCategories)
@ManyToMany(() => Post, (post) => post.twoSideCategories)
twoSidePosts: Promise<Post[]>
@OneToMany(() => Post, (post) => post.twoSideCategory)
twoSidePosts2: Promise<Post[]>
// ManyToMany with named properties
@ManyToMany((type) => Post, (post) => post.categoriesNamedColumn)
@ManyToMany(() => Post, (post) => post.categoriesNamedColumn)
postsNamedColumn: Promise<Post[]>
// OneToMany with named properties

View File

@ -21,11 +21,11 @@ export class Post {
@Column()
text: string
@ManyToMany((type) => Category)
@ManyToMany(() => Category)
@JoinTable()
categories: Promise<Category[]>
@ManyToMany((type) => Category, (category) => category.twoSidePosts)
@ManyToMany(() => Category, (category) => category.twoSidePosts)
@JoinTable()
twoSideCategories: Promise<Category[]>
@ -43,7 +43,7 @@ export class Post {
twoSideCategory: Promise<Category>
// ManyToMany with named properties
@ManyToMany((type) => Category, (category) => category.postsNamedColumn)
@ManyToMany(() => Category, (category) => category.postsNamedColumn)
@JoinTable()
categoriesNamedColumn: Promise<Category[]>

View File

@ -23,14 +23,14 @@ export class Category {
@OneToOne(() => Post, (post) => post.oneCategory)
onePost: Promise<Post>
@ManyToMany((type) => Post, (post) => post.twoSideCategories)
@ManyToMany(() => Post, (post) => post.twoSideCategories)
twoSidePosts: Promise<Post[]>
@OneToMany(() => Post, (post) => post.twoSideCategory)
twoSidePosts2: Promise<Post[]>
// ManyToMany with named properties
@ManyToMany((type) => Post, (post) => post.categoriesNamedAll)
@ManyToMany(() => Post, (post) => post.categoriesNamedAll)
postsNamedAll: Promise<Post[]>
// OneToMany with named properties

View File

@ -26,11 +26,11 @@ export class Post {
@Column()
text: string
@ManyToMany((type) => Category)
@ManyToMany(() => Category)
@JoinTable()
categories: Promise<Category[]>
@ManyToMany((type) => Category, (category) => category.twoSidePosts)
@ManyToMany(() => Category, (category) => category.twoSidePosts)
@JoinTable()
twoSideCategories: Promise<Category[]>
@ -48,7 +48,7 @@ export class Post {
twoSideCategory: Promise<Category>
// ManyToMany with named properties
@ManyToMany((type) => Category, (category) => category.postsNamedAll)
@ManyToMany(() => Category, (category) => category.postsNamedAll)
@JoinTable()
categoriesNamedAll: Promise<Category[]>

View File

@ -21,14 +21,14 @@ export class Category {
@OneToOne(() => Post, (post) => post.oneCategory)
onePost: Promise<Post>
@ManyToMany((type) => Post, (post) => post.twoSideCategories)
@ManyToMany(() => Post, (post) => post.twoSideCategories)
twoSidePosts: Promise<Post[]>
@OneToMany(() => Post, (post) => post.twoSideCategory)
twoSidePosts2: Promise<Post[]>
// ManyToMany with named properties
@ManyToMany((type) => Post, (post) => post.categoriesNamedTable)
@ManyToMany(() => Post, (post) => post.categoriesNamedTable)
postsNamedTable: Promise<Post[]>
// OneToMany with named properties

View File

@ -24,11 +24,11 @@ export class Post {
@Column()
text: string
@ManyToMany((type) => Category)
@ManyToMany(() => Category)
@JoinTable()
categories: Promise<Category[]>
@ManyToMany((type) => Category, (category) => category.twoSidePosts)
@ManyToMany(() => Category, (category) => category.twoSidePosts)
@JoinTable()
twoSideCategories: Promise<Category[]>
@ -46,7 +46,7 @@ export class Post {
twoSideCategory: Promise<Category>
// ManyToMany with named properties
@ManyToMany((type) => Category, (category) => category.postsNamedTable)
@ManyToMany(() => Category, (category) => category.postsNamedTable)
@JoinTable()
categoriesNamedTable: Promise<Category[]>

View File

@ -28,21 +28,21 @@ export class Category {
@Column({ nullable: true })
description: string
@ManyToMany((type) => Post, (post) => post.categories)
@ManyToMany(() => Post, (post) => post.categories)
posts: Post[]
@ManyToMany((type) => Post, (post) => post.categoriesWithOptions)
@ManyToMany(() => Post, (post) => post.categoriesWithOptions)
postsWithOptions: Post[]
@ManyToMany((type) => Post, (post) => post.categoriesWithNonPKColumns)
@ManyToMany(() => Post, (post) => post.categoriesWithNonPKColumns)
postsWithNonPKColumns: Post[]
@ManyToMany((type) => Tag, (tag) => tag.categories)
@ManyToMany(() => Tag, (tag) => tag.categories)
tags: Tag[]
@ManyToMany((type) => Tag, (tag) => tag.categoriesWithOptions)
@ManyToMany(() => Tag, (tag) => tag.categoriesWithOptions)
tagsWithOptions: Tag[]
@ManyToMany((type) => Tag, (tag) => tag.categoriesWithNonPKColumns)
@ManyToMany(() => Tag, (tag) => tag.categoriesWithNonPKColumns)
tagsWithNonPKColumns: Tag[]
}

View File

@ -13,11 +13,11 @@ export class Post {
@Column()
title: string
@ManyToMany((type) => Category, (category) => category.posts)
@ManyToMany(() => Category, (category) => category.posts)
@JoinTable()
categories: Category[]
@ManyToMany((type) => Category, (category) => category.postsWithOptions)
@ManyToMany(() => Category, (category) => category.postsWithOptions)
@JoinTable({
name: "post_categories",
joinColumns: [
@ -39,10 +39,7 @@ export class Post {
})
categoriesWithOptions: Category[]
@ManyToMany(
(type) => Category,
(category) => category.postsWithNonPKColumns,
)
@ManyToMany(() => Category, (category) => category.postsWithNonPKColumns)
@JoinTable({
name: "post_categories_non_primary",
joinColumns: [

View File

@ -20,11 +20,11 @@ export class Tag {
})
description: string
@ManyToMany((type) => Category, (category) => category.tags)
@ManyToMany(() => Category, (category) => category.tags)
@JoinTable()
categories: Category[]
@ManyToMany((type) => Category, (category) => category.tagsWithOptions)
@ManyToMany(() => Category, (category) => category.tagsWithOptions)
@JoinTable({
name: "tag_categories",
joinColumns: [
@ -50,7 +50,7 @@ export class Tag {
})
categoriesWithOptions: Category[]
@ManyToMany((type) => Category, (category) => category.tagsWithNonPKColumns)
@ManyToMany(() => Category, (category) => category.tagsWithNonPKColumns)
@JoinTable({
name: "tag_categories_non_primary",
joinColumns: [

View File

@ -16,7 +16,7 @@ export class Blog {
@Column()
text: string
@ManyToMany((type) => Category)
@ManyToMany(() => Category)
@JoinTable()
categories: Category[]

View File

@ -562,7 +562,7 @@ describe("repository > basic methods", () => {
await externalIdObjects.findBy({
externalId: Like("external-bulk-%"),
})
).forEach((inserted, i) => {
).forEach((inserted) => {
inserted.title.should.be.equal("Initially inserted")
})
@ -581,7 +581,7 @@ describe("repository > basic methods", () => {
await externalIdObjects.findBy({
externalId: Like("external-bulk-%"),
})
).forEach((updated, i) => {
).forEach((updated) => {
updated.title.should.be.equal("Updated")
})
}),

View File

@ -16,6 +16,6 @@ export class UserWithEmbededEntity {
@PrimaryColumn()
id: number
@Column((type) => FriendStats)
@Column(() => FriendStats)
friend: FriendStats
}

Some files were not shown because too many files have changed in this diff Show More