Skip to content

Commit

Permalink
Fixes imports to avoid type errors in addons tests
Browse files Browse the repository at this point in the history
When we shadow a module in an addon and this module is imported
relatively in some .ts file used in the addon tests, we receive the
error:

Could not find a declaration file for module './Module'. '../Module.jsx'
implicitly has an 'any' type

So we use absolute import in .ts files to avoid this problem.
  • Loading branch information
wesleybl committed Aug 8, 2024
1 parent eb611a8 commit f6c77c7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/volto/news/6244.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixes imports to avoid type errors in addons tests. @wesleybl
2 changes: 1 addition & 1 deletion packages/volto/src/helpers/Blocks/cloneBlocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
getBlocksFieldname,
getBlocksLayoutFieldname,
hasBlocksData,
} from './Blocks';
} from '@plone/volto/helpers/Blocks/Blocks';
import config from '@plone/registry';

export function cloneBlocks(blocksData) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { map, keys, intersection, isEmpty } from 'lodash';
import { messages } from '../MessageLabels/MessageLabels';
import { messages } from '@plone/volto/helpers/MessageLabels/MessageLabels';
import config from '@plone/volto/registry';
import { toast } from 'react-toastify';
import Toast from '@plone/volto/components/manage/Toast/Toast';
Expand Down
2 changes: 1 addition & 1 deletion packages/volto/src/helpers/FormValidation/validators.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { validationMessage } from './FormValidation';
import { validationMessage } from '@plone/volto/helpers/FormValidation/FormValidation';
import { messages } from '@plone/volto/helpers/MessageLabels/MessageLabels';

type MinMaxValidator = {
Expand Down

0 comments on commit f6c77c7

Please sign in to comment.