ESLint: Re-enable rule no-restricted-globals (#10863)

* Re-enable rule no-restricted-globals

* Fix missing semicolons
This commit is contained in:
Kamil Gabryjelski
2020-09-14 19:39:46 +02:00
committed by GitHub
parent 7f1012360a
commit 1908a94c7e
12 changed files with 18 additions and 20 deletions

View File

@@ -241,9 +241,9 @@ class ExploreViewContainer extends React.Component {
const longUrl = getExploreLongUrl(this.props.form_data, null, false);
try {
if (isReplace) {
history.replaceState(payload, title, longUrl);
window.history.replaceState(payload, title, longUrl);
} else {
history.pushState(payload, title, longUrl);
window.history.pushState(payload, title, longUrl);
}
} catch (e) {
logging.warn(
@@ -268,7 +268,7 @@ class ExploreViewContainer extends React.Component {
}
handlePopstate() {
const formData = history.state;
const formData = window.history.state;
if (formData && Object.keys(formData).length) {
this.props.actions.setExploreControls(formData);
this.props.actions.postChartFormData(

View File

@@ -64,10 +64,10 @@ export default class BoundsControl extends React.Component {
onChange() {
const mm = this.state.minMax;
const errors = [];
if (mm[0] && isNaN(mm[0])) {
if (mm[0] && Number.isNaN(mm[0])) {
errors.push(t('`Min` value should be numeric or empty'));
}
if (mm[1] && isNaN(mm[1])) {
if (mm[1] && Number.isNaN(mm[1])) {
errors.push(t('`Max` value should be numeric or empty'));
}
if (errors.length === 0) {

View File

@@ -114,9 +114,9 @@ export default class FilterBoxItemControl extends React.Component {
if (type === 'BOOLEAN') {
typedValue = value === 'true';
} else if (INTEGRAL_TYPES.has(type)) {
typedValue = isNaN(value) ? null : parseInt(value, 10);
typedValue = Number.isNaN(value) ? null : parseInt(value, 10);
} else if (DECIMAL_TYPES.has(type)) {
typedValue = isNaN(value) ? null : parseFloat(value);
typedValue = Number.isNaN(value) ? null : parseFloat(value);
}
}
}

View File

@@ -117,9 +117,9 @@ export function getChartDataUri({ path, qs, allowDomainSharding = false }) {
// but can be specified with curUrl (used for unit tests to spoof
// the window.location).
let uri = new URI({
protocol: location.protocol.slice(0, -1),
protocol: window.location.protocol.slice(0, -1),
hostname: getHostName(allowDomainSharding),
port: location.port ? location.port : '',
port: window.location.port ? window.location.port : '',
path,
});
if (qs) {