File tree Expand file tree Collapse file tree 6 files changed +26
-12
lines changed Expand file tree Collapse file tree 6 files changed +26
-12
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,16 @@ module.exports = {
3737 // Restrict importing BN from bn.js
3838 "group" : [ "bn.js" ] ,
3939 "message" : "Import BN from @drift-labs/sdk instead" ,
40- }
40+ } ,
41+ {
42+ // Prevent imports from index files within the same package
43+ group : [
44+ '**/index' ,
45+ '**/index.ts' ,
46+ ] ,
47+ message :
48+ 'Do not import from index file within the same package. Import directly from source files instead. This prevents barrel imports.' ,
49+ } ,
4150 ] ,
4251 } ,
4352 ] ,
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ import {
2121 FuelSeasonRecord ,
2222 InsuranceFundSwapRecord ,
2323 TransferProtocolIfSharesToRevenuePoolRecord ,
24- } from '../index ' ;
24+ } from '../types ' ;
2525import { EventEmitter } from 'events' ;
2626
2727export type EventSubscriptionOptions = {
Original file line number Diff line number Diff line change 11import { PERCENTAGE_PRECISION , ZERO } from '../constants/numericConstants' ;
2- import { BN , SpotMarketAccount , SpotBalanceType } from '../index' ;
32import { getTokenAmount } from '../math/spotBalance' ;
3+ import { BN } from '@coral-xyz/anchor' ;
4+ import { SpotBalanceType , SpotMarketAccount } from '../types' ;
45
56export function nextRevenuePoolSettleApr (
67 spotMarket : SpotMarketAccount ,
Original file line number Diff line number Diff line change 1- import { AMM , OracleGuardRails , isVariant } from '../types' ;
1+ import {
2+ AMM ,
3+ HistoricalOracleData ,
4+ OracleGuardRails ,
5+ OracleSource ,
6+ PerpMarketAccount ,
7+ isVariant ,
8+ } from '../types' ;
29import { OraclePriceData } from '../oracles/types' ;
310import {
411 BID_ASK_SPREAD_PRECISION ,
@@ -9,13 +16,8 @@ import {
916 FIVE_MINUTE ,
1017 PERCENTAGE_PRECISION ,
1118} from '../constants/numericConstants' ;
12- import {
13- BN ,
14- HistoricalOracleData ,
15- OracleSource ,
16- PerpMarketAccount ,
17- } from '../index' ;
1819import { assert } from '../assert/assert' ;
20+ import { BN } from '@coral-xyz/anchor' ;
1921
2022export function oraclePriceBands (
2123 market : PerpMarketAccount ,
Original file line number Diff line number Diff line change @@ -13,12 +13,13 @@ import { PollingSubscription } from './PollingSubscription';
1313import { WebsocketSubscription } from './WebsocketSubscription' ;
1414import StrictEventEmitter from 'strict-event-emitter-types' ;
1515import { EventEmitter } from 'events' ;
16- import { calculateOrderBaseAssetAmount , ZERO } from '../index' ;
1716import { BN } from '@coral-xyz/anchor' ;
1817import { ProtectMakerParamsMap } from '../dlob/types' ;
1918import { decodeUser } from '../decode/user' ;
2019import { grpcSubscription } from './grpcSubscription' ;
2120import { isUserProtectedMaker } from '../math/userStatus' ;
21+ import { calculateOrderBaseAssetAmount } from '../math/orders' ;
22+ import { ZERO } from '../constants/numericConstants' ;
2223
2324export class OrderSubscriber {
2425 driftClient : DriftClient ;
Original file line number Diff line number Diff line change 1- import { BN , numberToSafeBN } from '../../src/index' ;
21import { expect } from 'chai' ;
32import { BigNum } from '../../src/factory/bigNum' ;
43import {
76 BASE_PRECISION_EXP ,
87 TEN_THOUSAND ,
98} from '../../src/constants/numericConstants' ;
9+ import { BN } from '@coral-xyz/anchor' ;
10+ import { numberToSafeBN } from '../../src/math/utils' ;
1011
1112// if you used the '@types/mocha' method to install mocha type definitions, uncomment the following line
1213// import 'mocha';
You can’t perform that action at this time.
0 commit comments