Skip to content

Commit aab0110

Browse files
committed
fix(lint): autofixed files
1 parent 3ded722 commit aab0110

File tree

13 files changed

+51
-51
lines changed

13 files changed

+51
-51
lines changed

.eslintrc.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ module.exports = {
55
parser: 'vue-eslint-parser',
66
parserOptions: {
77
// Use babel-eslint for JavaScript
8-
'parser': 'babel-eslint',
9-
'ecmaVersion': 2017,
8+
parser: 'babel-eslint',
9+
ecmaVersion: 2017,
1010
// With import/export syntax
11-
'sourceType': 'module'
11+
sourceType: 'module',
1212
},
1313
// Environment global objects
1414
env: {
@@ -27,22 +27,22 @@ module.exports = {
2727

2828
// Vue
2929

30-
// Error
31-
'vue/html-closing-bracket-newline': ['error', {
32-
'singleline': 'never',
33-
'multiline': 'always',
30+
// Error
31+
'vue/html-closing-bracket-newline': ['error', {
32+
singleline: 'never',
33+
multiline: 'always',
3434
}],
3535
'vue/html-closing-bracket-spacing': ['error', {
36-
'startTag': 'never',
37-
'endTag': 'never',
38-
'selfClosingTag': 'never',
36+
startTag: 'never',
37+
endTag: 'never',
38+
selfClosingTag: 'never',
3939
}],
4040
'vue/max-attributes-per-line': ['error', {
41-
"singleline": 2,
42-
"multiline": {
43-
"max": 1,
44-
"allowFirstLine": false
45-
}
41+
singleline: 2,
42+
multiline: {
43+
max: 1,
44+
allowFirstLine: false,
45+
},
4646
}],
4747
// Warn
4848
'vue/require-default-prop': 'warn',

generator/index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module.exports = (api, options, rootOptions) => {
2222
'graphql-type-json': '^0.2.1',
2323
},
2424
scripts: {
25-
'apollo': 'vue-cli-service apollo:dev --generate-schema',
25+
apollo: 'vue-cli-service apollo:dev --generate-schema',
2626
'apollo:start': 'vue-cli-service apollo:start',
2727
'apollo:schema:generate': 'vue-cli-service apollo:schema:generate',
2828
// 'apollo:client:check': 'vue-cli-service apollo:client:check',
@@ -57,9 +57,9 @@ module.exports = (api, options, rootOptions) => {
5757
if (options.addExamples) {
5858
api.extendPackage({
5959
dependencies: {
60-
'lowdb': '^1.0.0',
61-
'mkdirp': '^0.5.1',
62-
'shortid': '^2.2.8',
60+
lowdb: '^1.0.0',
61+
mkdirp: '^0.5.1',
62+
shortid: '^2.2.8',
6363
},
6464
})
6565

@@ -102,10 +102,10 @@ module.exports = (api, options, rootOptions) => {
102102
}
103103

104104
const file = tsExists ? 'src/main.ts' : 'src/main.js'
105-
api.injectImports(file, `import { createProvider } from './vue-apollo'`)
106-
api.injectRootOptions(file, `apolloProvider: createProvider(),`)
105+
api.injectImports(file, 'import { createProvider } from \'./vue-apollo\'')
106+
api.injectRootOptions(file, 'apolloProvider: createProvider(),')
107107
} catch (e) {
108-
api.exitLog(`Your main file couldn't be modified. You will have to edit the code yourself: https://github.com/Akryum/vue-cli-plugin-apollo#manual-code-changes`, 'warn')
108+
api.exitLog('Your main file couldn\'t be modified. You will have to edit the code yourself: https://github.com/Akryum/vue-cli-plugin-apollo#manual-code-changes', 'warn')
109109
}
110110

111111
api.onCreateComplete(async () => {

graphql-client/src/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,14 @@ export function createApolloClient ({
141141
operation === 'subscription'
142142
},
143143
wsLink,
144-
link
144+
link,
145145
)
146146
}
147147
}
148148
}
149149

150150
if (clientState) {
151-
console.warn(`clientState is deprecated, see https://vue-cli-plugin-apollo.netlify.com/guide/client-state.html`)
151+
console.warn('clientState is deprecated, see https://vue-cli-plugin-apollo.netlify.com/guide/client-state.html')
152152
stateLink = withClientState({
153153
cache,
154154
...clientState,
@@ -206,7 +206,7 @@ export function restartWebsockets (wsClient) {
206206
wsClient.sendMessage(
207207
id,
208208
MessageTypes.GQL_START,
209-
operations[id].options
209+
operations[id].options,
210210
)
211211
})
212212
}

graphql-server/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module.exports = (options, cb = null) => {
3232
} catch (e) {
3333
if (process.env.NODE_ENV !== 'production' && !options.quiet) {
3434
console.log(chalk.yellow('Using default PubSub implementation for subscriptions.'))
35-
console.log(chalk.grey(`You should provide a different implementation in production (for example with Redis) by exporting it in 'apollo-server/pubsub.js'.`))
35+
console.log(chalk.grey('You should provide a different implementation in production (for example with Redis) by exporting it in \'apollo-server/pubsub.js\'.'))
3636
}
3737
}
3838
let dataSources
@@ -112,9 +112,9 @@ module.exports = (options, cb = null) => {
112112

113113
if (!options.quiet) {
114114
if (process.env.NODE_ENV === 'production') {
115-
console.warn(`Automatic mocking is enabled, consider disabling it with the 'enableMocks' option.`)
115+
console.warn('Automatic mocking is enabled, consider disabling it with the \'enableMocks\' option.')
116116
} else {
117-
console.log(`✔️ Automatic mocking is enabled`)
117+
console.log('✔️ Automatic mocking is enabled')
118118
}
119119
}
120120
}
@@ -127,7 +127,7 @@ module.exports = (options, cb = null) => {
127127
schemaTag: options.schemaTag,
128128
...options.engineOptions || {},
129129
}
130-
console.log(`✔️ Apollo Engine is enabled`)
130+
console.log('✔️ Apollo Engine is enabled')
131131
} else if (!options.quiet) {
132132
console.log(chalk.yellow('Apollo Engine key not found.') + `To enable Engine, set the ${chalk.cyan('VUE_APP_APOLLO_ENGINE_KEY')} env variable.`)
133133
console.log('Create a key at https://engine.apollographql.com/')
@@ -201,7 +201,7 @@ function processSchema (typeDefs) {
201201
function removeFromSchema (document, kind, name) {
202202
const definitions = document.definitions
203203
const index = definitions.findIndex(
204-
def => def.kind === kind && def.name.kind === 'Name' && def.name.value === name
204+
def => def.kind === kind && def.name.kind === 'Name' && def.name.value === name,
205205
)
206206
if (index !== -1) {
207207
definitions.splice(index, 1)

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,14 @@ module.exports = (api, options) => {
130130
})
131131
},
132132
onCrash: () => {
133-
console.log(chalk.bold(chalk.red(`💥 GraphQL API crashed!`)))
133+
console.log(chalk.bold(chalk.red('💥 GraphQL API crashed!')))
134134
sendIpcMessage({
135135
urls: null,
136136
error: true,
137137
})
138138
},
139139
onRestart: () => {
140-
console.log(chalk.bold(chalk.green(`⏳ GraphQL API is restarting...`)))
140+
console.log(chalk.bold(chalk.green('⏳ GraphQL API is restarting...')))
141141
sendIpcMessage({
142142
error: false,
143143
})
@@ -237,7 +237,7 @@ module.exports = (api, options) => {
237237
options: SCHEMA_OPTIONS,
238238
details: 'For more info, see https://github.com/Akryum/vue-cli-plugin-apollo',
239239
}, async args => {
240-
throw new Error(`Not implemented yet`)
240+
throw new Error('Not implemented yet')
241241

242242
/* eslint-disable no-unreachable */
243243

prompts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ module.exports = [
4343
type: 'input',
4444
name: 'apolloEngineKey',
4545
message: 'API Key:',
46-
description: `It should look like this: 'service:name-xxxx:xxxxxxxxxxxxxxxxxxxxxx'`,
46+
description: 'It should look like this: \'service:name-xxxx:xxxxxxxxxxxxxxxxxxxxxx\'',
4747
group: 'GraphQL Server',
4848
validate: input => !!input,
4949
when: answers => answers.addApolloEngine,

ui/tasks.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ module.exports = api => {
3333
})
3434

3535
function onGraphqlServerMessage ({ data }) {
36-
let message = data['org.akryum.vue-apollo']
36+
const message = data['org.akryum.vue-apollo']
3737
if (message) {
3838
ifDef(message.urls, value => setSharedData('urls', value))
3939
ifDef(message.error, value => setSharedData('error', value))
@@ -286,7 +286,7 @@ module.exports = api => {
286286
id: OPEN_ENGINE,
287287
type: 'action',
288288
label: 'Open Apollo Engine',
289-
message: `Apollo Engine is a cloud service that provides deep insights into your GraphQL layer, with performance and error analytics.`,
289+
message: 'Apollo Engine is a cloud service that provides deep insights into your GraphQL layer, with performance and error analytics.',
290290
image: '/_plugin/vue-cli-plugin-apollo/apollo-engine.png',
291291
link: 'https://www.apollographql.com/engine',
292292
actionLink: `${ENGINE_FRONTEND}/service/${env.VUE_APP_APOLLO_ENGINE_SERVICE}`,
@@ -304,7 +304,7 @@ module.exports = api => {
304304
id: PUBLISH_SCHEMA_TIP,
305305
type: 'action',
306306
label: 'Publish your schema',
307-
message: `You can publish your schema to Apollo Engine with the 'apollo:schema:publish' task.`,
307+
message: 'You can publish your schema to Apollo Engine with the \'apollo:schema:publish\' task.',
308308
image: '/_plugin/vue-cli-plugin-apollo/publish-task.png',
309309
handler () {
310310
api.requestRoute({

ui/widgets.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module.exports = api => {
2929
id: 'engine-key-metrics',
3030
title: 'Engine Key Metrics',
3131
description: 'Get Engine analytics at a glance',
32-
longDescription: `Displays key metrics of the Apollo Engine metrics. You can choose between different types of metrics.`,
32+
longDescription: 'Displays key metrics of the Apollo Engine metrics. You can choose between different types of metrics.',
3333
link: 'https://www.apollographql.com/engine',
3434
component: 'org.akryum.vue-apollo.components.widgets.engine-key-metrics',
3535
minWidth: 2,

utils/check-schema.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module.exports = async ({ endpoint, key, tag, engineEndpoint }) => {
22
const execa = require('execa')
33
const { logWithSpinner, stopSpinner, done } = require('@vue/cli-shared-utils')
44

5-
logWithSpinner('📡', `Comparing schema from Engine...`)
5+
logWithSpinner('📡', 'Comparing schema from Engine...')
66
await execa('apollo', [
77
'client:check',
88
`--endpoint=${endpoint}`,

utils/engine-api.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const { print } = require('graphql')
55

66
const ENGINE_ENDPOINT = process.env.APOLLO_ENGINE_API_ENDPOINT || 'https://engine-graphql.apollographql.com/api/graphql/'
77

8-
let engineLink = createHttpLink({
8+
const engineLink = createHttpLink({
99
uri: ENGINE_ENDPOINT,
1010
fetch,
1111
})
@@ -21,13 +21,13 @@ exports.execute = async ({ query, variables, key }) => {
2121
uri: ENGINE_ENDPOINT,
2222
},
2323
},
24-
})
24+
}),
2525
)
2626
if (process.env.VUE_APP_CLI_UI_DEBUG) {
27-
console.log(`${ENGINE_ENDPOINT}\n`, print(query), `\nKey: ${key}`, `\nVariables:\n`, variables, `\nResponse:\n`, response)
27+
console.log(`${ENGINE_ENDPOINT}\n`, print(query), `\nKey: ${key}`, '\nVariables:\n', variables, '\nResponse:\n', response)
2828
}
2929
if (response.errors) {
30-
const error = new Error(`Errors were returned from API`)
30+
const error = new Error('Errors were returned from API')
3131
error.response = response
3232
console.log(response.errors)
3333
throw error

utils/generate-schema.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,22 @@ module.exports = async (options) => {
2020
})
2121

2222
// JSON schema
23-
logWithSpinner(`📄`, 'Generating JSON file...')
23+
logWithSpinner('📄', 'Generating JSON file...')
2424
await fs.ensureDir(path.dirname(options.jsonOutput))
2525
const result = await graphql(schema, introspectionQuery)
2626
fs.writeFileSync(
2727
options.jsonOutput,
28-
JSON.stringify(result, null, 2)
28+
JSON.stringify(result, null, 2),
2929
)
3030
stopSpinner()
3131
done(`Generated ${options.jsonOutput}`)
3232

3333
// GraphQL schema
34-
logWithSpinner(`📄`, 'Generating GraphQL file...')
34+
logWithSpinner('📄', 'Generating GraphQL file...')
3535
await fs.ensureDir(path.dirname(options.graphqlOutput))
3636
fs.writeFileSync(
3737
options.graphqlOutput,
38-
printSchema(schema)
38+
printSchema(schema),
3939
)
4040
stopSpinner()
4141
done(`Generated ${options.graphqlOutput}`)

utils/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function sendIpcMessage (message) {
5555
}
5656

5757
function getFlatArgs (args, ignore) {
58-
let flatArgs = []
58+
const flatArgs = []
5959
for (const key in args) {
6060
if (ignore.includes(key)) continue
6161
const value = args[key]
@@ -117,7 +117,7 @@ function runWatch (api, options, {
117117

118118
nodemon.on('crash', () => {
119119
onCrash && onCrash()
120-
console.log(chalk.red(` Waiting for changes...`))
120+
console.log(chalk.red(' Waiting for changes...'))
121121
})
122122

123123
nodemon.on('stdout', (...args) => {
@@ -158,7 +158,7 @@ function getServerOptions (api, options, args) {
158158
// Plugin options
159159
const { apolloOptions, baseFolder } = getBasicServerOptions(api, options, args)
160160

161-
let engineOptions = Object.assign({}, apolloOptions.engineOptions)
161+
const engineOptions = Object.assign({}, apolloOptions.engineOptions)
162162
if (!engineOptions.endpointUrl && process.env.APOLLO_ENGINE_TRACING_ENDPOINT) {
163163
engineOptions.endpointUrl = process.env.APOLLO_ENGINE_TRACING_ENDPOINT
164164
}

utils/publish-schema.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module.exports = async ({ endpoint, key, tag, engineEndpoint }) => {
22
const execa = require('execa')
33
const { logWithSpinner, stopSpinner, done } = require('@vue/cli-shared-utils')
44

5-
logWithSpinner('⬆️', `Publishing schema to Engine...`)
5+
logWithSpinner('⬆️', 'Publishing schema to Engine...')
66
await execa('apollo', [
77
'schema:publish',
88
`--endpoint=${endpoint}`,

0 commit comments

Comments
 (0)