This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 247891

Summary: [Warning] Unused loaded module
Product: javascript Reporter: Ondrej Brejla <obrejla>
Component: RequireJSAssignee: Petr Pisl <ppisl>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.1   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description Ondrej Brejla 2014-10-13 11:14:40 UTC
It would be great to have a warning for an "unused loaded module".

Example:

define([
    'blah/Foo',
    'blah/Bar'
], function(Foo, Bar) { // Bar should be marked with a Warning...

    Foo.doSomething();

});

blah/Bar is loaded, but never used, so it probably shouldn't be loaded...

This is ok:

define([
    'blah/Foo',
    'blah/Bar'
], function(Foo) {

    Foo.doSomething();

});

blah/Bar is loaded because it needs to initialize something, but there is no Bar param in a function, because it is not used in this module.

Thanks.