Skip to content

Commit

Permalink
chore: fix eslint errors after package upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
nickmessing committed Aug 26, 2024
1 parent 17ab680 commit a14b178
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 15 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
packages/docs/src/.vitepress/cache
5 changes: 4 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
'@vue/typescript/recommended',
],
parserOptions: {
ecmaVersion: 2020,
ecmaVersion: 2022,
},
globals: {
name: 'off',
Expand Down Expand Up @@ -46,6 +46,9 @@ module.exports = {
'@typescript-eslint/no-empty-function': 'warn',
'no-return-assign': 'off',
'multiline-ternary': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'no-undef': 'off',
'vue/multi-word-component-names': 'off',
},
overrides: [
{
Expand Down
4 changes: 2 additions & 2 deletions packages/test-e2e-ssr/tests/e2e/specs/test.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe('Vue 3 + Apollo Composable', () => {
})

it('loads channels', () => {
cy.intercept('http://localhost:4042/graphql', (req) => {
cy.intercept('http://localhost:4042/graphql', () => {
throw new Error('Should not be called')
})
cy.visit('/')
Expand All @@ -17,7 +17,7 @@ describe('Vue 3 + Apollo Composable', () => {

it('load one channel', () => {
let shouldCallGraphQL = false
cy.intercept('http://localhost:4042/graphql', (req) => {
cy.intercept('http://localhost:4042/graphql', () => {
if (!shouldCallGraphQL) {
throw new Error('Should not be called')
}
Expand Down
4 changes: 2 additions & 2 deletions packages/test-e2e/apollo-server/connectors/channels.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ const channels = [
{ id: 'help', name: 'Ask for or give help' },
]

exports.getAll = (context) => {
exports.getAll = () => {
return channels
}

exports.getOne = (id, context) => {
exports.getOne = (id) => {
return channels.find(c => c.id === id)
}
6 changes: 3 additions & 3 deletions packages/test-e2e/apollo-server/connectors/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ function publishChange ({ type, message }, context) {
})
}

exports.getAll = (channelId, context) => {
exports.getAll = (channelId) => {
return new Promise((resolve) => {
setTimeout(() => {
resolve(messages.filter(m => m.channelId === channelId))
}, 100)
})
}

exports.getOne = (id, context) => {
exports.getOne = (id) => {
return messages.find(m => m.id === id)
}

Expand Down Expand Up @@ -70,7 +70,7 @@ exports.update = ({ id, content }, context) => {
return message
}

exports.remove = (id, context) => {
exports.remove = (id) => {
const index = messages.findIndex(m => m.id === id)
if (index === -1) throw new Error('Message not found')
const message = messages[index]
Expand Down
6 changes: 3 additions & 3 deletions packages/test-e2e/apollo-server/connectors/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function createDefaultUsers () {

let users = createDefaultUsers()

exports.register = (input, context) => {
exports.register = (input) => {
if (users.find(u => u.email === input.email)) {
throw new Error('Email already used')
}
Expand All @@ -34,7 +34,7 @@ exports.register = (input, context) => {
})
}

exports.login = ({ email, password }, context) => {
exports.login = ({ email, password }) => {
const user = users.find(
u => u.email === email && u.password === password,
)
Expand Down Expand Up @@ -62,7 +62,7 @@ exports.logout = (context) => {
return true
}

exports.getOne = (id, context) => {
exports.getOne = (id) => {
return users.find(u => u.id === id)
}

Expand Down
2 changes: 1 addition & 1 deletion packages/vue-apollo-components/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import CApolloMutation from './ApolloMutation'

const plugin = {}

export function install (app, options) {
export function install (app) {
app.component('ApolloQuery', CApolloQuery)
app.component('ApolloSubscribeToMore', CApolloSubscribeToMore)
app.component('ApolloMutation', CApolloMutation)
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-apollo-composable/src/useSubscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ export function useSubscription <
// Applying variables
let currentVariables: TVariables | undefined
let currentVariablesSerialized: string
watch(variablesRef, (value, oldValue) => {
watch(variablesRef, (value) => {
const serialized = JSON.stringify(value)
if (serialized !== currentVariablesSerialized) {
currentVariables = value
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-apollo-option/src/apollo-provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class ApolloProvider {

install (app) {
// Options merging
app.config.optionMergeStrategies.apollo = function (toVal, fromVal, vm) {
app.config.optionMergeStrategies.apollo = function (toVal, fromVal) {
if (!toVal) return fromVal
if (!fromVal) return toVal

Expand Down
2 changes: 1 addition & 1 deletion packages/vue-apollo-option/src/smart-apollo.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export default class SmartApollo {
return apolloOptions
}

executeApollo (variables) {
executeApollo () {
this.starting = false
}

Expand Down
2 changes: 2 additions & 0 deletions packages/vue-apollo-option/types/vue-apollo.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
VueApolloSubscriptionDefinition,
} from './options'

// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface SmartApollo<V> {
skip: boolean
refresh(): void
Expand Down Expand Up @@ -65,5 +66,6 @@ export interface DollarApollo<V> extends ApolloClientMethods {
getClient<R = any>(): ApolloClient<R>

addSmartQuery<R = any>(key: string, options: VueApolloQueryDefinition<R>): SmartQuery<V>
// eslint-disable-next-line @typescript-eslint/no-unused-vars
addSmartSubscription<R = any>(key: string, options: VueApolloSubscriptionDefinition): SmartSubscription<V>
}
1 change: 1 addition & 0 deletions packages/vue-apollo-option/types/vue.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ declare module '@vue/runtime-core' {
Mixin extends ComponentOptionsMixin,
Extends extends ComponentOptionsMixin,
E extends EmitsOptions,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
EE extends string = string,
// eslint-disable-next-line @typescript-eslint/ban-types
Defaults = {}
Expand Down

0 comments on commit a14b178

Please sign in to comment.