sindresorhus / ow

Function argument validation for humans
https://sindresorhus.com/ow/
MIT License
3.81k stars 108 forks source link

Type definition error, expression is not callable. #191

Closed khkiley closed 3 years ago

khkiley commented 3 years ago

This is probably a noob issue.

I'm using VSCode, new install of ow.

This script results in the red squiggly line showing up under 'ow' in "ow(5,"

    // @ts-check

    'use strict';
    const ow = require('ow');

    ow(5, ow.number.integer);

Hovering over the red squiggle, the error reported is:

This expression is not callable. Type 'typeof import("c:/The Path to the installed modules/node_modules/ow/dist/source/index")' has no call signatures.

I'm getting other type errors referring ow, but I think this may be the root cause.

What might I be doing wrong ?

Thanks in advance.

Kurt

Eta:Fixed Syntax error in sample.

sindresorhus commented 3 years ago

See: https://github.com/sindresorhus/ow/releases/tag/v0.20.0