mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-19 17:26:34 +00:00
Add husky and lint-staged to run linting on commit
Change-type: patch Signed-off-by: Stevche Radevski <stevche@balena.io>
This commit is contained in:
parent
388852d6b7
commit
9f4e0ce920
@ -18,6 +18,8 @@ import * as _ from 'lodash';
|
|||||||
import * as propTypes from 'prop-types';
|
import * as propTypes from 'prop-types';
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
import * as driveConstraints from '../../../../shared/drive-constraints';
|
||||||
|
import * as utils from '../../../../shared/utils';
|
||||||
import * as TargetSelector from '../../components/drive-selector/target-selector.jsx';
|
import * as TargetSelector from '../../components/drive-selector/target-selector.jsx';
|
||||||
import * as SvgIcon from '../../components/svg-icon/svg-icon.jsx';
|
import * as SvgIcon from '../../components/svg-icon/svg-icon.jsx';
|
||||||
import * as selectionState from '../../models/selection-state';
|
import * as selectionState from '../../models/selection-state';
|
||||||
@ -25,8 +27,6 @@ import * as settings from '../../models/settings';
|
|||||||
import * as store from '../../models/store';
|
import * as store from '../../models/store';
|
||||||
import * as analytics from '../../modules/analytics';
|
import * as analytics from '../../modules/analytics';
|
||||||
import * as exceptionReporter from '../../modules/exception-reporter';
|
import * as exceptionReporter from '../../modules/exception-reporter';
|
||||||
import * as driveConstraints from '../../../../shared/drive-constraints';
|
|
||||||
import * as utils from '../../../../shared/utils';
|
|
||||||
|
|
||||||
const StepBorder = styled.div<{
|
const StepBorder = styled.div<{
|
||||||
disabled: boolean;
|
disabled: boolean;
|
||||||
@ -68,8 +68,10 @@ const openDriveSelector = async (DriveSelectorService: any) => {
|
|||||||
device: drive.device,
|
device: drive.device,
|
||||||
unsafeMode:
|
unsafeMode:
|
||||||
settings.get('unsafeMode') && !settings.get('disableUnsafeMode'),
|
settings.get('unsafeMode') && !settings.get('disableUnsafeMode'),
|
||||||
applicationSessionUuid: (store as any).getState().toJS().applicationSessionUuid,
|
applicationSessionUuid: (store as any).getState().toJS()
|
||||||
flashingWorkflowUuid: (store as any).getState().toJS().flashingWorkflowUuid,
|
.applicationSessionUuid,
|
||||||
|
flashingWorkflowUuid: (store as any).getState().toJS()
|
||||||
|
.flashingWorkflowUuid,
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
exceptionReporter.report(error);
|
exceptionReporter.report(error);
|
||||||
@ -79,7 +81,8 @@ const openDriveSelector = async (DriveSelectorService: any) => {
|
|||||||
const reselectDrive = (DriveSelectorService: any) => {
|
const reselectDrive = (DriveSelectorService: any) => {
|
||||||
openDriveSelector(DriveSelectorService);
|
openDriveSelector(DriveSelectorService);
|
||||||
analytics.logEvent('Reselect drive', {
|
analytics.logEvent('Reselect drive', {
|
||||||
applicationSessionUuid: (store as any).getState().toJS().applicationSessionUuid,
|
applicationSessionUuid: (store as any).getState().toJS()
|
||||||
|
.applicationSessionUuid,
|
||||||
flashingWorkflowUuid: (store as any).getState().toJS().flashingWorkflowUuid,
|
flashingWorkflowUuid: (store as any).getState().toJS().flashingWorkflowUuid,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -18,6 +18,8 @@ import * as _ from 'lodash';
|
|||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { Modal, Txt } from 'rendition';
|
import { Modal, Txt } from 'rendition';
|
||||||
|
import * as constraints from '../../../../shared/drive-constraints';
|
||||||
|
import * as messages from '../../../../shared/messages';
|
||||||
import * as ProgressButton from '../../components/progress-button/progress-button.jsx';
|
import * as ProgressButton from '../../components/progress-button/progress-button.jsx';
|
||||||
import * as SvgIcon from '../../components/svg-icon/svg-icon.jsx';
|
import * as SvgIcon from '../../components/svg-icon/svg-icon.jsx';
|
||||||
import * as availableDrives from '../../models/available-drives';
|
import * as availableDrives from '../../models/available-drives';
|
||||||
@ -29,8 +31,6 @@ import * as driveScanner from '../../modules/drive-scanner';
|
|||||||
import * as imageWriter from '../../modules/image-writer';
|
import * as imageWriter from '../../modules/image-writer';
|
||||||
import * as progressStatus from '../../modules/progress-status';
|
import * as progressStatus from '../../modules/progress-status';
|
||||||
import * as notification from '../../os/notification';
|
import * as notification from '../../os/notification';
|
||||||
import * as constraints from '../../../../shared/drive-constraints';
|
|
||||||
import * as messages from '../../../../shared/messages';
|
|
||||||
|
|
||||||
const COMPLETED_PERCENTAGE = 100;
|
const COMPLETED_PERCENTAGE = 100;
|
||||||
const SPEED_PRECISION = 2;
|
const SPEED_PRECISION = 2;
|
||||||
@ -189,8 +189,10 @@ export const Flash = ({
|
|||||||
flashState.resetState();
|
flashState.resetState();
|
||||||
if (shouldRetry) {
|
if (shouldRetry) {
|
||||||
analytics.logEvent('Restart after failure', {
|
analytics.logEvent('Restart after failure', {
|
||||||
applicationSessionUuid: (store as any).getState().toJS().applicationSessionUuid,
|
applicationSessionUuid: (store as any).getState().toJS()
|
||||||
flashingWorkflowUuid: (store as any).getState().toJS().flashingWorkflowUuid,
|
.applicationSessionUuid,
|
||||||
|
flashingWorkflowUuid: (store as any).getState().toJS()
|
||||||
|
.flashingWorkflowUuid,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
selection.clear();
|
selection.clear();
|
||||||
|
830
npm-shrinkwrap.json
generated
830
npm-shrinkwrap.json
generated
File diff suppressed because it is too large
Load Diff
14
package.json
14
package.json
@ -32,6 +32,18 @@
|
|||||||
"concourse-test": "npx npm@6.7.0 test",
|
"concourse-test": "npx npm@6.7.0 test",
|
||||||
"concourse-test-electron": "npx npm@6.7.0 test"
|
"concourse-test-electron": "npx npm@6.7.0 test"
|
||||||
},
|
},
|
||||||
|
"husky": {
|
||||||
|
"hooks": {
|
||||||
|
"pre-commit": "lint-staged"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lint-staged": {
|
||||||
|
"./**/*.{js,mjs,jsx,ts,tsx}": [
|
||||||
|
"npm run prettier",
|
||||||
|
"make lint",
|
||||||
|
"git add"
|
||||||
|
]
|
||||||
|
},
|
||||||
"author": "Balena Inc. <hello@etcher.io>",
|
"author": "Balena Inc. <hello@etcher.io>",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"platformSpecificDependencies": [
|
"platformSpecificDependencies": [
|
||||||
@ -106,6 +118,8 @@
|
|||||||
"eslint-plugin-standard": "^3.0.1",
|
"eslint-plugin-standard": "^3.0.1",
|
||||||
"html-angular-validate": "^0.2.3",
|
"html-angular-validate": "^0.2.3",
|
||||||
"html-loader": "^0.5.1",
|
"html-loader": "^0.5.1",
|
||||||
|
"husky": "^3.1.0",
|
||||||
|
"lint-staged": "^9.5.0",
|
||||||
"mocha": "^6.2.1",
|
"mocha": "^6.2.1",
|
||||||
"mochainon": "^2.0.0",
|
"mochainon": "^2.0.0",
|
||||||
"node-gyp": "^3.8.0",
|
"node-gyp": "^3.8.0",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user