Skip to content

Commit

Permalink
Enable the no-undef rule (#1397)
Browse files Browse the repository at this point in the history
  • Loading branch information
amanmahajan7 authored Nov 26, 2018
1 parent 57119fd commit cb4fdc4
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
},
"globals" : {
"adz": true,
jQuery: true,
translate: true,
pluralTranslate: true
"jQuery": true,
"Immutable": true
},
"rules": {
/**
Expand Down Expand Up @@ -44,7 +43,8 @@
"vars": "local",
"args": "after-used"
}],
"no-use-before-define": 2, // http://eslint.org/docs/rules/no-use-before-define
"no-use-before-define": 2, // http://eslint.org/docs/rules/no-use-before-define,
"no-undef": 2,

/**
* Possible errors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function executeSpyTests(fn) {
it('should have filterTerm in every filter object', () => {
const filters = options.filters;
for (let i = 0; i < filters.length; i++) {
expect(filter.filterTerm).toBeDefined();
expect(filters[i].filterTerm).toBeDefined();
}
});
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const React = require('react');
import PropTypes from 'prop-types';
import moment from 'moment';

const ReactDOM = require('react-dom');
const Moment = require('moment');
const $ = require('jquery');
Expand Down Expand Up @@ -280,7 +282,8 @@ DateRangePicker.prototype = {
if ($(this.element).is('input[type=text]')) {
const val = $(this.element).val();
const split = val.split(this.separator);
start = end = null;
let start = null;
let end = null;
if (split.length === 2) {
start = moment(split[0], this.format);
end = moment(split[1], this.format);
Expand Down
12 changes: 3 additions & 9 deletions packages/react-data-grid/src/EmptyChildRow.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
import React from 'react';
import PropTypes from 'prop-types';
import {getSize, getColumn} from './ColumnUtils';
import { getSize, getColumn, getValue } from './ColumnUtils';

class EmptyChildRow extends React.Component {

constructor() {
super();
this.onAddSubRow = this.onAddSubRow.bind(this);
}

onAddSubRow() {
onAddSubRow = () => {
this.props.onAddSubRow(this.props.parentRowId);
}

Expand Down Expand Up @@ -39,7 +33,7 @@ class EmptyChildRow extends React.Component {
};
const expandColumn = getColumn(this.props.columns.filter(c => c.key === this.props.expandColumnKey), 0);

const cellLeft = expandColumn ? expandColumn.left : 0;
const cellLeft = expandColumn ? expandColumn.left : 0;
return (<div className="react-grid-Row rdg-add-child-row-container" style={style}>
<div className="react-grid-Cell" style={{ position: 'absolute', height: cellHeight, width: '100%', left: cellLeft }}>
<div className="rdg-empty-child-row" style={{ marginLeft: '30px', lineHeight: `${cellHeight}px` }}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Immutable from 'immutable';
import getScrollbarSize from '../getScrollbarSize';
const ColumnMetrics = require('../ColumnMetrics');

Expand Down
2 changes: 2 additions & 0 deletions packages/react-data-grid/src/__tests__/Header.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import React from 'react';
import Immutable from 'immutable';

import Header from '../Header';
import HeaderRow from '../HeaderRow';
import helpers, {fakeCellMetaData} from '../helpers/test/GridPropHelpers';
Expand Down
2 changes: 1 addition & 1 deletion packages/react-data-grid/src/masks/InteractionMasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ class InteractionMasks extends React.Component {
if (isFunction(onCellCopyPaste)) {
onCellCopyPaste({
cellKey,
rowIdx,
rowIdx: toRow,
fromRow,
toRow,
value: textToCopy
Expand Down

0 comments on commit cb4fdc4

Please sign in to comment.