Skip to content

Commit

Permalink
Fix linting, better handling of the blockModel flag
Browse files Browse the repository at this point in the history
  • Loading branch information
sneridagh committed Apr 24, 2024
1 parent f22c082 commit be12131
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
13 changes: 12 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
const fs = require('fs');
const projectRootPath = __dirname;

const eslintPath = 'core/packages/volto/.eslintrc';

let eslintCoreVoltoConfigFile;
if (fs.existsSync(`${projectRootPath}/${eslintPath}`))
eslintCoreVoltoConfigFile = `${projectRootPath}/${eslintPath}`;
else if (fs.existsSync(`${projectRootPath}/../../${eslintPath}`))
eslintCoreVoltoConfigFile = `${projectRootPath}/../../${eslintPath}`;

module.exports = {
extends: './core/packages/volto/.eslintrc',
extends: eslintCoreVoltoConfigFile,
rules: {
'import/no-unresolved': 1,
},
Expand Down
3 changes: 1 addition & 2 deletions packages/volto-button-block/src/components/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Button } from 'semantic-ui-react';
import cx from 'classnames';
import { ConditionalLink, MaybeWrap } from '@plone/volto/components';
import { defineMessages, useIntl } from 'react-intl';
import config from '@plone/volto/registry';

const messages = defineMessages({
ButtonText: {
Expand All @@ -21,7 +20,7 @@ const LegacyWrapper = (props) => (
const View = ({ data, isEditMode, className, blocksConfig }) => {
const [hasLink, setHasLink] = React.useState(false);
const intl = useIntl();
const isBlockModelv3 = blocksConfig?.__button?.v3;
const isBlockModelv3 = blocksConfig?.__button?.blockModel === 3;

React.useEffect(() => {
if (data.href) {
Expand Down

0 comments on commit be12131

Please sign in to comment.