Skip to content

Commit

Permalink
chore(lint): enforce export type
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffladiray committed Dec 20, 2024
1 parent a29d46b commit 891fa09
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 17 deletions.
5 changes: 4 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ module.exports = {

// padding around describe and tests
"jest-formatting/padding-around-describe-blocks": 2,
"jest-formatting/padding-around-test-blocks": 2
"jest-formatting/padding-around-test-blocks": 2,

// Enforce export type when needed
'@typescript-eslint/consistent-type-exports': 'error',
},
overrides: [
...readdirSync(resolve(__dirname, 'packages'))
Expand Down
2 changes: 1 addition & 1 deletion packages/agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function createAgent<S extends TSchema = TSchema>(options: AgentOptions):
}

export { Agent };
export { AgentOptions } from './types';
export type { AgentOptions } from './types';
export * from '@forestadmin/datasource-customizer';

// export is necessary for the agent-generator package
Expand Down
12 changes: 6 additions & 6 deletions packages/datasource-customizer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ export * from './types';
// Decorators (helpers)
export * from './decorators/actions/types/actions';
export * from './decorators/actions/types/fields';
export { DataSourceChartDefinition } from './decorators/chart/types';
export { ComputedDefinition } from './decorators/computed/types';
export { OperatorDefinition } from './decorators/operators-emulate/types';
export { RelationDefinition } from './decorators/relation/types';
export { SearchDefinition } from './decorators/search/types';
export { SegmentDefinition } from './decorators/segment/types';
export type { DataSourceChartDefinition } from './decorators/chart/types';
export type { ComputedDefinition } from './decorators/computed/types';
export type { OperatorDefinition } from './decorators/operators-emulate/types';
export type { RelationDefinition } from './decorators/relation/types';
export type { SearchDefinition } from './decorators/search/types';
export type { SegmentDefinition } from './decorators/segment/types';
export * from './decorators/write/write-replace/types';
export * from './decorators/hook/types';
export * from './decorators/override/types';
Expand Down
2 changes: 1 addition & 1 deletion packages/datasource-toolkit/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export * from './interfaces/query/sort';
export * from './interfaces/query/page';
export * from './interfaces/record';
export * from './interfaces/schema';
export {
export type {
GenericTree,
GenericTreeBranch,
GenericTreeLeaf,
Expand Down
2 changes: 1 addition & 1 deletion packages/forest-cloud/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ import type { ConnectionOptions } from '@forestadmin/datasource-sql';

import { Agent } from './types';

export { Agent };
export type { Agent };
export type { ConnectionParams as MongoConnectionParams, ConnectionOptions as SqlConnectionParams };
12 changes: 6 additions & 6 deletions packages/forestadmin-client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export { default as JTWUnableToVerifyError } from './permissions/errors/jwt-unab
export { default as ChainedSQLQueryError } from './permissions/errors/chained-sql-query-error';
export { default as EmptySQLQueryError } from './permissions/errors/empty-sql-query-error';
export { default as NonSelectSQLQueryError } from './permissions/errors/non-select-sql-query-error';
export {
export type {
ForestAdminClientOptions,
Logger,
LoggerLevel,
Expand All @@ -19,16 +19,16 @@ export {
RawTreeWithSources,
ForestAdminServerInterface,
} from './types';
export { IpWhitelistConfiguration } from './ip-whitelist/types';
export type { IpWhitelistConfiguration } from './ip-whitelist/types';

// These types are used for the agent-generator package
export {
CollectionActionEvent,
export type {
EnvironmentPermissionsV4,
RenderingPermissionV4,
UserPermissionV4,
} from './permissions/types';
export { UserInfo } from './auth/types';
export { CollectionActionEvent } from './permissions/types';
export type { UserInfo } from './auth/types';

export default function createForestAdminClient(
options: ForestAdminClientOptions,
Expand Down Expand Up @@ -71,7 +71,7 @@ export { default as ContextVariables } from './utils/context-variables';
export { default as ChartHandler } from './charts/chart-handler';
export { default as ForestAdminClientWithCache } from './forest-admin-client-with-cache';
export { default as buildApplicationServices } from './build-application-services';
export { HttpOptions } from './permissions/forest-http-api';
export type { HttpOptions } from './permissions/forest-http-api';
export { default as ForestHttpApi } from './permissions/forest-http-api';
// export is necessary for the agent-generator package
export { default as SchemaService } from './schema';
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-aws-s3/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import replaceField from './field/replace-field';
import { File, Options } from './types';
import Client from './utils/s3';

export { Options, File };
export type { Options, File };

export async function createFileField<
S extends TSchema = TSchema,
Expand Down

0 comments on commit 891fa09

Please sign in to comment.