@vulog/aima-billing 1.2.35 → 1.2.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -122,6 +122,84 @@ type RefundableAmount = {
122
122
  refundablePaymentReceipts: Receipt[];
123
123
  refundedPaymentReceipts: Receipt[];
124
124
  };
125
+ /** Billing line item returned by the trip invoices endpoint (nested in Billing array). */
126
+ type TripBillingItem = {
127
+ trip?: unknown;
128
+ product?: unknown;
129
+ vehiculeModelName?: string;
130
+ vehiculePlate?: string;
131
+ modelId?: string;
132
+ userId?: string;
133
+ withoutTaxAmountForDriving?: number;
134
+ withoutTaxAmountForStopover?: number;
135
+ withoutTaxAmountForBooking?: number;
136
+ withoutTaxForOvermileage?: number;
137
+ withoutTaxAmountForStartZoneFee?: number;
138
+ withoutTaxAmountForEndZoneFee?: number;
139
+ withoutTaxAmountForCancellationFee?: number;
140
+ withoutTaxAmountForScheduleTripFee?: number;
141
+ withoutTaxAmountForTripSystemCredit?: number;
142
+ withoutTaxAmountForBillingGroupDiscount?: number | null;
143
+ withTaxAmountForDriving?: number;
144
+ withTaxAmountForStopover?: number;
145
+ withTaxAmountForBooking?: number;
146
+ withTaxForOvermileage?: number;
147
+ withTaxAmountForStartZoneFee?: number;
148
+ withTaxAmountForEndZoneFee?: number;
149
+ withTaxAmountForCancellationFee?: number;
150
+ withTaxAmountForScheduleTripFee?: number;
151
+ withTaxAmountForTripSystemCredit?: number;
152
+ withTaxAmountForBillingGroupDiscount?: number;
153
+ withoutTaxInitialTotalAmount?: number;
154
+ withTaxInitialTotalAmount?: number;
155
+ taxInitialTotalAmount?: number;
156
+ paymentMethodType?: string;
157
+ walletId?: string | null;
158
+ totalTaxAmount?: number;
159
+ totalWithTax?: number;
160
+ totalWithoutTax?: number;
161
+ taxRate?: number;
162
+ taxName?: string;
163
+ withoutTaxAmountRideCost?: number;
164
+ withTaxAmountRideCost?: number;
165
+ taxAmountRideCost?: number;
166
+ products?: unknown[];
167
+ taxesPerRate?: unknown;
168
+ serviceId?: string | null;
169
+ profileId?: string | null;
170
+ profileType?: string | null;
171
+ profileName?: string | null;
172
+ withoutTaxUnlockFee?: number;
173
+ withTaxUnlockFee?: number;
174
+ taxUnlockFee?: number;
175
+ withTaxRefundAmount?: number | null;
176
+ isRefunded?: boolean;
177
+ cityName?: string | null;
178
+ cityId?: string | null;
179
+ tripBillingBreakdown?: unknown;
180
+ pricingId?: string;
181
+ netJourney?: number;
182
+ taxJourney?: number;
183
+ grossJourney?: number;
184
+ durationJourney?: number;
185
+ taxRemainingToBePaid?: number;
186
+ grossRemainingToBePaid?: number;
187
+ netRemainingToBePaid?: number;
188
+ overriddenTripInfo?: unknown;
189
+ interrupted?: boolean;
190
+ interruptedReason?: string | null;
191
+ invoice?: unknown;
192
+ distanceUnit?: string;
193
+ isTaxIncluded?: boolean;
194
+ [key: string]: unknown;
195
+ };
196
+ /** Response shape of GET .../trips/:tripId/invoices */
197
+ type InvoicesByTripIdResponse = {
198
+ balance: number;
199
+ userId: string;
200
+ entityId: string;
201
+ Billing: TripBillingItem[];
202
+ };
125
203
  type Wallet = {
126
204
  initialAmount: number;
127
205
  validityStartDate: string;
@@ -157,7 +235,7 @@ declare const getInvoiceById: (client: Client, id: string) => Promise<Invoice>;
157
235
  declare const getInvoicePdf: (client: Client, invoiceId: string) => Promise<ArrayBuffer | null>;
158
236
  //#endregion
159
237
  //#region src/getInvoicesByTripId.d.ts
160
- declare const getInvoicesByTripId: (client: Client, tripId: string) => Promise<Invoice[]>;
238
+ declare const getInvoicesByTripId: (client: Client, tripId: string) => Promise<InvoicesByTripIdResponse>;
161
239
  //#endregion
162
240
  //#region src/getRefundableAmount.d.ts
163
241
  declare const getRefundableAmount: (client: Client, invoiceId: string) => Promise<RefundableAmount>;
@@ -182,4 +260,4 @@ declare const updateWallet: (client: Client, walletId: string, actions: PatchAct
182
260
  //#region src/payInvoice.d.ts
183
261
  declare const payInvoice: (client: Client, invoiceId: string, manualPayment: ManualPayment) => Promise<Invoice>;
184
262
  //#endregion
185
- export { ChargeProductInfo, Credit, Invoice, ManualPayment, Paths, Receipt, RefundableAmount, Wallet, addCredits, chargeProduct, getInvoiceById, getInvoicePdf, getInvoicesByTripId, getRefundableAmount, getUserCreditsByEntityId, getWalletsByEntity, payInvoice, refund, updateWallet };
263
+ export { ChargeProductInfo, Credit, Invoice, InvoicesByTripIdResponse, ManualPayment, Paths, Receipt, RefundableAmount, TripBillingItem, Wallet, addCredits, chargeProduct, getInvoiceById, getInvoicePdf, getInvoicesByTripId, getRefundableAmount, getUserCreditsByEntityId, getWalletsByEntity, payInvoice, refund, updateWallet };
package/dist/index.d.mts CHANGED
@@ -122,6 +122,84 @@ type RefundableAmount = {
122
122
  refundablePaymentReceipts: Receipt[];
123
123
  refundedPaymentReceipts: Receipt[];
124
124
  };
125
+ /** Billing line item returned by the trip invoices endpoint (nested in Billing array). */
126
+ type TripBillingItem = {
127
+ trip?: unknown;
128
+ product?: unknown;
129
+ vehiculeModelName?: string;
130
+ vehiculePlate?: string;
131
+ modelId?: string;
132
+ userId?: string;
133
+ withoutTaxAmountForDriving?: number;
134
+ withoutTaxAmountForStopover?: number;
135
+ withoutTaxAmountForBooking?: number;
136
+ withoutTaxForOvermileage?: number;
137
+ withoutTaxAmountForStartZoneFee?: number;
138
+ withoutTaxAmountForEndZoneFee?: number;
139
+ withoutTaxAmountForCancellationFee?: number;
140
+ withoutTaxAmountForScheduleTripFee?: number;
141
+ withoutTaxAmountForTripSystemCredit?: number;
142
+ withoutTaxAmountForBillingGroupDiscount?: number | null;
143
+ withTaxAmountForDriving?: number;
144
+ withTaxAmountForStopover?: number;
145
+ withTaxAmountForBooking?: number;
146
+ withTaxForOvermileage?: number;
147
+ withTaxAmountForStartZoneFee?: number;
148
+ withTaxAmountForEndZoneFee?: number;
149
+ withTaxAmountForCancellationFee?: number;
150
+ withTaxAmountForScheduleTripFee?: number;
151
+ withTaxAmountForTripSystemCredit?: number;
152
+ withTaxAmountForBillingGroupDiscount?: number;
153
+ withoutTaxInitialTotalAmount?: number;
154
+ withTaxInitialTotalAmount?: number;
155
+ taxInitialTotalAmount?: number;
156
+ paymentMethodType?: string;
157
+ walletId?: string | null;
158
+ totalTaxAmount?: number;
159
+ totalWithTax?: number;
160
+ totalWithoutTax?: number;
161
+ taxRate?: number;
162
+ taxName?: string;
163
+ withoutTaxAmountRideCost?: number;
164
+ withTaxAmountRideCost?: number;
165
+ taxAmountRideCost?: number;
166
+ products?: unknown[];
167
+ taxesPerRate?: unknown;
168
+ serviceId?: string | null;
169
+ profileId?: string | null;
170
+ profileType?: string | null;
171
+ profileName?: string | null;
172
+ withoutTaxUnlockFee?: number;
173
+ withTaxUnlockFee?: number;
174
+ taxUnlockFee?: number;
175
+ withTaxRefundAmount?: number | null;
176
+ isRefunded?: boolean;
177
+ cityName?: string | null;
178
+ cityId?: string | null;
179
+ tripBillingBreakdown?: unknown;
180
+ pricingId?: string;
181
+ netJourney?: number;
182
+ taxJourney?: number;
183
+ grossJourney?: number;
184
+ durationJourney?: number;
185
+ taxRemainingToBePaid?: number;
186
+ grossRemainingToBePaid?: number;
187
+ netRemainingToBePaid?: number;
188
+ overriddenTripInfo?: unknown;
189
+ interrupted?: boolean;
190
+ interruptedReason?: string | null;
191
+ invoice?: unknown;
192
+ distanceUnit?: string;
193
+ isTaxIncluded?: boolean;
194
+ [key: string]: unknown;
195
+ };
196
+ /** Response shape of GET .../trips/:tripId/invoices */
197
+ type InvoicesByTripIdResponse = {
198
+ balance: number;
199
+ userId: string;
200
+ entityId: string;
201
+ Billing: TripBillingItem[];
202
+ };
125
203
  type Wallet = {
126
204
  initialAmount: number;
127
205
  validityStartDate: string;
@@ -157,7 +235,7 @@ declare const getInvoiceById: (client: Client, id: string) => Promise<Invoice>;
157
235
  declare const getInvoicePdf: (client: Client, invoiceId: string) => Promise<ArrayBuffer | null>;
158
236
  //#endregion
159
237
  //#region src/getInvoicesByTripId.d.ts
160
- declare const getInvoicesByTripId: (client: Client, tripId: string) => Promise<Invoice[]>;
238
+ declare const getInvoicesByTripId: (client: Client, tripId: string) => Promise<InvoicesByTripIdResponse>;
161
239
  //#endregion
162
240
  //#region src/getRefundableAmount.d.ts
163
241
  declare const getRefundableAmount: (client: Client, invoiceId: string) => Promise<RefundableAmount>;
@@ -182,4 +260,4 @@ declare const updateWallet: (client: Client, walletId: string, actions: PatchAct
182
260
  //#region src/payInvoice.d.ts
183
261
  declare const payInvoice: (client: Client, invoiceId: string, manualPayment: ManualPayment) => Promise<Invoice>;
184
262
  //#endregion
185
- export { ChargeProductInfo, Credit, Invoice, ManualPayment, Paths, Receipt, RefundableAmount, Wallet, addCredits, chargeProduct, getInvoiceById, getInvoicePdf, getInvoicesByTripId, getRefundableAmount, getUserCreditsByEntityId, getWalletsByEntity, payInvoice, refund, updateWallet };
263
+ export { ChargeProductInfo, Credit, Invoice, InvoicesByTripIdResponse, ManualPayment, Paths, Receipt, RefundableAmount, TripBillingItem, Wallet, addCredits, chargeProduct, getInvoiceById, getInvoicePdf, getInvoicesByTripId, getRefundableAmount, getUserCreditsByEntityId, getWalletsByEntity, payInvoice, refund, updateWallet };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vulog/aima-billing",
3
3
  "type": "module",
4
- "version": "1.2.35",
4
+ "version": "1.2.37",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.cts",
@@ -22,7 +22,7 @@
22
22
  "dev": "tsdown --watch",
23
23
  "test": "vitest run",
24
24
  "test:watch": "vitest",
25
- "lint": "eslint src/**/* --ext .ts"
25
+ "lint": "eslint src/"
26
26
  },
27
27
  "keywords": [
28
28
  "AIMA",
@@ -32,8 +32,8 @@
32
32
  "author": "Vulog",
33
33
  "license": "MIT",
34
34
  "dependencies": {
35
- "@vulog/aima-client": "1.2.35",
36
- "@vulog/aima-core": "1.2.35"
35
+ "@vulog/aima-client": "1.2.37",
36
+ "@vulog/aima-core": "1.2.37"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "zod": "^3.25.76"
@@ -1,7 +1,7 @@
1
1
  import { describe, test, expect, vi, beforeEach } from 'vitest';
2
2
  import { Client } from '@vulog/aima-client';
3
3
  import { getInvoicesByTripId } from './getInvoicesByTripId';
4
- import type { Invoice } from './types';
4
+ import type { InvoicesByTripIdResponse } from './types';
5
5
 
6
6
  describe('getInvoicesByTripId', () => {
7
7
  const getMock = vi.fn();
@@ -29,27 +29,27 @@ describe('getInvoicesByTripId', () => {
29
29
  expect(getMock).not.toHaveBeenCalled();
30
30
  });
31
31
 
32
- test('calls GET with correct URL and returns invoices', async () => {
32
+ test('calls GET with correct URL and returns trip billing response', async () => {
33
33
  const tripId = 'BEBD00056A9A16103D418CC36D940E26';
34
- const invoices: Invoice[] = [
35
- {
36
- id: '66bcbd77-37ef-47bd-b9af-877e5d213b8f',
37
- sequence: 1,
38
- userId: '20fb98a3-b60d-491a-9359-62e55f51fcb9',
39
- invoiceDate: '2026-03-03',
40
- updateDate: '2026-03-03T09:46:50Z',
41
- fleetId: 'FLEET_ID',
42
- invoiceYear: 2026,
43
- invoicesStatus: 'PAID',
44
- amount: 100,
45
- currency: 'EUR',
46
- entityId: 'entity-1',
47
- attempts: 0,
48
- pspReference: 'ref-1',
49
- withTaxRefundAmount: 0,
50
- },
51
- ];
52
- getMock.mockResolvedValueOnce({ data: invoices });
34
+ const response: InvoicesByTripIdResponse = {
35
+ balance: 499.99,
36
+ userId: '20fb98a3-b60d-491a-9359-62e55f51fcb9',
37
+ entityId: 'ba0b4e0b-ff0a-49f5-8e98-065b54355df9',
38
+ Billing: [
39
+ {
40
+ vehiculeModelName: 'Yaris_Subs',
41
+ vehiculePlate: 'Yaris_Abo_001',
42
+ modelId: '1754',
43
+ userId: '20fb98a3-b60d-491a-9359-62e55f51fcb9',
44
+ withTaxInitialTotalAmount: 499.99,
45
+ totalWithTax: 499.99,
46
+ pricingId: '96e1fff7-d422-4181-8e19-1b2759b2f073',
47
+ distanceUnit: 'KM',
48
+ isTaxIncluded: true,
49
+ },
50
+ ],
51
+ };
52
+ getMock.mockResolvedValueOnce({ data: response });
53
53
 
54
54
  const result = await getInvoicesByTripId(client, tripId);
55
55
 
@@ -57,17 +57,25 @@ describe('getInvoicesByTripId', () => {
57
57
  expect(getMock).toHaveBeenCalledWith(
58
58
  `/boapi/proxy/billing/fleets/FLEET_ID/trips/${tripId}/invoices`
59
59
  );
60
- expect(result).toEqual(invoices);
61
- expect(result).toHaveLength(1);
62
- expect(result[0].id).toBe(invoices[0].id);
60
+ expect(result).toEqual(response);
61
+ expect(result.balance).toBe(499.99);
62
+ expect(result.Billing).toHaveLength(1);
63
+ expect(result.Billing[0].vehiculeModelName).toBe('Yaris_Subs');
63
64
  });
64
65
 
65
- test('returns empty array when no invoices', async () => {
66
+ test('returns response with empty Billing array when no billing items', async () => {
66
67
  const tripId = 'some-trip-id';
67
- getMock.mockResolvedValueOnce({ data: [] });
68
+ const response: InvoicesByTripIdResponse = {
69
+ balance: 0,
70
+ userId: 'user-id',
71
+ entityId: 'entity-id',
72
+ Billing: [],
73
+ };
74
+ getMock.mockResolvedValueOnce({ data: response });
68
75
 
69
76
  const result = await getInvoicesByTripId(client, tripId);
70
77
 
71
- expect(result).toEqual([]);
78
+ expect(result).toEqual(response);
79
+ expect(result.Billing).toEqual([]);
72
80
  });
73
81
  });
@@ -1,9 +1,9 @@
1
1
  import { Client } from '@vulog/aima-client';
2
2
  import { z } from 'zod';
3
3
 
4
- import { Invoice } from './types';
4
+ import { InvoicesByTripIdResponse } from './types';
5
5
 
6
- export const getInvoicesByTripId = async (client: Client, tripId: string): Promise<Invoice[]> => {
6
+ export const getInvoicesByTripId = async (client: Client, tripId: string): Promise<InvoicesByTripIdResponse> => {
7
7
  const result = z.string().trim().min(1).safeParse(tripId);
8
8
  if (!result.success) {
9
9
  throw new TypeError('Invalid args', {
@@ -12,6 +12,8 @@ export const getInvoicesByTripId = async (client: Client, tripId: string): Promi
12
12
  }
13
13
 
14
14
  return client
15
- .get<Invoice[]>(`/boapi/proxy/billing/fleets/${client.clientOptions.fleetId}/trips/${result.data}/invoices`)
15
+ .get<InvoicesByTripIdResponse>(
16
+ `/boapi/proxy/billing/fleets/${client.clientOptions.fleetId}/trips/${result.data}/invoices`
17
+ )
16
18
  .then(({ data }) => data);
17
19
  };
package/src/refund.ts CHANGED
@@ -24,7 +24,6 @@ export const refund = async (client: Client, payload: Payload): Promise<void> =>
24
24
  }
25
25
 
26
26
  const filteredData = Object.fromEntries(
27
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
28
27
  Object.entries(result.data).filter(([_, value]) => value !== undefined && value !== null)
29
28
  );
30
29
 
package/src/types.ts CHANGED
@@ -135,6 +135,86 @@ export type RefundableAmount = {
135
135
  refundedPaymentReceipts: Receipt[];
136
136
  };
137
137
 
138
+ /** Billing line item returned by the trip invoices endpoint (nested in Billing array). */
139
+ export type TripBillingItem = {
140
+ trip?: unknown;
141
+ product?: unknown;
142
+ vehiculeModelName?: string;
143
+ vehiculePlate?: string;
144
+ modelId?: string;
145
+ userId?: string;
146
+ withoutTaxAmountForDriving?: number;
147
+ withoutTaxAmountForStopover?: number;
148
+ withoutTaxAmountForBooking?: number;
149
+ withoutTaxForOvermileage?: number;
150
+ withoutTaxAmountForStartZoneFee?: number;
151
+ withoutTaxAmountForEndZoneFee?: number;
152
+ withoutTaxAmountForCancellationFee?: number;
153
+ withoutTaxAmountForScheduleTripFee?: number;
154
+ withoutTaxAmountForTripSystemCredit?: number;
155
+ withoutTaxAmountForBillingGroupDiscount?: number | null;
156
+ withTaxAmountForDriving?: number;
157
+ withTaxAmountForStopover?: number;
158
+ withTaxAmountForBooking?: number;
159
+ withTaxForOvermileage?: number;
160
+ withTaxAmountForStartZoneFee?: number;
161
+ withTaxAmountForEndZoneFee?: number;
162
+ withTaxAmountForCancellationFee?: number;
163
+ withTaxAmountForScheduleTripFee?: number;
164
+ withTaxAmountForTripSystemCredit?: number;
165
+ withTaxAmountForBillingGroupDiscount?: number;
166
+ withoutTaxInitialTotalAmount?: number;
167
+ withTaxInitialTotalAmount?: number;
168
+ taxInitialTotalAmount?: number;
169
+ paymentMethodType?: string;
170
+ walletId?: string | null;
171
+ totalTaxAmount?: number;
172
+ totalWithTax?: number;
173
+ totalWithoutTax?: number;
174
+ taxRate?: number;
175
+ taxName?: string;
176
+ withoutTaxAmountRideCost?: number;
177
+ withTaxAmountRideCost?: number;
178
+ taxAmountRideCost?: number;
179
+ products?: unknown[];
180
+ taxesPerRate?: unknown;
181
+ serviceId?: string | null;
182
+ profileId?: string | null;
183
+ profileType?: string | null;
184
+ profileName?: string | null;
185
+ withoutTaxUnlockFee?: number;
186
+ withTaxUnlockFee?: number;
187
+ taxUnlockFee?: number;
188
+ withTaxRefundAmount?: number | null;
189
+ isRefunded?: boolean;
190
+ cityName?: string | null;
191
+ cityId?: string | null;
192
+ tripBillingBreakdown?: unknown;
193
+ pricingId?: string;
194
+ netJourney?: number;
195
+ taxJourney?: number;
196
+ grossJourney?: number;
197
+ durationJourney?: number;
198
+ taxRemainingToBePaid?: number;
199
+ grossRemainingToBePaid?: number;
200
+ netRemainingToBePaid?: number;
201
+ overriddenTripInfo?: unknown;
202
+ interrupted?: boolean;
203
+ interruptedReason?: string | null;
204
+ invoice?: unknown;
205
+ distanceUnit?: string;
206
+ isTaxIncluded?: boolean;
207
+ [key: string]: unknown;
208
+ };
209
+
210
+ /** Response shape of GET .../trips/:tripId/invoices */
211
+ export type InvoicesByTripIdResponse = {
212
+ balance: number;
213
+ userId: string;
214
+ entityId: string;
215
+ Billing: TripBillingItem[];
216
+ };
217
+
138
218
  export type Wallet = {
139
219
  initialAmount: number;
140
220
  validityStartDate: string;
package/.eslintrc.cjs DELETED
@@ -1,112 +0,0 @@
1
- module.exports = {
2
- parser: '@typescript-eslint/parser',
3
- parserOptions: {
4
- // Indicates the location of the TypeScript configuration file
5
- project: 'tsconfig.json',
6
- // Sets the root directory for the TypeScript configuration
7
- tsconfigRootDir: __dirname,
8
- // Specifies the version of ECMAScript syntax to be used
9
- ecmaVersion: 'latest',
10
- // Indicates the type of source code (script or module)
11
- sourceType: 'module',
12
- },
13
- plugins: ['@typescript-eslint', 'prettier', 'import'],
14
- extends: [
15
- 'airbnb-base',
16
- 'airbnb-typescript/base',
17
- 'plugin:@typescript-eslint/recommended',
18
- 'prettier',
19
- 'plugin:prettier/recommended',
20
- ],
21
- root: true,
22
- env: {
23
- es6: true,
24
- node: true,
25
- },
26
- ignorePatterns: [
27
- '/dist/**/*', // Ignore built files.
28
- '.eslintrc.js',
29
- '**/*.test.ts',
30
- ],
31
- rules: {
32
- // Configures the Prettier integration with ESLint
33
- 'prettier/prettier': ['error', { endOfLine: 'auto' }],
34
- // Disables the rule requiring an 'I' prefix for interfaces
35
- '@typescript-eslint/interface-name-prefix': 'off',
36
- // Configures the naming conventions for various code constructs
37
- '@typescript-eslint/naming-convention': [
38
- // ... various naming convention configurations ...
39
- 'error',
40
- // Allows any naming format for destructured variables
41
- {
42
- selector: 'variable',
43
- modifiers: ['destructured'],
44
- format: null,
45
- },
46
- // Requires strict camelCase for function names
47
- {
48
- selector: 'function',
49
- format: ['strictCamelCase'],
50
- },
51
- // Requires boolean variables to have one of the specified prefixes
52
- {
53
- selector: 'variable',
54
- format: null,
55
- types: ['boolean'],
56
- prefix: ['is', 'should', 'has', 'can', 'did', 'will'],
57
- },
58
- // Requires enum names to have a strict PascalCase format
59
- {
60
- selector: 'enum',
61
- format: ['StrictPascalCase'],
62
- },
63
- ],
64
- 'import/extensions': 'off',
65
- // Disables the rule requiring explicit return types for functions
66
- '@typescript-eslint/explicit-function-return-type': 'off',
67
- // Disables the rule requiring explicit boundary types for modules
68
- '@typescript-eslint/explicit-module-boundary-types': 'off',
69
- // Disables the rule prohibiting the use of 'any' type
70
- '@typescript-eslint/no-explicit-any': 'off',
71
- // Disables the rule detecting unused variables
72
- 'no-unused-vars': 0,
73
- // Disables the rule disallowing named exports used as a default export
74
- 'import/no-named-as-default': 0,
75
- // Configures the order and formatting of import statements
76
- 'import/order': [
77
- // ... import order configuration ...
78
- 'error',
79
- {
80
- // Configure the alphabetization settings
81
- alphabetize: {
82
- // Enforce ascending alphabetical order
83
- order: 'asc',
84
- // Do not ignore the case while sorting
85
- caseInsensitive: false,
86
- },
87
- // Enforce newlines between different groups and inside groups of imports
88
- 'newlines-between': 'always-and-inside-groups',
89
- // Warn when there is an import statement that is not part of any group
90
- warnOnUnassignedImports: true,
91
- },
92
- ],
93
- // Configures the rule detecting extraneous dependencies
94
- 'import/no-extraneous-dependencies': [
95
- // ... extraneous dependencies configuration ...
96
- 'error',
97
- {
98
- // Specify the file patterns where devDependencies imports are allowed
99
- devDependencies: [
100
- // Allow devDependencies imports in test and spec files
101
- '**/*.test.{ts,js}',
102
- '**/*.spec.{ts,js}',
103
- // Allow devDependencies imports in the 'test' folder
104
- './test/**.{ts,js}',
105
- // Allow devDependencies imports in the 'scripts' folder
106
- './scripts/**/*.{ts,js}',
107
- ],
108
- },
109
- ],
110
- 'import/prefer-default-export': 'off',
111
- },
112
- };