Skip to content

Commit 8852110

Browse files
authored
[ZEPPELIN-6382] Add configuration to remove unused variables, parameters, and imports for New UI
### What is this PR for? - Enforced unused-variable checks via ESLint (<at>typescript-eslint/no-unused-vars). - Activated strict TypeScript checks in E2E tests (noUnusedLocals, noUnusedParameters). - Apply eslint, tsc ### What type of PR is it? Improvement ### Todos ### What is the Jira issue? ZEPPELIN-6382 ### How should this be tested? ### Screenshots (if appropriate) ### Questions: * Does the license files need to update? No * Is there breaking changes for older versions? No * Does this needs documentation? No Closes #5123 from dididy/fix/unused-part. Signed-off-by: ChanHo Lee <chanholee@apache.org>
1 parent 43ea5a4 commit 8852110

28 files changed

+56
-69
lines changed

zeppelin-web-angular/.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ root = true
55
charset=utf-8
66
end_of_line=lf
77
trim_trailing_whitespace=true
8-
insert_final_newline=false
8+
insert_final_newline=true
99
indent_style=space
1010
indent_size=2
1111

zeppelin-web-angular/.eslintrc.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
"@typescript-eslint/consistent-type-assertions": "off",
4343
"@typescript-eslint/consistent-type-definitions": "off",
4444
"@typescript-eslint/no-confusing-non-null-assertion": "off",
45-
"o-empty-function": "off",
4645
"@typescript-eslint/no-empty-function": "off",
4746
"@typescript-eslint/no-inferrable-types": "off",
4847
"@typescript-eslint/prefer-for-of": "off",
@@ -85,6 +84,13 @@
8584
"@typescript-eslint/naming-convention": "off",
8685
"@typescript-eslint/no-non-null-assertion": "off",
8786
"@typescript-eslint/no-this-alias": "error",
87+
"@typescript-eslint/no-unused-vars": [
88+
"error",
89+
{
90+
"argsIgnorePattern": "^_",
91+
"varsIgnorePattern": "^_"
92+
}
93+
],
8894
"@typescript-eslint/quotes": "off",
8995
"eol-last": "off",
9096
"import/no-cycle": "error",

zeppelin-web-angular/e2e/tests/authentication/anonymous-login-redirect.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ test.describe('Anonymous User Login Redirect', () => {
4343
await waitForZeppelinReady(page);
4444
});
4545

46-
test('When accessing login page directly, Then should redirect to home with proper URL change', async ({
47-
page
48-
}) => {
46+
test('When accessing login page directly, Then should redirect to home with proper URL change', async () => {
4947
const redirectResult = await homePageUtil.verifyAnonymousUserRedirectFromLogin();
5048

5149
expect(redirectResult.isLoginUrlMaintained).toBe(false);

zeppelin-web-angular/e2e/tests/home/home-page-enhanced-functionality.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,32 +27,32 @@ test.describe('Home Page Enhanced Functionality', () => {
2727
});
2828

2929
test.describe('Given documentation links are displayed', () => {
30-
test('When documentation link is checked Then should have correct version in URL', async ({ page }) => {
30+
test('When documentation link is checked Then should have correct version in URL', async () => {
3131
await homeUtil.verifyDocumentationVersionLink();
3232
});
3333

34-
test('When external links are checked Then should all open in new tab', async ({ page }) => {
34+
test('When external links are checked Then should all open in new tab', async () => {
3535
await homeUtil.verifyAllExternalLinksTargetBlank();
3636
});
3737
});
3838

3939
test.describe('Given welcome section display', () => {
40-
test('When page loads Then should show welcome content with proper text', async ({ page }) => {
40+
test('When page loads Then should show welcome content with proper text', async () => {
4141
await homeUtil.verifyWelcomeSection();
4242
});
4343

44-
test('When welcome section is displayed Then should contain interactive elements', async ({ page }) => {
44+
test('When welcome section is displayed Then should contain interactive elements', async () => {
4545
await homeUtil.verifyNotebookSection();
4646
});
4747
});
4848

4949
test.describe('Given community section content', () => {
50-
test('When community section loads Then should display help and community headings', async ({ page }) => {
50+
test('When community section loads Then should display help and community headings', async () => {
5151
await homeUtil.verifyHelpSection();
5252
await homeUtil.verifyCommunitySection();
5353
});
5454

55-
test('When external links are displayed Then should show correct targets', async ({ page }) => {
55+
test('When external links are displayed Then should show correct targets', async () => {
5656
const linkTargets = await homeUtil.testExternalLinkTargets();
5757

5858
expect(linkTargets.documentationHref).toContain('zeppelin.apache.org/docs');

zeppelin-web-angular/e2e/tests/home/home-page-layout.spec.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
import { expect, test } from '@playwright/test';
1414
import { HomePage } from '../../models/home-page';
15-
import { HomePageUtil } from '../../models/home-page.util';
1615
import { addPageAnnotationBeforeEach, performLoginIfRequired, waitForZeppelinReady, PAGES } from '../../utils';
1716

1817
test.describe('Home Page - Layout and Grid', () => {
@@ -26,8 +25,6 @@ test.describe('Home Page - Layout and Grid', () => {
2625

2726
test.describe('Responsive Grid Layout', () => {
2827
test('should display responsive grid structure', async ({ page }) => {
29-
const homePageUtil = new HomePageUtil(page);
30-
3128
await test.step('Given I am on the home page', async () => {
3229
const homePage = new HomePage(page);
3330
await homePage.navigateToHome();

zeppelin-web-angular/e2e/tests/home/home-page-note-operations.spec.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,12 @@
1111
*/
1212

1313
import { expect, test } from '@playwright/test';
14-
import { HomePage } from '../../models/home-page';
1514
import { addPageAnnotationBeforeEach, performLoginIfRequired, waitForZeppelinReady, PAGES } from '../../utils';
1615

1716
addPageAnnotationBeforeEach(PAGES.WORKSPACE.HOME);
1817

1918
test.describe('Home Page Note Operations', () => {
20-
let homePage: HomePage;
21-
2219
test.beforeEach(async ({ page }) => {
23-
homePage = new HomePage(page);
2420
await page.goto('/');
2521
await waitForZeppelinReady(page);
2622
await performLoginIfRequired(page);
@@ -93,13 +89,10 @@ test.describe('Home Page Note Operations', () => {
9389

9490
await page
9591
.waitForFunction(
96-
() => {
97-
return (
98-
document.querySelector('zeppelin-note-rename') !== null ||
99-
document.querySelector('[role="dialog"]') !== null ||
100-
document.querySelector('.ant-modal') !== null
101-
);
102-
},
92+
() =>
93+
document.querySelector('zeppelin-note-rename') !== null ||
94+
document.querySelector('[role="dialog"]') !== null ||
95+
document.querySelector('.ant-modal') !== null,
10396
{ timeout: 5000 }
10497
)
10598
.catch(() => {

zeppelin-web-angular/e2e/tests/home/home-page-notebook-actions.spec.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* limitations under the License.
1111
*/
1212

13-
import { expect, test } from '@playwright/test';
13+
import { test } from '@playwright/test';
1414
import { HomePageUtil } from '../../models/home-page.util';
1515
import { addPageAnnotationBeforeEach, performLoginIfRequired, waitForZeppelinReady, PAGES } from '../../utils';
1616

@@ -27,21 +27,21 @@ test.describe('Home Page Notebook Actions', () => {
2727
});
2828

2929
test.describe('Given notebook list is displayed', () => {
30-
test('When page loads Then should show notebook actions', async ({ page }) => {
30+
test('When page loads Then should show notebook actions', async () => {
3131
await homeUtil.verifyNotebookActions();
3232
});
3333

34-
test('When refresh button is clicked Then should trigger reload with loading state', async ({ page }) => {
34+
test('When refresh button is clicked Then should trigger reload with loading state', async () => {
3535
await homeUtil.testNotebookRefreshLoadingState();
3636
});
3737

38-
test('When filter is used Then should filter notebook list', async ({ page }) => {
38+
test('When filter is used Then should filter notebook list', async () => {
3939
await homeUtil.testFilterFunctionality('test');
4040
});
4141
});
4242

4343
test.describe('Given create new note action', () => {
44-
test('When create new note is clicked Then should open note creation modal', async ({ page }) => {
44+
test('When create new note is clicked Then should open note creation modal', async () => {
4545
try {
4646
await homeUtil.verifyCreateNewNoteWorkflow();
4747
} catch (error) {
@@ -51,7 +51,7 @@ test.describe('Home Page Notebook Actions', () => {
5151
});
5252

5353
test.describe('Given import note action', () => {
54-
test('When import note is clicked Then should open import modal', async ({ page }) => {
54+
test('When import note is clicked Then should open import modal', async () => {
5555
try {
5656
await homeUtil.verifyImportNoteWorkflow();
5757
} catch (error) {
@@ -61,7 +61,7 @@ test.describe('Home Page Notebook Actions', () => {
6161
});
6262

6363
test.describe('Given notebook refresh functionality', () => {
64-
test('When refresh is triggered Then should maintain notebook list visibility', async ({ page }) => {
64+
test('When refresh is triggered Then should maintain notebook list visibility', async () => {
6565
await homeUtil.verifyNotebookRefreshFunctionality();
6666
});
6767
});

zeppelin-web-angular/e2e/tests/theme/dark-mode.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ test.describe('Dark Mode Theme Switching', () => {
8181
});
8282
});
8383

84-
test('Scenario: System Theme and Local Storage Interaction', async ({ page, context }) => {
84+
test('Scenario: System Theme and Local Storage Interaction', async ({ page }) => {
8585
// Ensure localStorage is clear for each sub-scenario
8686
await themePage.clearLocalStorage();
8787

zeppelin-web-angular/e2e/tests/workspace/notebook-repos/notebook-repo-item-display.spec.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@
1212

1313
import { expect, test } from '@playwright/test';
1414
import { NotebookReposPage, NotebookRepoItemPage } from '../../../models/notebook-repos-page';
15-
import { NotebookRepoItemUtil } from '../../../models/notebook-repos-page.util';
1615
import { addPageAnnotationBeforeEach, performLoginIfRequired, waitForZeppelinReady, PAGES } from '../../../utils';
1716

1817
test.describe('Notebook Repository Item - Display Mode', () => {
1918
addPageAnnotationBeforeEach(PAGES.WORKSPACE.NOTEBOOK_REPOS_ITEM);
2019

2120
let notebookReposPage: NotebookReposPage;
2221
let repoItemPage: NotebookRepoItemPage;
23-
let repoItemUtil: NotebookRepoItemUtil;
2422
let firstRepoName: string;
2523

2624
test.beforeEach(async ({ page }) => {
@@ -33,7 +31,6 @@ test.describe('Notebook Repository Item - Display Mode', () => {
3331
const firstCard = notebookReposPage.repositoryItems.first();
3432
firstRepoName = (await firstCard.locator('.ant-card-head-title').textContent()) || '';
3533
repoItemPage = new NotebookRepoItemPage(page, firstRepoName);
36-
repoItemUtil = new NotebookRepoItemUtil(page, firstRepoName);
3734
});
3835

3936
test('should display repository card with name', async () => {

zeppelin-web-angular/e2e/tests/workspace/notebook-repos/notebook-repo-item-form-validation.spec.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@
1212

1313
import { expect, test } from '@playwright/test';
1414
import { NotebookReposPage, NotebookRepoItemPage } from '../../../models/notebook-repos-page';
15-
import { NotebookRepoItemUtil } from '../../../models/notebook-repos-page.util';
1615
import { addPageAnnotationBeforeEach, performLoginIfRequired, waitForZeppelinReady, PAGES } from '../../../utils';
1716

1817
test.describe('Notebook Repository Item - Form Validation', () => {
1918
addPageAnnotationBeforeEach(PAGES.WORKSPACE.NOTEBOOK_REPOS_ITEM);
2019

2120
let notebookReposPage: NotebookReposPage;
2221
let repoItemPage: NotebookRepoItemPage;
23-
let repoItemUtil: NotebookRepoItemUtil;
2422
let firstRepoName: string;
2523

2624
test.beforeEach(async ({ page }) => {
@@ -33,7 +31,6 @@ test.describe('Notebook Repository Item - Form Validation', () => {
3331
const firstCard = notebookReposPage.repositoryItems.first();
3432
firstRepoName = (await firstCard.locator('.ant-card-head-title').textContent()) || '';
3533
repoItemPage = new NotebookRepoItemPage(page, firstRepoName);
36-
repoItemUtil = new NotebookRepoItemUtil(page, firstRepoName);
3734
});
3835

3936
test('should disable save button when form is invalid', async () => {

0 commit comments

Comments
 (0)