Charisman Apriandi
Charisman Apriandi

Reputation: 65

disable specifict eslint rule reactjs

How can I disable the no-unused-vars rule only for the typescript interface?

export type IKeoTableColumn<T> = {
  id: T;
  align: 'left' | 'center' | 'right';
  label: string;
  minWidth: number;
  format?: (value: number) => string, <-------- warning here (value: number)
}[];

my eslintrc.json like

--- some code ---
"rules": {
    "no-unused-vars": "warn",
    "@typescript-eslint/no-unused-vars": "off",
}

please help :(

Upvotes: 1

Views: 45

Answers (1)

lbsn
lbsn

Reputation: 2412

The configuration in your .eslintrc is wrong. You should turn off the base rule and only use the typescript extension like this:

"rules": {
    "no-unused-vars": "off",
    "@typescript-eslint/no-unused-vars": "warn",
}

Upvotes: 1

Related Questions