Skip to content

Commit

Permalink
Merge pull request #6219 from wordpress-mobile/update/bump-eslint-and…
Browse files Browse the repository at this point in the history
…-prettier

Bump ESLint and Prettier packages to match versions in Gutenberg
  • Loading branch information
fluiddot authored Sep 25, 2023
2 parents 2e52634 + ce76b2d commit 0da94bf
Show file tree
Hide file tree
Showing 14 changed files with 2,124 additions and 1,747 deletions.
29 changes: 13 additions & 16 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,28 @@
module.exports = {
parser: "babel-eslint",
parser: 'babel-eslint',
env: {
browser: true,
"jest/globals": true
'jest/globals': true,
},
globals: {
__DEV__: true
__DEV__: true,
},
plugins: [
"react",
"react-native",
"jest",
],
extends: [
"plugin:@wordpress/eslint-plugin/recommended",
],
plugins: [ 'react', 'react-native', 'jest' ],
extends: [ 'plugin:@wordpress/eslint-plugin/recommended' ],
settings: {
'import/resolver': {
'node': {
'moduleDirectory': ['node_modules', 'gutenberg/node_modules']
}
node: {
moduleDirectory: [ 'node_modules', 'gutenberg/node_modules' ],
},
},
},
rules: {
// do not throw an error if imported dependencies are
// do not throw an error if imported dependencies are
// declared in `package.json` or `gutenberg/package.json`
"import/no-extraneous-dependencies": ["error", {"packageDir": ['.', './gutenberg/']}]
'import/no-extraneous-dependencies': [
'error',
{ packageDir: [ '.', './gutenberg/' ] },
],
},
overrides: [
{
Expand Down
3 changes: 2 additions & 1 deletion __device-tests__/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module.exports = {
extends: '../gutenberg/packages/react-native-editor/__device-tests__/.eslintrc.js',
extends:
'../gutenberg/packages/react-native-editor/__device-tests__/.eslintrc.js',
};
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@ describe( 'Gutenberg Editor - Test Suite 1', () => {
await editorPage.driver
.elementByAccessibilityId( 'Column Block. Row 1' )
.click();
const appenderButton = await editorPage.waitForElementToBeDisplayedByXPath(
ANDROID_COLUMN_APPENDER_BUTTON_XPATH
);
const appenderButton =
await editorPage.waitForElementToBeDisplayedByXPath(
ANDROID_COLUMN_APPENDER_BUTTON_XPATH
);
await appenderButton.click();
} else {
await editorPage.driver
Expand Down Expand Up @@ -122,9 +123,10 @@ describe( 'Gutenberg Editor - Test Suite 1', () => {
await editorPage.driver
.elementByAccessibilityId( 'Column Block. Row 1' )
.click();
const appenderButton = await editorPage.waitForElementToBeDisplayedByXPath(
ANDROID_COLUMN_APPENDER_BUTTON_XPATH
);
const appenderButton =
await editorPage.waitForElementToBeDisplayedByXPath(
ANDROID_COLUMN_APPENDER_BUTTON_XPATH
);
await appenderButton.click();
} else {
await editorPage.driver
Expand Down Expand Up @@ -183,9 +185,10 @@ describe( 'Gutenberg Editor - Test Suite 1', () => {
await editorPage.driver
.elementByAccessibilityId( 'Column Block. Row 1' )
.click();
const appenderButton = await editorPage.waitForElementToBeDisplayedByXPath(
ANDROID_COLUMN_APPENDER_BUTTON_XPATH
);
const appenderButton =
await editorPage.waitForElementToBeDisplayedByXPath(
ANDROID_COLUMN_APPENDER_BUTTON_XPATH
);
await appenderButton.click();
} else {
await editorPage.driver
Expand Down Expand Up @@ -237,9 +240,8 @@ describe( 'Gutenberg Editor - Test Suite 1', () => {
await editorPage.driver.sleep( 3000 );

const cellId = 'Column 1. Width is 50 Percent (%).';
const cell = await editorPage.driver.elementByAccessibilityId(
cellId
);
const cell =
await editorPage.driver.elementByAccessibilityId( cellId );
const cellSize = await cell.getSize();
const cellLocation = await cell.getLocation();
const scrollOffset = isAndroid() ? 350 : 100;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ describe( 'Gutenberg Editor - Test Suite 4', () => {
);

// Get button's block TextInput
const buttonBlockTextInput = await editorPage.getButtonBlockTextInputAtPosition();
const buttonBlockTextInput =
await editorPage.getButtonBlockTextInputAtPosition();
await buttonBlockTextInput.click();
await selectTextFromElement(
editorPage.driver,
Expand All @@ -139,7 +140,8 @@ describe( 'Gutenberg Editor - Test Suite 4', () => {
await editorPage.initializeEditor();
await editorPage.addNewBlock( blockNames.buttons );

const firstButtonTextInput = await editorPage.getButtonBlockTextInputAtPosition();
const firstButtonTextInput =
await editorPage.getButtonBlockTextInputAtPosition();
await editorPage.typeTextToTextBlock(
firstButtonTextInput,
e2eTestData.listItem2
Expand All @@ -154,9 +156,8 @@ describe( 'Gutenberg Editor - Test Suite 4', () => {

// Add a second button block
await editorPage.addButtonWithInlineAppender( 2 );
const secondButtonTextInput = await editorPage.getButtonBlockTextInputAtPosition(
2
);
const secondButtonTextInput =
await editorPage.getButtonBlockTextInputAtPosition( 2 );
await editorPage.typeTextToTextBlock(
secondButtonTextInput,
e2eTestData.listItem2
Expand All @@ -171,9 +172,8 @@ describe( 'Gutenberg Editor - Test Suite 4', () => {

// Add a third button block
await editorPage.addButtonWithInlineAppender( 3 );
const thirdButtonTextInput = await editorPage.getButtonBlockTextInputAtPosition(
3
);
const thirdButtonTextInput =
await editorPage.getButtonBlockTextInputAtPosition( 3 );
await editorPage.typeTextToTextBlock(
thirdButtonTextInput,
e2eTestData.listItem2
Expand Down Expand Up @@ -208,7 +208,8 @@ describe( 'Gutenberg Editor - Test Suite 4', () => {

// Add Buttons block
await editorPage.addNewBlock( blockNames.buttons );
const buttonTextInput = await editorPage.getButtonBlockTextInputAtPosition();
const buttonTextInput =
await editorPage.getButtonBlockTextInputAtPosition();
await editorPage.typeTextToTextBlock(
buttonTextInput,
e2eTestData.shortButtonText
Expand All @@ -223,9 +224,10 @@ describe( 'Gutenberg Editor - Test Suite 4', () => {
if ( isAndroid() ) {
// On Android, we take the screenshot using the block list element
// in order to crop some pixels using the padding argument.
const editorScreen = await editorPage.waitForElementToBeDisplayedByXPath(
'//android.widget.FrameLayout[@resource-id="android:id/content"]'
);
const editorScreen =
await editorPage.waitForElementToBeDisplayedByXPath(
'//android.widget.FrameLayout[@resource-id="android:id/content"]'
);
screenshot = await takeScreenshotByElement( editorScreen, {
padding: { right: -10 },
} );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ describe( 'Gutenberg Editor Visual test for Unsupported Block', () => {

// Disabled for now on Android see https://github.com/wordpress-mobile/gutenberg-mobile/issues/5321
if ( ! isAndroid() ) {
const editButton = await editorPage.getUnsupportedBlockBottomSheetEditButton();
const editButton =
await editorPage.getUnsupportedBlockBottomSheetEditButton();
await editButton.click();

const webView = await editorPage.getUnsupportedBlockWebView();
Expand Down
2 changes: 1 addition & 1 deletion gutenberg
Submodule gutenberg updated 346 files
4 changes: 2 additions & 2 deletions ios-xcframework/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ PODS:
- React-Core
- RNTAztecView (1.103.3):
- React-Core
- WordPress-Aztec-iOS (~> 1.19.9)
- WordPress-Aztec-iOS (= 1.19.9)
- SDWebImage (5.11.1):
- SDWebImage/Core (= 5.11.1)
- SDWebImage/Core (5.11.1)
Expand Down Expand Up @@ -659,7 +659,7 @@ SPEC CHECKSUMS:
RNReanimated: 21e1e71d7f1ac9f2fa11df37c06a8ec52ed06232
RNScreens: e3ffdd78ff5afe8ec82c2566ee2410857ed5ce75
RNSVG: 29dd0ac32d83774d4b0953ae92a5cd8205a782d7
RNTAztecView: e040a6aa70f30017fa97a7e901ca2a3881b170ec
RNTAztecView: 5f275640624887502dae1b8b99183971d2faab76
SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d
SDWebImageWebPCoder: 908b83b6adda48effe7667cd2b7f78c897e5111d
WordPress-Aztec-iOS: fbebd569c61baa252b3f5058c0a2a9a6ada686bb
Expand Down
5 changes: 2 additions & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ module.exports = {
'\\.(scss)$': '<rootDir>/' + configPath + '/__mocks__/styleMock.js',
'\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/' + configPath + '/__mocks__/fileMock.js',
[ `@wordpress\\/(${ transpiledPackageNames.join(
'|'
) })$` ]: '<rootDir>/gutenberg/packages/$1/src',
[ `@wordpress\\/(${ transpiledPackageNames.join( '|' ) })$` ]:
'<rootDir>/gutenberg/packages/$1/src',
'test/helpers$': '<rootDir>/' + configPath + '/helpers.js',
jetpackConfig:
'<rootDir>/jetpack/tools/js-tools/jest/jest-jetpack-config.js',
Expand Down
5 changes: 2 additions & 3 deletions metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ gutenbergMetroConfigCopy.resolver.resolveRequest = (
paths: [ path.dirname( context.originModulePath ) ],
} );

const innerNodeModules = filePath.match(
/.*node_modules/
)?.[ 0 ];
const innerNodeModules =
filePath.match( /.*node_modules/ )?.[ 0 ];

extraNodeModulePath =
innerNodeModules && path.join( innerNodeModules, name );
Expand Down
Loading

0 comments on commit 0da94bf

Please sign in to comment.