Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

125
Views
Getter is not present for class setter ***

I developed sample Dto as follows. But it generated some errors.

import { Shop } from "@post-pricing/library/lib/src/orm/typeorm/entity";
import { parse } from "@post-pricing/library/lib/src/utility/date"

export class ShopTransactionsDto {
    private event;
    private shopInfo:Shop;
    private transaction;

    constructor(){
        this.event = null;
        this.shopInfo = null;
        this.transaction = null;
    }

    set setEvent(event) {
        this.event = event
    }

    get getEvent() {
        return this.event
    }

    set setShopInfo(shopInfo:Shop){
        this.shopInfo = shopInfo
    }

    get getShopInfo() {
        return this.shopInfo
    }

    set setTransaction(transaction) {
        this.transaction = transaction
    }

}

One of errors is follows. I set getter in my class. what it the root cause of this?

  15:5  error  Getter is not present for class setter 'setEvent'        accessor-pairs
  23:5  error  Getter is not present for class setter 'setShopInfo'     accessor-pairs
  31:5  error  Getter is not present for class setter 'setTransaction'

If someone has opinion,please let me know. Thanks

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

accessor-pairs linter you use requires a getter and a setter to have the same name, eg:

    set event(event) {
        this._event = event // note the field was renamed
    }

    get event() {
        return this._event
    }

References:

  • https://eslint.org/docs/latest/rules/accessor-pairs#enforceforclassmembers
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!