Skip to content

Commit a628b0a

Browse files
committed
eslint auto & MANUAL fixes
1 parent ad53349 commit a628b0a

File tree

106 files changed

+8551
-7009
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+8551
-7009
lines changed

api/analytics.js

+10-11
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
export default axios => ({
2-
fetchTopTrendingCases: (limit) => {
2+
fetchTopTrendingCases: limit => {
33
const params = {
4-
limit,
5-
};
4+
limit
5+
}
66

7-
return axios.get(`/v3/stats/worldometer/totalTrendingCases`, { params })
7+
return axios
8+
.get(`/v3/stats/worldometer/totalTrendingCases`, { params })
89
.then(res => res.data)
910
},
10-
11+
1112
// deprecating
1213
fetchAffectedCountry: () => {
13-
return axios.get(`/v2/analytics/country`)
14-
.then(res => res.data)
14+
return axios.get(`/v2/analytics/country`).then(res => res.data)
1515
},
1616

1717
fetchTopCountryWithDailyNewStatsSortByNewCases: () => {
18-
return axios.get(`/v3/analytics/dailyNewStats`)
19-
.then(res => res.data)
20-
},
21-
});
18+
return axios.get(`/v3/analytics/dailyNewStats`).then(res => res.data)
19+
}
20+
})

api/healthcareInstitutions.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
export default axios => ({
22
getHealthcareInstitutions: () => {
3-
return axios.get(`/v1/healthcare-institution`)
4-
.then(res => res.data);
5-
},
6-
});
3+
return axios.get(`/v1/healthcare-institution`).then(res => res.data)
4+
}
5+
})

api/index.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import analyticsApiFactory from './analytics';
2-
import healthcareInstitutionsApiFactory from './healthcareInstitutions'
3-
import newsApiFactory from './news';
4-
import statsApiFactory from './stats';
5-
import travelAlertApiFactory from './travelAlert';
1+
import analyticsApiFactory from "./analytics"
2+
import healthcareInstitutionsApiFactory from "./healthcareInstitutions"
3+
import newsApiFactory from "./news"
4+
import statsApiFactory from "./stats"
5+
import travelAlertApiFactory from "./travelAlert"
66

77
const apiFactory = axios => ({
88
analytics: analyticsApiFactory(axios),
99
healthcareInstitutions: healthcareInstitutionsApiFactory(axios),
1010
news: newsApiFactory(axios),
1111
stats: statsApiFactory(axios),
12-
travelAlert: travelAlertApiFactory(axios),
13-
});
12+
travelAlert: travelAlertApiFactory(axios)
13+
})
1414

15-
export default apiFactory;
15+
export default apiFactory

api/news.js

+26-18
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,29 @@
11
export default axios => ({
2-
getTrendingNews: ({ limit, offset, countryCode, country, language = 'en' }) => {
3-
return axios.get(`/news/trending`, {
4-
params: {
5-
limit,
6-
offset,
7-
countryCode,
8-
country,
9-
language
10-
},
11-
})
12-
.then(res => res.data);
2+
getTrendingNews: ({
3+
limit,
4+
offset,
5+
countryCode,
6+
country,
7+
language = "en"
8+
}) => {
9+
return axios
10+
.get(`/news/trending`, {
11+
params: {
12+
limit,
13+
offset,
14+
countryCode,
15+
country,
16+
language
17+
}
18+
})
19+
.then(res => res.data)
1320
},
1421

15-
searchNews: (q) => {
16-
return axios.get(`/news`, {
17-
params: { q },
18-
})
19-
.then(res => res.data);
20-
},
21-
});
22+
searchNews: q => {
23+
return axios
24+
.get(`/news`, {
25+
params: { q }
26+
})
27+
.then(res => res.data)
28+
}
29+
})

api/stats.js

+38-22
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,60 @@ export default axios => ({
22
getTopNCountryStats: (limit, sort) => {
33
const params = {
44
limit,
5-
sort,
6-
};
5+
sort
6+
}
77

8-
return axios.get(`/v3/stats/worldometer/topCountry`, { params })
8+
return axios
9+
.get(`/v3/stats/worldometer/topCountry`, { params })
910
.then(res => {
10-
const countryStats = res.data
11-
&& res.data
12-
// Remove invalid data.
13-
.filter(stat => stat.countryCode && (stat.totalConfirmed || stat.totalDeaths || stat.totalRecovered)) || [];
11+
const countryStats =
12+
(res.data &&
13+
res.data
14+
// Remove invalid data.
15+
.filter(
16+
stat =>
17+
stat.countryCode &&
18+
(stat.totalConfirmed ||
19+
stat.totalDeaths ||
20+
stat.totalRecovered)
21+
)) ||
22+
[]
1423

15-
return countryStats
16-
// De-duplicate stats by country code
17-
.filter((stat, index) => index === countryStats.findIndex(a => a.countryCode === stat.countryCode));
24+
return (
25+
countryStats
26+
// De-duplicate stats by country code
27+
.filter(
28+
(stat, index) =>
29+
index ===
30+
countryStats.findIndex(a => a.countryCode === stat.countryCode)
31+
)
32+
)
1833
})
1934
},
2035

21-
getCountrySpecificStats: (countryCode) => {
36+
getCountrySpecificStats: countryCode => {
2237
const params = {
23-
countryCode,
24-
};
38+
countryCode
39+
}
2540

26-
return axios.get(`/v3/stats/worldometer/country`, { params })
27-
.then(res => res.data);
41+
return axios
42+
.get(`/v3/stats/worldometer/country`, { params })
43+
.then(res => res.data)
2844
},
2945

3046
getGlobalStats: () => {
31-
return axios.get(`/v3/stats/worldometer/global`)
32-
.then(res => res.data);
47+
return axios.get(`/v3/stats/worldometer/global`).then(res => res.data)
3348
},
3449

3550
getTrendByCountryDate: (countryCode, startDate, endDate) => {
3651
const params = {
3752
countryCode,
3853
startDate,
39-
endDate,
40-
};
54+
endDate
55+
}
4156

42-
return axios.get(`/v3/analytics/trend/country`, { params })
43-
.then(res => res.data);
57+
return axios
58+
.get(`/v3/analytics/trend/country`, { params })
59+
.then(res => res.data)
4460
}
45-
});
61+
})

api/travelAlert.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
export default axios => ({
22
getTravelAlert: () => {
3-
return axios.get(`/v1/travel-alert`)
4-
.then(res => res.data);
5-
},
6-
});
3+
return axios.get(`/v1/travel-alert`).then(res => res.data)
4+
}
5+
})

babel.config.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
module.exports = {
2-
presets: [
3-
'@vue/cli-plugin-babel/preset'
4-
]
2+
presets: ["@vue/cli-plugin-babel/preset"]
53
}

0 commit comments

Comments
 (0)