Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

style(*): remove unused variables #13701

Closed
wants to merge 3 commits into from
Closed

Conversation

jbedard
Copy link
Collaborator

@jbedard jbedard commented Jan 7, 2016

... and in some cases make use of unused vars, and rename a duplicate var.

It would be nice of some of these could be caught by the build...

@@ -1,6 +1,6 @@
'use strict';

var $compileMinErr = minErr('$compile');
var $templateRequestMinErr = minErr('$compile');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also just reuse the already created $compileMinErr.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured this file shouldn't depend on compile.js like that. Might want to also remove the '$compile' string but I figured that would be another change...

@gkalpak
Copy link
Member

gkalpak commented Jan 11, 2016

LGTM

} else {
parsedNgModelAssign($scope, ctrl.$modelValue);
parsedNgModelAssign($scope, newValue);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lgalfaso are these two changes correct?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@petebacondarwin
Copy link
Contributor

In that case LGTM

@Narretz Narretz added this to the 1.6.x milestone Jan 25, 2016
@Narretz
Copy link
Contributor

Narretz commented Jan 25, 2016

jshint has an unused rule. Let's see what happens when we use that.

@Narretz Narretz modified the milestones: 1.6.x, Backlog Jan 25, 2016
@jbedard
Copy link
Collaborator Author

jbedard commented Jan 26, 2016

Currently that doesn't work very well because of how variables are shared across files and jshint is run on the src files. If jshint was instead run on the resulting angular.js it would work, or maybe if shared variables are marked as globals or the rule is disabled for those vars?

@Narretz
Copy link
Contributor

Narretz commented Feb 8, 2016

Many files use jshint global already. Some variables actually show up as undefined if they are not marked global. But maybe that's just my personal setup.

@Narretz
Copy link
Contributor

Narretz commented Feb 8, 2016

Ah, I confused unused with undef ... So yes, directives, providers, services all trigger unused because they are only used in AngularPublic.js. This file already has a global definition, it's just that a lot of functions and variables are missing.
And for some reason, the angular api functions are also marked as unused, even though they are marked global in the src\jshint file

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants