Skip to content

Update eslint to the latest version 🚀 #1168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 66 additions & 35 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"babel-plugin-transform-object-rest-spread": "6.26.0",
"core-js": "2.6.5",
"css-loader": "3.1.0",
"eslint": "5.16.0",
"eslint": "6.1.0",
"eslint-plugin-jest": "22.13.2",
"eslint-plugin-react": "7.14.1",
"file-loader": "4.1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/components/BrowserCell/BrowserCell.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ let BrowserCell = ({ type, value, hidden, width, current, onSelect, onEditChange
} else if (type === 'ACL') {
let pieces = [];
let json = value.toJSON();
if (json.hasOwnProperty('*')) {
if (Object.prototype.hasOwnProperty.call(json, '*')) {
if (json['*'].read && json['*'].write) {
pieces.push('Public Read + Write');
} else if (json['*'].read) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ export default class ExplorerQueryComposer extends React.Component {
}

renderFilter(filter, index=0) {
let type = Constraints[filter.op].hasOwnProperty('field') ? Constraints[filter.op].field : FIELD_TYPE[filter.col];
let type = Object.prototype.hasOwnProperty.call(Constraints[filter.op], 'field') ? Constraints[filter.op].field : FIELD_TYPE[filter.col];

let constraintView = null;
if (type === 'JSON') {
Expand Down
4 changes: 2 additions & 2 deletions src/components/Filter/Filter.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function changeField(schema, filters, index, newField) {
function changeConstraint(schema, filters, index, newConstraint) {
let field = filters.get(index).get('field');
let compareType = schema[field].type;
if (Filters.Constraints[newConstraint].hasOwnProperty('field')) {
if (Object.prototype.hasOwnProperty.call(Filters.Constraints[newConstraint], 'field')) {
compareType = Filters.Constraints[newConstraint].field;
}
let newFilter = new Map({
Expand Down Expand Up @@ -59,7 +59,7 @@ let Filter = ({ schema, filters, renderRow, onChange, blacklist }) => {
fields.sort();
let constraints = Filters.FieldConstraints[schema[field].type].filter((c) => blacklist.indexOf(c) < 0);
let compareType = schema[field].type;
if (Filters.Constraints[constraint].hasOwnProperty('field')) {
if (Object.prototype.hasOwnProperty.call(Filters.Constraints[constraint], 'field')) {
compareType = Filters.Constraints[constraint].field;
}
return renderRow({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const AUDIENCE_SIZE_FETCHING_ENABLED = true;
let filterFormatter = (filters, schema) => {
return filters.map((filter) => {
let type = schema[filter.get('field')];
if (Filters.Constraints[filter.get('constraint')].hasOwnProperty('field')) {
if (Object.prototype.hasOwnProperty.call(Filters.Constraints[filter.get('constraint')], 'field')) {
type = Filters.Constraints[filter.get('constraint')].field;
}
// Format any stringified fields
Expand Down
2 changes: 1 addition & 1 deletion src/dashboard/Analytics/SlowQueries/SlowQueries.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class SlowQueries extends TableView {
let os = value['OS'];
let version = value['App Display Version'];
if (os === null || version === null) return;
if (appVersions.hasOwnProperty(os)) {
if (Object.prototype.hasOwnProperty.call(appVersions, os)) {
appVersions[os].push(version);
} else {
appVersions[os] = [version];
Expand Down
2 changes: 1 addition & 1 deletion src/dashboard/Push/PushIndex.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ let isChannelTargeted = (pushData) => {
let additionalKeys = false;

for (let key in queryJSON) {
if (queryJSON.hasOwnProperty(key)) {
if (Object.prototype.hasOwnProperty.call(queryJSON, key)) {
if (key !== 'deviceType' && key !== 'channels') {
additionalKeys = true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/AJAX.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export function request(method, url, body, abortable = false, withCredentials =
p.reject(this.responseText);
return;
}
if (json.hasOwnProperty('success') && json.success === false) {
if (Object.prototype.hasOwnProperty.call(json, 'success') && json.success === false) {
p.reject(json);
} else {
p.resolve(json);
Expand Down
8 changes: 4 additions & 4 deletions src/lib/PushUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ let formatConstraintComponent = (key, operation, value, schema) => {
let formatStructure = (key, constraints, schema) => {
let rows = [];
for(let prop in constraints){
if(constraints.hasOwnProperty(prop)){
if(Object.prototype.hasOwnProperty.call(constraints, prop)){
rows.push(formatConstraintComponent(key, prop, constraints[prop], schema));
}
}
Expand Down Expand Up @@ -287,9 +287,9 @@ export function largeInfoBuilder(query, schema, styles = {}) {
<ul className={styles.installationInfo}>
<li className={styles.detailsHeaderListItem}>INSTALLATION CONDITIONS</li>
{conditionRows}
</ul> :
</ul> :
null
}
}
</div>
)
}
Expand All @@ -307,7 +307,7 @@ let tableInfoBuilderHelper = (styles, key, description, value) => {
export function tableInfoBuilder(query, schema, styles = {}) {
try {
query = JSON.parse(query);
} catch(e) {/**/}
} catch(e) {/**/}

if(!query) {
return;
Expand Down