Skip to content

Commit 484c4f7

Browse files
committed
chore: upgrade eslint config
1 parent 46b92e7 commit 484c4f7

File tree

11 files changed

+794
-396
lines changed

11 files changed

+794
-396
lines changed

cypress/e2e/auth.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ describe('auth', () => {
4949
cy.get('[type="password"]').type('123456')
5050
cy.get('[type="submit"]').click()
5151

52-
cy.get('form').then(($el) => {
52+
cy.get('form').then($el => {
5353
cy.wrap($el[0].checkValidity()).should('to.be', false)
5454
})
5555
})

cypress/e2e/favorite.cy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ describe('favorite', () => {
1010
cy.intercept('POST', /articles\/\S+\/favorite$/, { statusCode: 401, body: {} }).as('favoriteArticle')
1111
cy.visit(ROUTES.HOME)
1212

13-
Cypress.on('uncaught:exception', (err) => {
14-
expect(err.message).to.contain('Need to login')
13+
Cypress.on('uncaught:exception', error => {
14+
expect(error.message).to.contain('Need to login')
1515
return false
1616
})
1717
cy.get('i.ion-heart:first').click()

cypress/e2e/follow.cy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ describe('follow', () => {
55
cy.intercept('GET', /articles\?/, { fixture: 'articles.json' }).as('getArticles')
66
cy.intercept('GET', /tags/, { fixture: 'tags.json' }).as('getTags')
77
cy.intercept('GET', /profiles\/\S+/, { fixture: 'profile.json' }).as('getProfile')
8-
cy.fixture('article.json').then((article) => {
8+
cy.fixture('article.json').then(article => {
99
article.article.author.username = 'foo'
1010
cy.intercept('GET', /articles\/\S+/, { statusCode: 200, body: article }).as('getArticle')
1111
})
@@ -21,7 +21,7 @@ describe('follow', () => {
2121
})
2222

2323
it('should call follow user api when click follow user button', () => {
24-
cy.fixture('profile.json').then((profile) => {
24+
cy.fixture('profile.json').then(profile => {
2525
profile.profile.following = true
2626
cy.intercept('POST', /profiles\/\S+\/follow/, { statusCode: 200, body: profile }).as('followUser')
2727
})

cypress/e2e/tag.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ describe('tag', () => {
3131
.should('have.class', 'router-link-active')
3232
.should('have.class', 'router-link-exact-active')
3333

34-
cy.get('a.tag-pill.tag-default:last').invoke('text').then((tag) => {
34+
cy.get('a.tag-pill.tag-default:last').invoke('text').then(tag => {
3535
const path = `#/tag/${tag}`
3636

3737
cy.url()

cypress/support/e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ declare global {
2929
}
3030

3131
Cypress.Commands.add('login', (username = 'plumrx') => {
32-
cy.fixture('user.json').then((authResponse) => {
32+
cy.fixture('user.json').then(authResponse => {
3333
authResponse.user.username = username
3434
cy.intercept('POST', /users\/login$/, { statusCode: 200, body: authResponse })
3535
})

eslint.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,15 @@ export default defineConfig({
1616
},
1717
},
1818
test: {
19+
vitest: true,
1920
cypress: true,
2021
},
2122
ignores: [
2223
'src/services/api.ts',
2324
],
25+
}, {
26+
files: ['cypress/support/**/*.ts'],
27+
rules: {
28+
'ts/method-signature-style': 'off',
29+
},
2430
})

package.json

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,6 @@
1818
"test:unit": "vitest run",
1919
"generate:api": "curl -sL https://raw.githubusercontent.com/gothinkster/realworld/main/api/openapi.yml -o ./src/services/openapi.yml && sta -p ./src/services/openapi.yml -o ./src/services -n api.ts"
2020
},
21-
"simple-git-hooks": {
22-
"pre-commit": "npm exec lint-staged",
23-
"pre-push": "npm run lint && npm run build"
24-
},
25-
"lint-staged": {
26-
"*": "eslint --fix"
27-
},
2821
"dependencies": {
2922
"insane": "^2.6.2",
3023
"marked": "^12.0.0",
@@ -33,7 +26,7 @@
3326
"vue-router": "^4.3.0"
3427
},
3528
"devDependencies": {
36-
"@mutoe/eslint-config": "^2.4.5",
29+
"@mutoe/eslint-config": "^2.8.3",
3730
"@pinia/testing": "^0.1.3",
3831
"@testing-library/cypress": "^10.0.1",
3932
"@testing-library/user-event": "^14.5.1",
@@ -42,8 +35,10 @@
4235
"@vitest/coverage-v8": "^1.0.4",
4336
"concurrently": "^8.2.2",
4437
"cypress": "^13.6.0",
45-
"eslint": "^8.54.0",
46-
"eslint-plugin-cypress": "^2.15.1",
38+
"eslint": "^8.57.0",
39+
"eslint-plugin-cypress": "^3.4.0",
40+
"eslint-plugin-vitest": "^0.5.4",
41+
"eslint-plugin-vue": "^9.27.0",
4742
"happy-dom": "^12.10.3",
4843
"lint-staged": "^15.2.0",
4944
"msw": "^2.0.11",
@@ -55,5 +50,12 @@
5550
"vitest": "^1.0.4",
5651
"vitest-dom": "^0.1.1",
5752
"vue-tsc": "^1.8.25"
53+
},
54+
"simple-git-hooks": {
55+
"pre-commit": "npm exec lint-staged",
56+
"pre-push": "npm run lint && npm run build"
57+
},
58+
"lint-staged": {
59+
"*": "eslint --fix"
5860
}
5961
}

0 commit comments

Comments
 (0)