Change constants imports to remove 'require'

Signed-off-by: Christina Ying Wang <christina@balena.io>
This commit is contained in:
Christina Ying Wang 2023-02-20 17:38:05 -08:00 committed by Christina W
parent 07b8d44545
commit 9522c15ecd
10 changed files with 13 additions and 14 deletions

View File

@ -14,7 +14,7 @@ import {
} from './composition-steps';
import * as targetStateCache from '../device-state/target-state-cache';
import * as dockerUtils from '../lib/docker-utils';
import constants = require('../lib/constants');
import * as constants from '../lib/constants';
import { getStepsFromStrategy } from './update-strategies';

View File

@ -9,7 +9,7 @@ import LocalModeManager from '../local-mode';
import * as dbFormat from '../device-state/db-format';
import { validateTargetContracts } from '../lib/contracts';
import constants = require('../lib/constants');
import * as constants from '../lib/constants';
import { docker } from '../lib/docker-utils';
import log from '../lib/supervisor-console';
import {

View File

@ -12,7 +12,7 @@ import { docker } from '../lib/docker-utils';
import * as logger from '../logger';
import { PermissiveNumber } from '../config/types';
import constants = require('../lib/constants');
import * as constants from '../lib/constants';
import {
InternalInconsistencyError,
isNotFoundError,

View File

@ -2,7 +2,7 @@ import * as _ from 'lodash';
import * as Path from 'path';
import { VolumeInspectInfo } from 'dockerode';
import constants = require('../lib/constants');
import * as constants from '../lib/constants';
import { isNotFoundError, InternalInconsistencyError } from '../lib/errors';
import { safeRename } from '../lib/fs-utils';
import { docker } from '../lib/docker-utils';

View File

@ -2,7 +2,7 @@ import * as Docker from 'dockerode';
import isEqual = require('lodash/isEqual');
import omitBy = require('lodash/omitBy');
import constants = require('../lib/constants');
import * as constants from '../lib/constants';
import { docker } from '../lib/docker-utils';
import { InternalInconsistencyError } from '../lib/errors';
import * as LogTypes from '../lib/log-types';

View File

@ -15,7 +15,7 @@ import * as globalEventBus from './event-bus';
import * as network from './network';
import * as deviceConfig from './device-config';
import constants = require('./lib/constants');
import * as constants from './lib/constants';
import * as dbus from './lib/dbus';
import {
InternalInconsistencyError,

View File

@ -10,7 +10,7 @@ import { InternalInconsistencyError } from '../lib/errors';
import { getGotInstance } from '../lib/request';
import * as config from '../config';
import { writeLock } from '../lib/update-lock';
import constants = require('../lib/constants');
import * as constants from '../lib/constants';
import log from '../lib/supervisor-console';
export class ApiResponseError extends Error {}

View File

@ -1,5 +1,5 @@
import blinking = require('blinking');
import constants = require('./constants');
import { ledFile } from './constants';
export = blinking(constants.ledFile);
export = blinking(ledFile);

View File

@ -6,7 +6,7 @@ import { expect } from 'chai';
import { testfs, TestFs } from 'mocha-pod';
import * as hostUtils from '~/lib/host-utils';
import constants = require('~/lib/constants');
import * as constants from '~/lib/constants';
import { fnSchema } from '~/src/config/functions';
// Utility method to use along with `require`

View File

@ -1,16 +1,15 @@
import _ = require('lodash');
import * as _ from 'lodash';
import { expect } from 'chai';
import * as sinon from 'sinon';
import * as config from '~/src/config';
import * as firewall from '~/lib/firewall';
import * as logger from '~/src/logger';
import * as iptablesMock from '~/test-lib/mocked-iptables';
import * as dbFormat from '~/src/device-state/db-format';
import constants = require('~/lib/constants');
import * as iptables from '~/lib/iptables';
import * as firewall from '~/lib/firewall';
import * as constants from '~/lib/constants';
import { RuleAction, Rule } from '~/lib/iptables';
import { log } from '~/lib/supervisor-console';