Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warning TS0: @interface annotations are redundant with TypeScript equivalents #11282

Closed
DDzia opened this issue Jun 17, 2018 · 7 comments · Fixed by #11286
Closed

warning TS0: @interface annotations are redundant with TypeScript equivalents #11282

DDzia opened this issue Jun 17, 2018 · 7 comments · Fixed by #11286

Comments

@DDzia
Copy link

DDzia commented Jun 17, 2018

Bug Report or Feature Request (mark with an x)

- [x] bug report

Versions

NPM 5.6.0
NodeJS v10.1.0

Repro steps

  • ng generate library dd-ng-primitives --prefix=dd
  • add interfaces with JSDoc. Sample:
/**
 * Container size.
 * @export
 * @interface Size
 */
export interface Size {
  /**
   * Container width into pixels.
   * @type {number}
   * @memberof Size
   */
  width: number;

  /**
   * Container height into pixels.
   * @type {number}
   * @memberof Size
   */
  height: number;
}

-- ng build --prod dd-ng-virtualized

The log given by the failure

BUILD ERROR
projects/dd-ng-primitives/src/lib/resize-notifier/size.ts(1,1): warning TS0: @interface annotations are redundant with TypeScript equivalents
projects/dd-ng-primitives/src/lib/resize-notifier/size.ts(7,3): warning TS0: @type annotations are redundant with TypeScript equivalents
projects/dd-ng-primitives/src/lib/resize-notifier/size.ts(14,3): warning TS0: @type annotations are redundant with TypeScript equivalents
projects/dd-ng-primitives/src/lib/resize-notifier/resize-notifier.component.ts(7,1): warning TS0: @Class annotations are redundant with TypeScript equivalents
@implements annotations are redundant with TypeScript equivalents
@implements annotations are redundant with TypeScript equivalents
projects/dd-ng-primitives/src/lib/resize-notifier/resize-notifier.component.ts(22,3): warning TS0: @type annotations are redundant with TypeScript equivalents
projects/dd-ng-primitives/src/lib/resize-notifier/resize-notifier.component.ts(44,3): warning TS0: @type annotations are redundant with TypeScript equivalents
projects/dd-ng-primitives/src/lib/resize-notifier/resize-notifier.component.ts(22,3): warning TS0: @type annotations are redundant with TypeScript equivalents
projects/dd-ng-primitives/src/lib/resize-notifier/resize-notifier.component.ts(44,3): warning TS0: @type annotations are redundant with TypeScript equivalents
projects/dd-ng-primitives/src/lib/dd-ng-primitives.module.ts(6,1): warning TS0: @Class annotations are redundant with TypeScript equivalents

Error: projects/dd-ng-primitives/src/lib/resize-notifier/size.ts(1,1): warning TS0: @interface annotations are redundant with TypeScript equivalents
projects/dd-ng-primitives/src/lib/resize-notifier/size.ts(7,3): warning TS0: @type annotations are redundant with TypeScript equivalents
projects/dd-ng-primitives/src/lib/resize-notifier/size.ts(14,3): warning TS0: @type annotations are redundant with TypeScript equivalents
projects/dd-ng-primitives/src/lib/resize-notifier/resize-notifier.component.ts(7,1): warning TS0: @Class annotations are redundant with TypeScript equivalents
@implements annotations are redundant with TypeScript equivalents
@implements annotations are redundant with TypeScript equivalents
projects/dd-ng-primitives/src/lib/resize-notifier/resize-notifier.component.ts(22,3): warning TS0: @type annotations are redundant with TypeScript equivalents
projects/dd-ng-primitives/src/lib/resize-notifier/resize-notifier.component.ts(44,3): warning TS0: @type annotations are redundant with TypeScript equivalents
projects/dd-ng-primitives/src/lib/resize-notifier/resize-notifier.component.ts(22,3): warning TS0: @type annotations are redundant with TypeScript equivalents
projects/dd-ng-primitives/src/lib/resize-notifier/resize-notifier.component.ts(44,3): warning TS0: @type annotations are redundant with TypeScript equivalents
projects/dd-ng-primitives/src/lib/dd-ng-primitives.module.ts(6,1): warning TS0: @Class annotations are redundant with TypeScript equivalents

at Object.<anonymous> (C:\PROJECTS\dd-ng-primitives\node_modules\ng-packagr\lib\ngc\compile-source-files.js:53:68)
at Generator.next (<anonymous>)
at C:\PROJECTS\dd-ng-primitives\node_modules\ng-packagr\lib\ngc\compile-source-files.js:7:71
at new Promise (<anonymous>)
at __awaiter (C:\PROJECTS\dd-ng-primitives\node_modules\ng-packagr\lib\ngc\compile-source-files.js:3:12)
at Object.compileSourceFiles (C:\PROJECTS\dd-ng-primitives\node_modules\ng-packagr\lib\ngc\compile-source-files.js:19:12)
at Object.<anonymous> (C:\PROJECTS\dd-ng-primitives\node_modules\ng-packagr\lib\ng-v5\entry-point\ts\compile-ngc.transform.js:31:32)
at Generator.next (<anonymous>)
at C:\PROJECTS\dd-ng-primitives\node_modules\ng-packagr\lib\ng-v5\entry-point\ts\compile-ngc.transform.js:7:71
at new Promise (<anonymous>)

projects/dd-ng-primitives/src/lib/resize-notifier/size.ts(1,1): warning TS0: @interface annotations are redundant with TypeScript equivalents
projects/dd-ng-primitives/src/lib/resize-notifier/size.ts(7,3): warning TS0: @type annotations are redundant with TypeScript equivalents
projects/dd-ng-primitives/src/lib/resize-notifier/size.ts(14,3): warning TS0: @type annotations are redundant with TypeScript equivalents
projects/dd-ng-primitives/src/lib/resize-notifier/resize-notifier.component.ts(7,1): warning TS0: @Class annotations are redundant with TypeScript equivalents
@implements annotations are redundant with TypeScript equivalents
@implements annotations are redundant with TypeScript equivalents
projects/dd-ng-primitives/src/lib/resize-notifier/resize-notifier.component.ts(22,3): warning TS0: @type annotations are redundant with TypeScript equivalents
projects/dd-ng-primitives/src/lib/resize-notifier/resize-notifier.component.ts(44,3): warning TS0: @type annotations are redundant with TypeScript equivalents
projects/dd-ng-primitives/src/lib/resize-notifier/resize-notifier.component.ts(22,3): warning TS0: @type annotations are redundant with TypeScript equivalents
projects/dd-ng-primitives/src/lib/resize-notifier/resize-notifier.component.ts(44,3): warning TS0: @type annotations are redundant with TypeScript equivalents
projects/dd-ng-primitives/src/lib/dd-ng-primitives.module.ts(6,1): warning TS0: @Class annotations are redundant with TypeScript equivalents

Error: projects/dd-ng-primitives/src/lib/resize-notifier/size.ts(1,1): warning TS0: @interface annotations are redundant with TypeScript equivalents
projects/dd-ng-primitives/src/lib/resize-notifier/size.ts(7,3): warning TS0: @type annotations are redundant with TypeScript equivalents
projects/dd-ng-primitives/src/lib/resize-notifier/size.ts(14,3): warning TS0: @type annotations are redundant with TypeScript equivalents
projects/dd-ng-primitives/src/lib/resize-notifier/resize-notifier.component.ts(7,1): warning TS0: @Class annotations are redundant with TypeScript equivalents
@implements annotations are redundant with TypeScript equivalents
@implements annotations are redundant with TypeScript equivalents
projects/dd-ng-primitives/src/lib/resize-notifier/resize-notifier.component.ts(22,3): warning TS0: @type annotations are redundant with TypeScript equivalents
projects/dd-ng-primitives/src/lib/resize-notifier/resize-notifier.component.ts(44,3): warning TS0: @type annotations are redundant with TypeScript equivalents
projects/dd-ng-primitives/src/lib/resize-notifier/resize-notifier.component.ts(22,3): warning TS0: @type annotations are redundant with TypeScript equivalents
projects/dd-ng-primitives/src/lib/resize-notifier/resize-notifier.component.ts(44,3): warning TS0: @type annotations are redundant with TypeScript equivalents
projects/dd-ng-primitives/src/lib/dd-ng-primitives.module.ts(6,1): warning TS0: @Class annotations are redundant with TypeScript equivalents

at Object.<anonymous> (C:\PROJECTS\dd-ng-primitives\node_modules\ng-packagr\lib\ngc\compile-source-files.js:53:68)
at Generator.next (<anonymous>)
at C:\PROJECTS\dd-ng-primitives\node_modules\ng-packagr\lib\ngc\compile-source-files.js:7:71
at new Promise (<anonymous>)
at __awaiter (C:\PROJECTS\dd-ng-primitives\node_modules\ng-packagr\lib\ngc\compile-source-files.js:3:12)
at Object.compileSourceFiles (C:\PROJECTS\dd-ng-primitives\node_modules\ng-packagr\lib\ngc\compile-source-files.js:19:12)
at Object.<anonymous> (C:\PROJECTS\dd-ng-primitives\node_modules\ng-packagr\lib\ng-v5\entry-point\ts\compile-ngc.transform.js:31:32)
at Generator.next (<anonymous>)
at C:\PROJECTS\dd-ng-primitives\node_modules\ng-packagr\lib\ng-v5\entry-point\ts\compile-ngc.transform.js:7:71
at new Promise (<anonymous>)

Desired functionality

Library builded without errors.

Mention any other details that might be useful

repo: https://github.com/derkachdeveloper/dd-ng-primitives

@alan-agius4
Copy link
Collaborator

Hi, those JSDocs are redundant and should be removed in order to get your library working.

Redundant JSDocs will cause the build to fail.

@DDzia
Copy link
Author

DDzia commented Jun 18, 2018

@alan-agius4, it is will be to work for a follow releases?

@alan-agius4
Copy link
Collaborator

alan-agius4 commented Jun 18, 2018

@derkachdeveloper, I am not sure if I understand what you meant above. but, if you meant, if this is a bug that will be solved in the future. I don't know, it's a tsickle https://github.com/angular/tsickle/blob/d24b139b71a3f86bf25d6eecf4d4dcdad3b379e4/src/jsdoc.ts#L170-L178, and redundant JSDocs needs to be removed in order to get your build working.

I suggest you enable the no-redundant-jsdoc tslint rule. https://palantir.github.io/tslint/rules/no-redundant-jsdoc/

@alan-agius4
Copy link
Collaborator

Take a look at: angular/angular#19969

@DDzia
Copy link
Author

DDzia commented Jun 18, 2018

@alan-agius4 , thank you. Close issue.

@DDzia DDzia closed this as completed Jun 18, 2018
alexeagle pushed a commit that referenced this issue Aug 13, 2018
When building a library, `tsickle` is used as the `annotateForClosureCompiler` option is `true`. `tsickle` warns when redundant jsdocs are used.

https://github.com/angular/tsickle/blob/d24b139b71a3f86bf25d6eecf4d4dcdad3b379e4/src/jsdoc.ts#L170-L178

These diagnostics are later passed to Angular Compiler and are treated as errors.

Seeing this: angular/angular#19969 (comment) it looks like it is expected that warnings will fail the build.

Closes: #11282
@matheusdavidson
Copy link

matheusdavidson commented Feb 18, 2019

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

from this:

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

to this:

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

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants