10

While every topic I can find wants to fix or disable the TS2339 error, I'm trying to get the eslint rules in-sync with typescript rules and I would like to enable it.

In looking at the typescript-eslint project, I cannot seem to find how to enable the TS2339 rule or find the associated name.

You can see the setup what I'm trying to do: Typescript PlayGround

type Person = {
    name: string;
}

const me: Person = {
    name: 'Kenny'
}

// this should error both in the IDE (which it does) and with eslint command line with the @typescript-eslint configuration (which it does NOT)
me.age = 3

In following the setup and configuration found here: Rule Setup

 module.exports = {
   root: true,
   parser: '@typescript-eslint/parser',
   parserOptions: {
     project: ['./tsconfig.json'],
   },
   plugins: ['@typescript-eslint'],
   extends: [
     'eslint:recommended',
     'plugin:@typescript-eslint/recommended',
     'plugin:@typescript-eslint/recommended-requiring-type-checking',
   ],
 };
anAgent
  • 2,550
  • 24
  • 34

0 Answers0