Skip to content

Error while compiling with version 2.6.4 #28

@emilianomaccaferri

Description

@emilianomaccaferri

Hello there,
I just installed the new version and I'm trying to validate this simple schema:

import { enumOf, objectOf, } from "@altostra/type-validations"
import { string } from "@altostra/type-validations/lib/primitives"

type Methods = 'get' | 'post';

export interface HookConfiguration {
    name: string,
    route: string, 
    method: Methods
}

export const validConf = objectOf({
    name: string,
    route: string,
    method: enumOf<Methods>('get', 'post')
})

When I compile the project, the transpiler emits this error:

node_modules/@altostra/type-validations/lib/index.d.ts:2:15 - error TS1005: ',' expected.

2 export { type RejectionsCollector, type ArrayRejectionReasons, type ValidationRejection, CUSTOM_TYPE, createRejectionsCollector, arrayRejectionReasons, asPredicate, mapRejection, setValidatorRejection, typeValidatorType, } from './RejectionReasons';
                ~~~~~~~~~~~~~~~~~~~

node_modules/@altostra/type-validations/lib/index.d.ts:2:41 - error TS1005: ',' expected.

2 export { type RejectionsCollector, type ArrayRejectionReasons, type ValidationRejection, CUSTOM_TYPE, createRejectionsCollector, arrayRejectionReasons, asPredicate, mapRejection, setValidatorRejection, typeValidatorType, } from './RejectionReasons';
                                          ~~~~~~~~~~~~~~~~~~~~~

node_modules/@altostra/type-validations/lib/index.d.ts:2:69 - error TS1005: ',' expected.

2 export { type RejectionsCollector, type ArrayRejectionReasons, type ValidationRejection, CUSTOM_TYPE, createRejectionsCollector, arrayRejectionReasons, asPredicate, mapRejection, setValidatorRejection, typeValidatorType, } from './RejectionReasons';
                                                                      ~~~~~~~~~~~~~~~~~~~

This is my tsconfig.json:

{
  "compilerOptions": {
    "target": "es2020",                                     
    "module": "commonjs",                                
    "rootDir": "./src",                                  
    "outDir": "./build",                                   
    "esModuleInterop": true,                             
    "forceConsistentCasingInFileNames": true,            
    "strict": true,                                      
    "noImplicitAny": true,                            
    "strictNullChecks": true,                         
    "strictFunctionTypes": true,                      
    "strictBindCallApply": true,                      
    "alwaysStrict": true,                             
    "skipLibCheck": true                                 
  }
}


It seems that downgrading to 2.6.1-1 fixes the issue.

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