From e7cc2757c3aea7076b82fc9c65700d48eab01586 Mon Sep 17 00:00:00 2001 From: pooya parsa Date: Wed, 10 Jul 2019 15:15:49 +0430 Subject: [PATCH] refactor: update eslint-config to 1.x Co-authored-by: Alexander Lichter --- babel.config.js | 2 +- distributions/nuxt-start/package.js | 2 +- distributions/nuxt-ts/package.js | 2 +- distributions/nuxt/package.js | 2 +- .../async-component-injection/pages/_slug.vue | 2 +- examples/async-data/pages/posts/_id.vue | 4 +- examples/async-data/pages/posts/index.vue | 2 +- examples/auth-jwt/pages/index.vue | 2 +- examples/auth-jwt/pages/login.vue | 2 +- examples/auth-jwt/store/index.js | 4 +- examples/auth-routes/pages/index.vue | 6 +- examples/auth-routes/store/index.js | 8 +- examples/axios/pages/index.vue | 2 +- examples/cached-components/pages/index.vue | 4 +- examples/coffeescript/modules/coffeescript.js | 2 +- examples/custom-build/nuxt.config.js | 2 +- examples/custom-layouts/pages/about.vue | 2 +- .../custom-loading/components/loading.vue | 4 +- examples/custom-loading/pages/about.vue | 2 +- examples/custom-loading/pages/index.vue | 2 +- examples/custom-page-loading/pages/about.vue | 6 +- examples/custom-page-loading/pages/index.vue | 2 +- examples/custom-routes/pages/index.vue | 2 +- examples/custom-routes/pages/users/_id.vue | 4 +- examples/docker-build/nuxt.config.js | 2 +- .../dynamic-components/components/chart.js | 2 +- .../dynamic-components/components/image.vue | 2 +- examples/dynamic-components/js/messages.js | 4 +- examples/dynamic-components/pages/index.vue | 2 +- examples/dynamic-layouts/pages/about.vue | 2 +- examples/hello-world/pages/about.vue | 2 +- examples/i18n/middleware/i18n.js | 4 +- examples/i18n/pages/_lang/about.vue | 2 +- examples/i18n/pages/_lang/index.vue | 2 +- examples/i18n/store/index.js | 4 +- examples/jest-puppeteer/pages/about.vue | 2 +- .../jest-vtu-example/components/Btn/Btn.vue | 2 +- examples/jsx/pages/about.js | 2 +- examples/jsx/pages/index.js | 2 +- examples/layout-transitions/pages/users-2.vue | 8 +- examples/layout-transitions/pages/users.vue | 6 +- examples/markdownit/pages/index.vue | 2 +- examples/markdownit/pages/pug.vue | 2 +- examples/middleware/components/Visits.vue | 4 +- examples/middleware/pages/_slug.vue | 2 +- examples/middleware/store/index.js | 2 +- examples/named-views/nuxt.config.js | 2 +- .../pages/index/child/_id/index.vue | 4 +- examples/nested-routes/pages/index.vue | 2 +- examples/nested-routes/pages/index/_id.vue | 6 +- examples/nuxt-prefetch/pages/accelerated.vue | 2 +- examples/nuxt-prefetch/pages/active.vue | 2 +- examples/nuxt-prefetch/pages/agile.vue | 2 +- examples/nuxt-prefetch/pages/brisk.vue | 2 +- examples/nuxt-prefetch/pages/dashing.vue | 2 +- examples/nuxt-prefetch/pages/electric.vue | 2 +- examples/nuxt-prefetch/pages/flashing.vue | 2 +- examples/nuxt-prefetch/pages/fleet.vue | 2 +- examples/nuxt-prefetch/pages/fleeting.vue | 2 +- examples/nuxt-prefetch/pages/flying.vue | 2 +- examples/nuxt-prefetch/pages/hot.vue | 2 +- examples/nuxt-prefetch/pages/hurried.vue | 2 +- examples/nuxt-prefetch/pages/index.vue | 2 +- examples/nuxt-prefetch/pages/nimble.vue | 2 +- examples/nuxt-prefetch/pages/quick.vue | 2 +- examples/nuxt-prefetch/pages/racing.vue | 2 +- examples/nuxt-prefetch/pages/rapid.vue | 2 +- examples/nuxt-prefetch/pages/ready.vue | 2 +- examples/nuxt-prefetch/pages/snap.vue | 2 +- examples/nuxt-prefetch/pages/swift.vue | 2 +- examples/nuxt-prefetch/pages/winged.vue | 2 +- examples/plugins-vendor/pages/about.vue | 2 +- examples/plugins-vendor/pages/index.vue | 2 +- examples/pug/pages/about.vue | 2 +- examples/routes-meta/store/index.js | 2 +- examples/routes-transitions/pages/users.vue | 6 +- examples/scroll-behavior/pages/users.vue | 6 +- examples/spa/pages/about.vue | 2 +- examples/static-images/pages/about.vue | 2 +- examples/storybook/components/LineChart.js | 2 +- examples/storybook/layouts/default.vue | 2 +- .../storybook/stories/collection.story.js | 18 ++-- examples/storybook/stories/vuetify.story.js | 4 +- examples/styled-vue/pages/index.vue | 2 +- .../tailwindcss-purgecss/postcss.config.js | 2 +- examples/tailwindcss-purgecss/tailwind.js | 2 +- examples/tailwindcss/tailwind.js | 2 +- examples/uikit/pages/about.vue | 2 +- examples/vue-apollo/pages/car/_id.vue | 6 +- examples/vue-chartjs/components/bar-chart.js | 2 +- .../vue-chartjs/components/doughnut-chart.js | 2 +- examples/vue-chartjs/pages/contributors.vue | 4 +- examples/vue-chartjs/pages/index.vue | 2 +- .../vue-class-component/components/Base.vue | 6 +- .../vue-class-component/components/Child.vue | 2 +- examples/vue-class-component/pages/index.vue | 2 +- examples/vuex-store/pages/index.vue | 4 +- examples/vuex-store/pages/todos.vue | 2 +- examples/vuex-store/store/articles.js | 4 +- .../vuex-store/store/articles/comments.js | 2 +- .../store/articles/comments/mutations.js | 2 +- examples/vuex-store/store/index.js | 2 +- examples/vuex-store/store/todos/getters.js | 2 +- examples/vuex-store/store/todos/mutations.js | 4 +- examples/with-ava/pages/index.vue | 2 +- examples/with-cookies/pages/index.vue | 8 +- examples/with-cookies/plugins/cookies.js | 4 +- examples/with-element-ui/pages/index.vue | 6 +- examples/with-firebase/pages/index.vue | 2 +- examples/with-firebase/pages/users/_key.vue | 2 +- examples/with-keep-alive/pages/about.vue | 2 +- examples/with-museui/pages/index.vue | 4 +- examples/with-purgecss/nuxt.config.js | 4 +- examples/with-purgecss/tailwind.js | 2 +- examples/with-sockets/pages/index.vue | 12 +-- examples/with-tape/pages/index.vue | 4 +- examples/with-vuetify/layouts/default.vue | 2 +- examples/with-vux/nuxt.config.js | 2 +- examples/with-vux/pages/index.vue | 4 +- package.json | 2 +- packages/babel-preset-app/src/index.js | 4 +- .../babel-preset-app/src/polyfills-plugin.js | 2 +- packages/builder/src/builder.js | 52 ++++----- packages/builder/src/context/build.js | 6 +- packages/builder/src/context/template.js | 6 +- packages/builder/src/ignore.js | 14 +-- packages/cli/src/command.js | 34 +++--- packages/cli/src/commands/build.js | 10 +- packages/cli/src/commands/dev.js | 12 +-- packages/cli/src/commands/generate.js | 8 +- packages/cli/src/commands/help.js | 2 +- packages/cli/src/commands/index.js | 2 +- packages/cli/src/commands/start.js | 2 +- packages/cli/src/imports.js | 2 +- packages/cli/src/list.js | 2 +- packages/cli/src/options/common.js | 4 +- packages/cli/src/options/server.js | 4 +- packages/cli/src/run.js | 4 +- packages/cli/src/setup.js | 4 +- packages/cli/src/utils/banner.js | 2 +- packages/cli/src/utils/config.js | 2 +- packages/cli/src/utils/formatting.js | 18 ++-- packages/cli/src/utils/index.js | 8 +- packages/cli/src/utils/memory.js | 6 +- packages/cli/src/utils/typescript.js | 6 +- packages/cli/test/utils/mocking.js | 10 +- packages/config/src/config/index.js | 2 +- packages/config/src/options.js | 2 +- packages/core/src/hookable.js | 14 +-- packages/core/src/module.js | 26 ++--- packages/core/src/nuxt.js | 12 +-- packages/core/src/resolver.js | 10 +- packages/core/test/module.test.js | 2 +- packages/generator/src/generator.js | 22 ++-- packages/server/src/context.js | 2 +- packages/server/src/jsdom.js | 4 +- packages/server/src/listener.js | 10 +- packages/server/src/middleware/error.js | 4 +- packages/server/src/middleware/nuxt.js | 2 +- packages/server/src/middleware/timing.js | 8 +- packages/server/src/server.js | 18 ++-- packages/typescript/src/index.js | 2 +- packages/utils/src/cjs.js | 4 +- packages/utils/src/context.js | 4 +- packages/utils/src/lang.js | 8 +- packages/utils/src/locking.js | 10 +- packages/utils/src/resolve.js | 14 +-- packages/utils/src/route.js | 12 +-- packages/utils/src/serialize.js | 4 +- packages/utils/src/task.js | 6 +- packages/utils/src/timer.js | 16 +-- packages/utils/test/locking.test.js | 2 +- packages/utils/test/serialize.test.js | 10 +- packages/vue-renderer/src/renderer.js | 36 +++---- packages/vue-renderer/src/renderers/base.js | 8 +- packages/vue-renderer/src/renderers/modern.js | 18 ++-- packages/vue-renderer/src/renderers/spa.js | 12 +-- packages/vue-renderer/src/renderers/ssr.js | 16 +-- packages/webpack/src/builder.js | 18 ++-- packages/webpack/src/config/base.js | 44 ++++---- packages/webpack/src/config/client.js | 16 +-- packages/webpack/src/config/modern.js | 6 +- packages/webpack/src/config/server.js | 18 ++-- packages/webpack/src/plugins/vue/client.js | 4 +- packages/webpack/src/plugins/vue/cors.js | 4 +- packages/webpack/src/plugins/vue/modern.js | 12 +-- packages/webpack/src/plugins/vue/server.js | 4 +- .../webpack/src/plugins/warning-ignore.js | 4 +- packages/webpack/src/utils/perf-loader.js | 12 +-- packages/webpack/src/utils/postcss.js | 26 ++--- packages/webpack/src/utils/style-loader.js | 22 ++-- scripts/changelog.js | 14 +-- scripts/dev.js | 2 +- scripts/link.js | 2 +- scripts/package.js | 46 ++++---- scripts/rollup.config.js | 4 +- test/fixtures/basic/layouts/custom.js | 2 +- test/fixtures/basic/nuxt.config.js | 12 +-- test/fixtures/basic/pages/async-data.vue | 2 +- .../fixtures/basic/pages/await-async-data.vue | 2 +- .../basic/pages/callback-async-data.vue | 2 +- test/fixtures/basic/pages/config.vue | 6 +- test/fixtures/basic/pages/custom.js | 2 +- test/fixtures/basic/pages/error-midd.vue | 2 +- test/fixtures/basic/pages/error-object.vue | 2 +- test/fixtures/basic/pages/error-string.vue | 2 +- test/fixtures/basic/pages/error.vue | 2 +- test/fixtures/basic/pages/error2.vue | 2 +- test/fixtures/basic/pages/fetch.vue | 6 +- test/fixtures/basic/pages/fn-midd.vue | 4 +- test/fixtures/basic/pages/jsx.js | 2 +- test/fixtures/basic/pages/noloading.vue | 4 +- .../basic/pages/redirect-external.vue | 2 +- .../basic/pages/redirect-middleware.vue | 2 +- test/fixtures/basic/pages/redirect-name.vue | 2 +- test/fixtures/basic/pages/redirect.vue | 2 +- test/fixtures/basic/pages/router-guard.vue | 2 +- test/fixtures/basic/pages/special-state.vue | 2 +- test/fixtures/basic/pages/stateful.vue | 4 +- test/fixtures/basic/pages/store-module.vue | 2 +- test/fixtures/basic/pages/users/_id.vue | 4 +- test/fixtures/basic/pages/validate-async.vue | 2 +- test/fixtures/basic/pages/validate.vue | 2 +- test/fixtures/basic/plugins/inject.js | 2 +- test/fixtures/basic/plugins/vuex-module.js | 4 +- test/fixtures/basic/store/bab/index.js | 2 +- test/fixtures/basic/store/foo/bar.js | 2 +- test/fixtures/basic/store/foo/blarg.js | 2 +- .../fixtures/basic/store/foo/blarg/getters.js | 2 +- test/fixtures/basic/store/foo/blarg/index.js | 2 +- test/fixtures/basic/store/index.js | 4 +- test/fixtures/children/pages/parent.vue | 2 +- test/fixtures/children/pages/parent/_id.vue | 2 +- .../children/pages/parent/validate-child.vue | 2 +- test/fixtures/children/pages/patch.vue | 2 +- test/fixtures/children/pages/patch/_id.vue | 2 +- .../children/pages/patch/_id/child.vue | 2 +- .../children/pages/patch/_id/child/_slug.vue | 12 +-- test/fixtures/cli/cli.build.config.js | 2 +- test/fixtures/cli/cli.gen.config.js | 2 +- test/fixtures/cli/nuxt.config.js | 2 +- .../fixtures/config-explicit/pages/config.vue | 6 +- .../custom-dirs/custom-pages/user-agent.vue | 2 +- .../custom-dirs/custom-store/index.js | 2 +- test/fixtures/modern/pages/index.vue | 2 +- test/fixtures/module/modules/basic/index.js | 2 +- test/fixtures/module/modules/basic/reverse.js | 2 +- test/fixtures/module/modules/empty/index.js | 2 +- test/fixtures/module/modules/layout/index.js | 2 +- .../module/modules/middleware/index.js | 4 +- .../module/modules/middleware/midd3.js | 2 +- test/fixtures/module/nuxt.config.js | 2 +- test/fixtures/module/router.js | 2 +- test/fixtures/named-views/nuxt.config.js | 2 +- .../pages/index/child/_id/index.vue | 4 +- test/fixtures/spa/nuxt.config.js | 2 +- test/fixtures/spa/pages/async.vue | 4 +- test/fixtures/spa/pages/custom.vue | 4 +- .../spa/pages/error-handler-async.vue | 4 +- .../spa/pages/error-handler-object.vue | 2 +- .../spa/pages/error-handler-string.vue | 2 +- test/fixtures/spa/pages/error-handler.vue | 4 +- test/fixtures/spa/pages/index.vue | 2 +- test/fixtures/spa/pages/mounted.vue | 4 +- test/fixtures/spa/pages/redirect-done.vue | 4 +- test/fixtures/spa/pages/тест雨.vue | 2 +- test/fixtures/ssr/components/test.vue | 2 +- test/fixtures/ssr/pages/asyncData.vue | 2 +- test/fixtures/ssr/pages/data.vue | 2 +- test/fixtures/ssr/pages/fetch.vue | 2 +- test/fixtures/ssr/store/index.js | 4 +- .../with-config/components/loading.vue | 4 +- test/fixtures/with-config/nuxt.config.js | 8 +- test/fixtures/with-config/pages/about.vue | 2 +- test/fixtures/with-config/pages/env.vue | 4 +- test/fixtures/with-config/pages/error.vue | 2 +- .../fixtures/with-config/pages/user-agent.vue | 2 +- test/fixtures/with-config/store/index.js | 2 +- test/unit/basic.dev.test.js | 2 +- test/unit/basic.fail.generate.test.js | 2 +- test/unit/basic.ssr.test.js | 4 +- test/unit/extract-css.test.js | 2 +- test/unit/filenames-query-part.test.js | 2 +- test/unit/generator.test.js | 6 +- test/utils/browser.js | 24 ++--- test/utils/chrome.js | 24 ++--- test/utils/index.js | 4 +- test/utils/setup.js | 2 +- yarn.lock | 101 ++++++++++++++++-- 289 files changed, 831 insertions(+), 742 deletions(-) diff --git a/babel.config.js b/babel.config.js index a6f2bd372a..a3f41eae70 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,4 +1,4 @@ -function isBabelLoader(caller) { +function isBabelLoader (caller) { return caller && caller.name === 'babel-loader' } diff --git a/distributions/nuxt-start/package.js b/distributions/nuxt-start/package.js index 2142a3cbe2..2cf87382f8 100644 --- a/distributions/nuxt-start/package.js +++ b/distributions/nuxt-start/package.js @@ -1,7 +1,7 @@ export default { build: true, hooks: { - async 'build:done'(pkg) { + async 'build:done' (pkg) { const mono = pkg.load('../..') const nuxt = pkg.load('../nuxt') diff --git a/distributions/nuxt-ts/package.js b/distributions/nuxt-ts/package.js index 7ec679a347..1d36d3a987 100644 --- a/distributions/nuxt-ts/package.js +++ b/distributions/nuxt-ts/package.js @@ -1,7 +1,7 @@ export default { build: false, hooks: { - async 'build:done'(pkg) { + async 'build:done' (pkg) { const mono = pkg.load('../..') const nuxt = pkg.load('../nuxt') diff --git a/distributions/nuxt/package.js b/distributions/nuxt/package.js index 53aeeab1ec..e082988663 100644 --- a/distributions/nuxt/package.js +++ b/distributions/nuxt/package.js @@ -1,7 +1,7 @@ export default { build: true, hooks: { - async 'build:done'(pkg) { + async 'build:done' (pkg) { const mono = pkg.load('../..') await pkg.copyFilesFrom(mono, [ diff --git a/examples/async-component-injection/pages/_slug.vue b/examples/async-component-injection/pages/_slug.vue index 9ac714694a..120d8f32ce 100644 --- a/examples/async-component-injection/pages/_slug.vue +++ b/examples/async-component-injection/pages/_slug.vue @@ -12,7 +12,7 @@ const getPost = slug => ({ }) export default { - beforeCreate() { + beforeCreate () { this.component = () => getPost(this.$route.params.slug) } } diff --git a/examples/async-data/pages/posts/_id.vue b/examples/async-data/pages/posts/_id.vue index c7deb9f3da..c391a073a9 100644 --- a/examples/async-data/pages/posts/_id.vue +++ b/examples/async-data/pages/posts/_id.vue @@ -15,12 +15,12 @@ import axios from 'axios' export default { - async asyncData({ params }) { + async asyncData ({ params }) { // We can use async/await ES6 feature const { data } = await axios.get(`https://jsonplaceholder.typicode.com/posts/${params.id}`) return { post: data } }, - head() { + head () { return { title: this.post.title } diff --git a/examples/async-data/pages/posts/index.vue b/examples/async-data/pages/posts/index.vue index 7a375b422e..b026891f03 100644 --- a/examples/async-data/pages/posts/index.vue +++ b/examples/async-data/pages/posts/index.vue @@ -21,7 +21,7 @@ import axios from 'axios' export default { - asyncData({ req, params }) { + asyncData ({ req, params }) { // We can return a Promise instead of calling the callback return axios.get('https://jsonplaceholder.typicode.com/posts') .then((res) => { diff --git a/examples/auth-jwt/pages/index.vue b/examples/auth-jwt/pages/index.vue index a45edb3063..d75075dc90 100644 --- a/examples/auth-jwt/pages/index.vue +++ b/examples/auth-jwt/pages/index.vue @@ -25,7 +25,7 @@ const Cookie = process.client ? require('js-cookie') : undefined export default { methods: { - logout() { + logout () { Cookie.remove('auth') this.$store.commit('setAuth', null) } diff --git a/examples/auth-jwt/pages/login.vue b/examples/auth-jwt/pages/login.vue index 5a64ecb8c8..be11d62eb5 100644 --- a/examples/auth-jwt/pages/login.vue +++ b/examples/auth-jwt/pages/login.vue @@ -22,7 +22,7 @@ const Cookie = process.client ? require('js-cookie') : undefined export default { middleware: 'notAuthenticated', methods: { - postLogin() { + postLogin () { setTimeout(() => { // we simulate the async request with timeout. const auth = { accessToken: 'someStringGotFromApiServiceWithAjax' diff --git a/examples/auth-jwt/store/index.js b/examples/auth-jwt/store/index.js index b37ced1dac..16a41ee1b2 100644 --- a/examples/auth-jwt/store/index.js +++ b/examples/auth-jwt/store/index.js @@ -6,12 +6,12 @@ export const state = () => { } } export const mutations = { - setAuth(state, auth) { + setAuth (state, auth) { state.auth = auth } } export const actions = { - nuxtServerInit({ commit }, { req }) { + nuxtServerInit ({ commit }, { req }) { let auth = null if (req.headers.cookie) { const parsed = cookieparser.parse(req.headers.cookie) diff --git a/examples/auth-routes/pages/index.vue b/examples/auth-routes/pages/index.vue index a04a30b509..99e0405d90 100644 --- a/examples/auth-routes/pages/index.vue +++ b/examples/auth-routes/pages/index.vue @@ -30,7 +30,7 @@ diff --git a/test/fixtures/spa/pages/error-handler-object.vue b/test/fixtures/spa/pages/error-handler-object.vue index 72ace409a7..61befefe5c 100644 --- a/test/fixtures/spa/pages/error-handler-object.vue +++ b/test/fixtures/spa/pages/error-handler-object.vue @@ -1,7 +1,7 @@ diff --git a/test/fixtures/spa/pages/index.vue b/test/fixtures/spa/pages/index.vue index c60926b6ac..cb0d3ede1e 100644 --- a/test/fixtures/spa/pages/index.vue +++ b/test/fixtures/spa/pages/index.vue @@ -4,7 +4,7 @@