Skip to content

Commit a6e34d6

Browse files
committed
Fix linting warnings.
1 parent 39d75f0 commit a6e34d6

File tree

14 files changed

+491
-479
lines changed

14 files changed

+491
-479
lines changed

eslint.config.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,5 +135,11 @@ export default eslintTs.config(
135135
objectLiteralTypeAssertions: 'never'
136136
}],
137137
}
138+
},
139+
{
140+
files: ['test/**', '**/*.test.*', '**/*.spec.*'],
141+
rules: {
142+
'max-lines-per-function': 'off'
143+
}
138144
}
139145
)

src/css/edit/_form.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ $sidebar-gap: 30px;
7575
grid-area: span 3 / sidebar;
7676
max-inline-size: $sidebar-width;
7777
position: sticky;
78-
top: 32px;
78+
inset-block-start: 32px;
7979
align-self: start;
8080
}
8181

src/css/edit/_sidebar.scss

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
@use '../common/theme';
22

3+
.code-snippets-modal {
4+
p h4 {
5+
margin-block-start: 0;
6+
}
7+
}
8+
39
.snippet-editor-sidebar {
410
.button-large {
511
block-size: 48px;
@@ -147,9 +153,3 @@ p.submit {
147153
block-size: 12px;
148154
}
149155
}
150-
151-
.code-snippets-modal {
152-
p h4 {
153-
margin-block-start: 0;
154-
}
155-
}

src/css/menu.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#adminmenu {
2-
.toplevel_page_snippets div.wp-menu-image:before {
2+
.toplevel_page_snippets div.wp-menu-image::before {
33
content: '';
44
mask-image: url('../assets/menu-icon.svg');
55
mask-repeat: no-repeat;

src/js/components/EditorSidebar/EditorSidebar.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { isNetworkAdmin } from '../../utils/screen'
66
import { isCondition } from '../../utils/snippets/snippets'
77
import { ConditionModalButton } from '../ConditionModal/ConditionModalButton'
88
import { SnippetLocationInput } from '../SnippetForm/fields/SnippetLocationInput'
9-
import { SnippetTypeInput } from '../SnippetForm/fields/SnippetTypeInput'
109
import { Notices } from '../SnippetForm/page/Notices'
1110
import { ShortcodeInfo } from './actions/ShortcodeInfo'
1211
import { MultisiteSharingSettings } from './controls/MultisiteSharingSettings'

src/js/components/SnippetForm/fields/SnippetTypeInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import React, { useEffect } from 'react'
22
import classnames from 'classnames'
33
import { __, _x } from '@wordpress/i18n'
44
import Select from 'react-select'
5-
import type { FormatOptionLabelContext } from 'react-select'
65
import { useSnippetForm } from '../../../hooks/useSnippetForm'
76
import { SNIPPET_TYPE_SCOPES } from '../../../types/Snippet'
87
import { isLicensed } from '../../../utils/screen'
98
import { getSnippetType, isProType } from '../../../utils/snippets/snippets'
109
import { Badge } from '../../common/Badge'
10+
import type { FormatOptionLabelContext } from 'react-select'
1111
import type { Dispatch, SetStateAction } from 'react'
1212
import type { SnippetCodeType, SnippetType } from '../../../types/Snippet'
1313
import type { SelectOption } from '../../../types/SelectOption'

tests/e2e/auth.setup.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
import { test as setup, expect } from '@playwright/test';
2-
import * as path from 'path';
1+
import { join } from 'path'
2+
import { expect, test as setup } from '@playwright/test'
33

4-
const authFile = path.join(__dirname, '.auth/user.json');
4+
const authFile = join(__dirname, '.auth/user.json')
55

66
setup('authenticate', async ({ page }) => {
7-
await page.goto('/wp-login.php');
8-
await page.waitForSelector('#user_login');
7+
await page.goto('/wp-login.php')
8+
await page.waitForSelector('#user_login')
99

10-
await page.fill('#user_login', 'admin');
11-
await page.fill('#user_pass', 'password');
10+
await page.fill('#user_login', 'admin')
11+
await page.fill('#user_pass', 'password')
1212

13-
await page.click('#wp-submit');
13+
await page.click('#wp-submit')
1414

15-
await page.waitForURL(/wp-admin/);
16-
await page.waitForSelector('#wpbody-content, #adminmenu');
15+
await page.waitForURL(/wp-admin/)
16+
await page.waitForSelector('#wpbody-content, #adminmenu')
1717

18-
await expect(page.locator('#adminmenu')).toBeVisible();
18+
await expect(page.locator('#adminmenu')).toBeVisible()
1919

20-
await page.context().storageState({ path: authFile });
21-
});
20+
await page.context().storageState({ path: authFile })
21+
})
Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
1-
import { test, expect } from '@playwright/test';
2-
import { SnippetsTestHelper } from './helpers/SnippetsTestHelper';
3-
import { MESSAGES } from './helpers/constants';
1+
import { test } from '@playwright/test'
2+
import { SnippetsTestHelper } from './helpers/SnippetsTestHelper'
3+
import { MESSAGES } from './helpers/constants'
44

5-
const TEST_SNIPPET_NAME = 'E2E Test Snippet';
5+
const TEST_SNIPPET_NAME = 'E2E Test Snippet'
66

77
test.describe('Code Snippets Admin', () => {
8-
let helper: SnippetsTestHelper;
8+
let helper: SnippetsTestHelper
99

1010
test.beforeEach(async ({ page }) => {
11-
helper = new SnippetsTestHelper(page);
12-
await helper.navigateToSnippetsAdmin();
13-
});
11+
helper = new SnippetsTestHelper(page)
12+
await helper.navigateToSnippetsAdmin()
13+
})
1414

15-
test('Can access snippets admin page', async ({ page }) => {
16-
await helper.expectToBeOnSnippetsAdminPage();
17-
});
15+
test('Can access snippets admin page', async () => {
16+
await helper.expectToBeOnSnippetsAdminPage()
17+
})
1818

19-
test('Can add a new snippet', async ({ page }) => {
19+
test('Can add a new snippet', async () => {
2020
await helper.createSnippet({
2121
name: TEST_SNIPPET_NAME,
2222
code: 'echo "Hello World!";'
23-
});
24-
});
23+
})
24+
})
2525

26-
test('Can activate and deactivate a snippet', async ({ page }) => {
27-
await helper.openSnippet(TEST_SNIPPET_NAME);
26+
test('Can activate and deactivate a snippet', async () => {
27+
await helper.openSnippet(TEST_SNIPPET_NAME)
2828

29-
await helper.saveSnippet('save_and_activate');
30-
await helper.expectSuccessMessageInParagraph(MESSAGES.SNIPPET_UPDATED_AND_ACTIVATED);
29+
await helper.saveSnippet('save_and_activate')
30+
await helper.expectSuccessMessageInParagraph(MESSAGES.SNIPPET_UPDATED_AND_ACTIVATED)
3131

32-
await helper.saveSnippet('save_and_deactivate');
33-
await helper.expectSuccessMessageInParagraph(MESSAGES.SNIPPET_UPDATED_AND_DEACTIVATED);
34-
});
32+
await helper.saveSnippet('save_and_deactivate')
33+
await helper.expectSuccessMessageInParagraph(MESSAGES.SNIPPET_UPDATED_AND_DEACTIVATED)
34+
})
3535

36-
test('Can delete a snippet', async ({ page }) => {
37-
await helper.openSnippet(TEST_SNIPPET_NAME);
38-
await helper.deleteSnippet();
39-
await helper.expectTextNotVisible(TEST_SNIPPET_NAME);
40-
});
41-
});
36+
test('Can delete a snippet', async () => {
37+
await helper.openSnippet(TEST_SNIPPET_NAME)
38+
await helper.deleteSnippet()
39+
await helper.expectTextNotVisible(TEST_SNIPPET_NAME)
40+
})
41+
})

0 commit comments

Comments
 (0)