Skip to content

Commit 55147c4

Browse files
committed
chore: refactor eslint config, now at root
1 parent 9787fc8 commit 55147c4

38 files changed

+200
-845
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ jobs:
3333
key: v4-dependencies-{{ checksum "yarn.lock" }}
3434

3535
# run tests!
36+
- run: yarn lint
3637
- run: cd packages/vue-apollo && yarn build
37-
- run: cd packages/vue-apollo && yarn test:eslint
3838
- run: cd packages/vue-apollo && yarn test:types
3939
- run: cd packages/vue-apollo && yarn test:unit
4040
- run: cd packages/test-e2e && yarn test:e2e

packages/vue-apollo/.eslintrc.js renamed to .eslintrc.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,14 @@ module.exports = {
5151
},
5252
},
5353
{
54-
files: ['tests/unit/*.js', 'ssr/*', 'build/*', 'lib/*'],
54+
files: [
55+
'**/tests/unit/*.js',
56+
'**/ssr/*',
57+
'**/build/*',
58+
'**/lib/*',
59+
'apollo.config.js',
60+
'**/apollo-server/**/*',
61+
],
5562
rules: {
5663
'@typescript-eslint/no-var-requires': 'off',
5764
},
@@ -62,6 +69,6 @@ module.exports = {
6269
'dist/',
6370
'!.*',
6471
'schema.graphql',
65-
'types/test/*.js',
72+
'**/types/test/*.js',
6673
],
6774
}

package.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,24 @@
66
],
77
"private": true,
88
"scripts": {
9-
"release": "lerna publish"
9+
"lint": "eslint --ext .js,.ts,.vue .",
10+
"release": "yarn lint && lerna publish"
1011
},
1112
"devDependencies": {
13+
"@typescript-eslint/eslint-plugin": "^4.2.0",
14+
"@typescript-eslint/parser": "^4.2.0",
15+
"@vue/eslint-config-standard": "^6.0.0",
16+
"@vue/eslint-config-typescript": "^7.0.0",
1217
"core-js": "^3.4.1",
18+
"eslint": "^7.19.0",
19+
"eslint-plugin-import": "^2.22.1",
20+
"eslint-plugin-node": "^11.1.0",
21+
"eslint-plugin-promise": "^4.2.1",
22+
"eslint-plugin-standard": "^5.0.0",
23+
"eslint-plugin-vue": "^7.5.0",
1324
"eslint-scope": "^5.0.0",
14-
"lerna": "^3.18.4"
25+
"lerna": "^3.18.4",
26+
"typescript": "^4.1.3"
1527
},
1628
"resolutions": {
1729
"eslint-scope": "^5.0.0",
Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
<template>
22
<p class="sponsor-button">
3-
<github-button href="https://github.com/sponsors/Akryum" data-icon="octicon-heart" data-size="large" aria-label="Sponsor @Akryum on GitHub">
3+
<github-button
4+
href="https://github.com/sponsors/Akryum"
5+
data-icon="octicon-heart"
6+
data-size="large"
7+
aria-label="Sponsor @Akryum on GitHub"
8+
>
49
Sponsor on GitHub
510
</github-button>
611
</p>
@@ -11,13 +16,13 @@ import GithubButton from 'vue-github-button'
1116
1217
export default {
1318
components: {
14-
GithubButton
15-
}
19+
GithubButton,
20+
},
1621
}
1722
</script>
1823

1924
<style lang="stylus" scoped>
2025
.sponsor-button
2126
text-align center
2227
margin 24px 0
23-
</style>
28+
</style>

packages/docs/src/.vuepress/config.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ module.exports = {
1919
lang: 'fr-FR',
2020
title: 'Vue Apollo',
2121
description: '🚀 Intégrez GraphQL dans vos apps Vue.js !',
22-
}
22+
},
2323
},
2424
plugins: {
2525
'@vuepress/pwa': {
2626
serviceWorker: true,
2727
updatePopup: {
2828
'/': {
29-
message: "New content is available.",
30-
buttonText: "Refresh"
29+
message: 'New content is available.',
30+
buttonText: 'Refresh',
3131
},
3232
'/fr/': {
33-
message: "Du nouveau contenu est disponible.",
34-
buttonText: "Rafraîchir"
33+
message: 'Du nouveau contenu est disponible.',
34+
buttonText: 'Rafraîchir',
3535
},
3636
},
3737
},

packages/test-e2e/.eslintignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

packages/test-e2e/.eslintrc.js

Lines changed: 0 additions & 31 deletions
This file was deleted.

packages/test-e2e/apollo-server/connectors/messages.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ const messages = [
77
userId: '__bot',
88
channelId: 'general',
99
content: 'Welcome to the chat!',
10-
dateAdded: Date.now()
11-
}
10+
dateAdded: Date.now(),
11+
},
1212
]
1313

1414
function publishChange ({ type, message }, context) {

packages/test-e2e/apollo-server/connectors/users.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ const users = [
66
77
password: 'bot',
88
nickname: 'The Bot',
9-
tokens: []
10-
}
9+
tokens: [],
10+
},
1111
]
1212

1313
exports.register = (input, context) => {
@@ -24,15 +24,15 @@ exports.register = (input, context) => {
2424
nickname: input.nickname,
2525
tokens: [],
2626
})
27-
27+
2828
resolve(true)
2929
}, 100)
3030
})
3131
}
3232

3333
exports.login = ({ email, password }, context) => {
3434
const user = users.find(
35-
u => u.email === email && u.password === password
35+
u => u.email === email && u.password === password,
3636
)
3737
if (!user) throw new Error('User not found')
3838
const token = {

packages/test-e2e/apollo-server/resolvers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ module.exports = {
4545
messageChanged: {
4646
subscribe: withFilter(
4747
(parent, args, { pubsub }) => pubsub.asyncIterator(triggers.MESSAGE_CHANGED),
48-
(payload, vars) => payload.messageChanged.message.channelId === vars.channelId
48+
(payload, vars) => payload.messageChanged.message.channelId === vars.channelId,
4949
),
5050
},
5151
},

0 commit comments

Comments
 (0)