Skip to content

Commit

Permalink
Fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed May 13, 2024
1 parent 661ed59 commit 3980ff3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
16 changes: 7 additions & 9 deletions packages/interactivity/src/directives.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,15 +242,13 @@ export default () => {
if ( defaultEntry ) {
const { namespace, value } = defaultEntry;
// Check that the value is a JSON object. Send a console warning if not.
if (
typeof SCRIPT_DEBUG !== 'undefined' &&
SCRIPT_DEBUG === true &&
! isPlainObject( value )
) {
// eslint-disable-next-line no-console
console.warn(
`The value of data-wp-context in "${ namespace }" store must be a valid stringified JSON object.`
);
if ( globalThis.SCRIPT_DEBUG ) {
if ( ! isPlainObject( value ) ) {
// eslint-disable-next-line no-console
console.warn(
`The value of data-wp-context in "${ namespace }" store must be a valid stringified JSON object.`
);
}
}
updateSignals( currentValue.current, {
[ namespace ]: deepClone( value ),
Expand Down
7 changes: 1 addition & 6 deletions packages/interactivity/src/vdom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,7 @@ export function toVdom( root ) {
( obj, [ name, ns, value ] ) => {
const directiveMatch = directiveParser.exec( name );
if ( directiveMatch === null ) {
if (
// @ts-expect-error This is a debug-only warning.
typeof SCRIPT_DEBUG !== 'undefined' &&
// @ts-expect-error This is a debug-only warning.
SCRIPT_DEBUG === true
) {
if ( globalThis.SCRIPT_DEBUG ) {
// eslint-disable-next-line no-console
console.warn( `Invalid directive: ${ name }.` );
}
Expand Down

0 comments on commit 3980ff3

Please sign in to comment.