Add ESLint to maintain code style. Add pre-commit hook to lint prior.

ESLint is used with the standard react plugin. It detects all kinds of
issues ranging from misspells, indentation, variable-naming, etc.
A pre-commit hook is added to git. Prior commiting, ESlint will run
to validate that everything is OK and the user will have the option
to fix it.

Signed-off-by: Sudhanshu Gautam <me@sudhanshug.com>
This commit is contained in:
Sudhanshu Gautam 2019-07-21 21:27:38 +05:30
parent d30cf925b1
commit 9475f4092a
13 changed files with 1116 additions and 1036 deletions

View file

@ -3,17 +3,18 @@ import axios from 'axios';
const base = 'https://cors-anywhere.herokuapp.com/https://mwarning.de/misc/json/bin';
class DataService {
getDevicesData = axios.get(
`${base}/overview.json`)
.then(res => res.data);
`${base}/overview.json`)
.then(res => res.data);
getDeviceData = (device_id) => axios.get(
base + '/targets/' + device_id)
.then(res => res.data);
base + '/targets/' + device_id)
.then(res => res.data);
getDistributions = axios.get(
'https://chef.libremesh.org/api/distributions')
.then(res => res.data);
'https://chef.libremesh.org/api/distributions')
.then(res => res.data);
buildImage = (board, packages, target, version) => {
return axios.post('https://chef.libremesh.org/api/build-request', {
@ -34,7 +35,7 @@ class DataService {
response.isBuilt = res.status === 202 && res.data.files !== undefined;
response.status = res.status;
if (response.isBuilt) {
response = {...response, data: res.data}
response = {...response, data: res.data};
}
});
return response;