Skip to content

Commit

Permalink
adjust cypress eslint config
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Aug 9, 2024
1 parent ecad4e7 commit 018832c
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 37 deletions.
1 change: 0 additions & 1 deletion generators/cypress/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export const cypressFiles: WriteFileSection<CypressGenerator, CommonClientServer
path: CYPRESS_TEMPLATE_SOURCE_DIR,
renameTo: (ctx, file) => `${ctx.cypressDir}${file}`,
templates: [
'.eslintrc.json',
'fixtures/integration-test.png',
'plugins/index.ts',
'e2e/administration/administration.cy.ts',
Expand Down
4 changes: 3 additions & 1 deletion generators/cypress/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export default class CypressGenerator extends BaseApplicationGenerator {

get writing() {
return this.asWritingTaskGroup({
cleanup({ application: { authenticationTypeOauth2, generateUserManagement, cypressDir } }) {
async cleanup({ control, application: { authenticationTypeOauth2, generateUserManagement, cypressDir } }) {
if (this.isJhipsterVersionLessThan('7.0.0-beta.1')) {
this.removeFile(`${cypressDir}support/keycloak-oauth2.ts`);
this.removeFile(`${cypressDir}fixtures/users/user.json`);
Expand All @@ -131,6 +131,8 @@ export default class CypressGenerator extends BaseApplicationGenerator {
this.removeFile(`${cypressDir}integration/account/reset-password-page.spec.ts`);
}
}

await control.cleanupFiles({ '8.6.1': [`${cypressDir}.eslintrc.json`] });
},
async writeFiles({ application }) {
const faker = await createFaker();
Expand Down
13 changes: 6 additions & 7 deletions generators/cypress/templates/eslint.config.js.jhi.cypress.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,12 @@ import cypress from 'eslint-plugin-cypress/flat';
},
},
rules: {
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unsafe-argument': 'warn',
'@typescript-eslint/no-unsafe-assignment': 'warn',
'@typescript-eslint/no-unsafe-call': 'warn',
'@typescript-eslint/no-unsafe-member-access': 'warn',
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/unbound-method': 'warn',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/unbound-method': 'off',
},
},
<&_ } -&>

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
limitations under the License.
-%>
/* eslint-disable @typescript-eslint/no-namespace */
/* eslint-disable @typescript-eslint/no-use-before-define */
// eslint-disable-next-line spaced-comment
/// <reference types="cypress" />

// ***********************************************
// This commands.ts shows you how to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
limitations under the License.
-%>
/* eslint-disable @typescript-eslint/no-namespace */
/* eslint-disable @typescript-eslint/no-use-before-define */
// eslint-disable-next-line spaced-comment
/// <reference types="cypress" />

// ***********************************************
// Begin Specific Selector Attributes for Cypress
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
limitations under the License.
-%>
/* eslint-disable @typescript-eslint/no-namespace */
/* eslint-disable @typescript-eslint/no-use-before-define */
/* eslint-disable @typescript-eslint/no-unsafe-return */

Cypress.Commands.add('getManagementInfo', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
limitations under the License.
-%>
/* eslint-disable @typescript-eslint/no-namespace */
/* eslint-disable @typescript-eslint/no-use-before-define */

import {
navbarSelector,
Expand Down

0 comments on commit 018832c

Please sign in to comment.