fix: no-redeclare

```
/Users/1ambda/github/apache/apache-zeppelin/zeppelin-master/zeppelin-web/src/app/notebook/notebook.controller.js
  646:24  error    'len' is already defined          no-redeclare

/Users/1ambda/github/apache/apache-zeppelin/zeppelin-master/zeppelin-web/src/app/tabledata/transformation.js
  58:18  error  'k' is already defined     no-redeclare
  77:11  error  'self' is already defined  no-redeclare

/Users/1ambda/github/apache/apache-zeppelin/zeppelin-master/zeppelin-web/src/app/visualization/builtins/visualization-areachart.js
  68:9  error  'self' is already defined  no-redeclare

/Users/1ambda/github/apache/apache-zeppelin/zeppelin-master/zeppelin-web/src/app/visualization/builtins/visualization-barchart.js
  65:9  error  'self' is already defined  no-redeclare

/Users/1ambda/github/apache/apache-zeppelin/zeppelin-master/zeppelin-web/src/app/visualization/builtins/visualization-scatterchart.js
  228:14  error  'i' is already defined  no-redeclare

/Users/1ambda/github/apache/apache-zeppelin/zeppelin-master/zeppelin-web/src/app/visualization/visualization.js
  138:18  error  'k' is already defined  no-redeclare
```
This commit is contained in:
1ambda 2017-04-15 02:08:22 +09:00
parent a5947da10d
commit 3fd91fea98
6 changed files with 8 additions and 10 deletions

View file

@ -31,7 +31,6 @@
"process": false
},
"rules": {
"no-redeclare": 0,
"no-var": 0,
"semi": 0,
"no-unneeded-ternary": 0,

View file

@ -643,7 +643,7 @@ function NotebookCtrl ($scope, $route, $routeParams, $location, $rootScope,
}
if (data.body.roles.length !== 0) {
var roles = [];
for (var len = 0; len < data.body.roles.length; len++) {
for (let len = 0; len < data.body.roles.length; len++) {
roles.push({
'id': data.body.roles[len],
'text': data.body.roles[len]

View file

@ -51,11 +51,11 @@ export default class Transformation {
if (this._scope) {
var self = this;
this._scope.$apply(function () {
for (var k in setting.scope) {
for (let k in setting.scope) {
self._scope[k] = setting.scope[k];
}
for (var k in self._prevSettingScope) {
for (let k in self._prevSettingScope) {
if (!setting.scope[k]) {
self._scope[k] = setting.scope[k];
}
@ -74,7 +74,7 @@ export default class Transformation {
if (template.split('\n').length === 1 &&
template.endsWith('.html')) { // template is url
var self = this;
let self = this;
this._templateRequest(template).then(function (t) {
self._render(targetEl, t, scope);
});

View file

@ -57,7 +57,7 @@ export default class AreachartVisualization extends Nvd3ChartVisualization {
}
configureChart (chart) {
var self = this;
let self = this;
chart.xAxis.tickFormat(function (d) { return self.xAxisTickFormat(d, self.xLabels); });
chart.yAxis.tickFormat(function (d) { return self.yAxisTickFormat(d); });
chart.yAxis.axisLabelDistance(50);
@ -65,7 +65,6 @@ export default class AreachartVisualization extends Nvd3ChartVisualization {
this.chart.style(this.config.style || 'stack');
var self = this;
this.chart.dispatch.on('stateChange', function (s) {
self.config.style = s.style;

View file

@ -225,7 +225,7 @@ export default class ScatterchartVisualization extends Nvd3ChartVisualization {
return ((a['x'] - b['x']) || (a['y'] - b['y']))
});
for (var i = 0; i < d3gvalues.length - 1;) {
for (let i = 0; i < d3gvalues.length - 1;) {
if ((Math.abs(d3gvalues[i]['x'] - d3gvalues[i + 1]['x']) < epsilon) &&
(Math.abs(d3gvalues[i]['y'] - d3gvalues[i + 1]['y']) < epsilon)) {
d3gvalues.splice(i + 1, 1);

View file

@ -131,11 +131,11 @@ export default class Visualization {
if (this._scope) {
var self = this;
this._scope.$apply(function () {
for (var k in setting.scope) {
for (let k in setting.scope) {
self._scope[k] = setting.scope[k];
}
for (var k in self._prevSettingScope) {
for (let k in self._prevSettingScope) {
if (!setting.scope[k]) {
self._scope[k] = setting.scope[k];
}