Fix js package lint errors
This commit is contained in:
parent
2c5c7549b5
commit
d45606293c
|
@ -47,7 +47,7 @@ async function deactivateAndDeletePlugin( pluginName: string ) {
|
|||
}
|
||||
export async function deactivateAndDeleteAllPlugins( except: string[] = [] ) {
|
||||
let plugins = await getPlugins();
|
||||
let skippedPlugins = [];
|
||||
const skippedPlugins = [];
|
||||
const promises = [];
|
||||
for ( const plugin of plugins ) {
|
||||
const splitPluginName = plugin.plugin.split( '/' );
|
||||
|
|
|
@ -18,7 +18,9 @@ export class ThemeSection extends BasePage {
|
|||
const title = await waitForElementByText( 'h2', themeTitle );
|
||||
const chooseButton = await title?.evaluateHandle( ( element ) => {
|
||||
const card = element.closest( '.components-card' );
|
||||
return Array.from( card?.querySelectorAll('button') || [] ).find( el => el.textContent === 'Choose');
|
||||
return Array.from( card?.querySelectorAll( 'button' ) || [] ).find(
|
||||
( el ) => el.textContent === 'Choose'
|
||||
);
|
||||
} );
|
||||
if ( chooseButton ) {
|
||||
await chooseButton.asElement()?.click();
|
||||
|
|
|
@ -12,56 +12,44 @@ const { options: babelDefaultConfig } = babel.loadPartialConfig( {
|
|||
} );
|
||||
const plugins = babelDefaultConfig.plugins;
|
||||
if ( ! process.env.SKIP_JSX_PRAGMA_TRANSFORM ) {
|
||||
plugins.push( [ '@wordpress/babel-plugin-import-jsx-pragma', {
|
||||
scopeVariable: 'createElement',
|
||||
source: '@wordpress/element',
|
||||
isDefault: false,
|
||||
} ] );
|
||||
plugins.push( [
|
||||
'@wordpress/babel-plugin-import-jsx-pragma',
|
||||
{
|
||||
scopeVariable: 'createElement',
|
||||
source: '@wordpress/element',
|
||||
isDefault: false,
|
||||
},
|
||||
] );
|
||||
}
|
||||
|
||||
const overrideOptions = ( target, targetName, options ) => {
|
||||
if ( get( target, [ 'file', 'request' ] ) === targetName ) {
|
||||
return [ targetName, Object.assign(
|
||||
{},
|
||||
target.options,
|
||||
options
|
||||
) ];
|
||||
return [ targetName, Object.assign( {}, target.options, options ) ];
|
||||
}
|
||||
return target;
|
||||
};
|
||||
|
||||
const babelConfigs = {
|
||||
main: Object.assign(
|
||||
{},
|
||||
babelDefaultConfig,
|
||||
{
|
||||
plugins,
|
||||
presets: map(
|
||||
babelDefaultConfig.presets,
|
||||
( preset ) => overrideOptions( preset, '@babel/preset-env', {
|
||||
modules: 'commonjs',
|
||||
} )
|
||||
),
|
||||
}
|
||||
),
|
||||
module: Object.assign(
|
||||
{},
|
||||
babelDefaultConfig,
|
||||
{
|
||||
plugins: map(
|
||||
plugins,
|
||||
( plugin ) => overrideOptions( plugin, '@babel/plugin-transform-runtime', {
|
||||
useESModules: true,
|
||||
} )
|
||||
),
|
||||
presets: map(
|
||||
babelDefaultConfig.presets,
|
||||
( preset ) => overrideOptions( preset, '@babel/preset-env', {
|
||||
modules: false,
|
||||
} )
|
||||
),
|
||||
}
|
||||
),
|
||||
main: Object.assign( {}, babelDefaultConfig, {
|
||||
plugins,
|
||||
presets: map( babelDefaultConfig.presets, ( preset ) =>
|
||||
overrideOptions( preset, '@babel/preset-env', {
|
||||
modules: 'commonjs',
|
||||
} )
|
||||
),
|
||||
} ),
|
||||
module: Object.assign( {}, babelDefaultConfig, {
|
||||
plugins: map( plugins, ( plugin ) =>
|
||||
overrideOptions( plugin, '@babel/plugin-transform-runtime', {
|
||||
useESModules: true,
|
||||
} )
|
||||
),
|
||||
presets: map( babelDefaultConfig.presets, ( preset ) =>
|
||||
overrideOptions( preset, '@babel/preset-env', {
|
||||
modules: false,
|
||||
} )
|
||||
),
|
||||
} ),
|
||||
};
|
||||
|
||||
function getBabelConfig( environment ) {
|
||||
|
|
|
@ -26,7 +26,6 @@ const getRequestQueryString = ( {
|
|||
* args.experimentName = 'my-experiment';
|
||||
* return args;
|
||||
* });
|
||||
*
|
||||
*/
|
||||
return stringify(
|
||||
applyFilters( 'woocommerce_explat_request_args', {
|
||||
|
|
Loading…
Reference in New Issue