Skip to content

cozy-harvest-lib lint does not handle ts files #2306

@paultranvan

Description

@paultranvan

When running yarn lint in cozy-harvest-lib dir, it does not include ts files: "lint": "cd .. && yarn eslint --ext js,jsx packages/cozy-harvest-lib".
And, when trying to add ts support, it fails with Error: Error while loading rule '@typescript-eslint/dot-notation': You have used a rule which requires parserServices to be generated. You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser. .

This finally works when changing the .eslintrc file at the cozy-libs root:

{
   "root": true,                                                                                                                         
   "extends": "cozy-app/react",                                                                                                          
   "globals": {                                                                                                                          
     __DEV__: "readonly"                                                                                                                 
   },                                                                                                                                    
   "parserOptions": {                                                                                                                    
     "project": "tsconfig.json"                                                                                                          
   }
 }

But there might be a better way?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions