ng-packagr: Typescript warning but build error

Type of Issue

Build error

[x ] Bug Report
[ ] Feature Request

Description

A typescript warning is turned in build error.

How To Reproduce

Add comment as :

/**

  • Returns the value at this numeric index.
  • @param {string} row array of values
  • @param index numeric index
  • @returns or ‘’ if invalid index */

Version Information

ng-packagr: 2.0.0.rc-6

warning TS0: the type annotation on @param is redundant with its TypeScript type, remove the {…} part the type annotation on @param is redundant with its TypeScript type, remove the {…} part

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 7
  • Comments: 16 (1 by maintainers)

Most upvoted comments

We have a pretty big lib and we cannot take the time to do it everywhere… is it possible to get an other solution to get ng-packgr >=2.0.0 to work with {type} ?

My solution, in angular 7, was change my tsconfig.lib.json config,

from this:

"angularCompilerOptions": {
    "annotateForClosureCompiler": true
    ...
    ...
}

to this:

"angularCompilerOptions": {
    "annotateForClosureCompiler": false
    ...
    ...
}

it’s closed so the owner doesn’t get alerted by this ?

It seem’s that he doesn’t really want to get around this problem, so we are waiting on Angular6 - Bazel packager.

We really liked to work with ng-packagr but there is no way that we will remove all the comments in our code. If the owner could help us to get around the problem, we could help the community because we think that many persons use “Document This” pluggin for VsCode.

@Ks89 @guillermotti Just change the line in your code

* @param {string} paramname doc here

to be

* @param  paramname doc here

You don’t need to specify {string} in Typescript JsDoc.

This is tsickle

An irritating error. Same happens with @private which we were using to prevent typedoc from exposing internals.