diff --git a/webapp/components/AvatarMenu/AvatarMenu.vue b/webapp/components/AvatarMenu/AvatarMenu.vue index 393963997..7443c91a7 100644 --- a/webapp/components/AvatarMenu/AvatarMenu.vue +++ b/webapp/components/AvatarMenu/AvatarMenu.vue @@ -69,7 +69,7 @@ export default { if (!this.user.slug) { return [] } - let routes = [ + const routes = [ { name: this.$t('profile.name'), path: `/profile/${this.user.id}/${this.user.slug}`, diff --git a/webapp/components/Category/index.spec.js b/webapp/components/Category/index.spec.js index 7ce0b7243..13de0b690 100644 --- a/webapp/components/Category/index.spec.js +++ b/webapp/components/Category/index.spec.js @@ -9,7 +9,7 @@ describe('Category', () => { let icon let name - let Wrapper = () => { + const Wrapper = () => { return shallowMount(Category, { localVue, propsData: { diff --git a/webapp/components/ContentMenu.vue b/webapp/components/ContentMenu.vue index 521a8ed6e..72b514ce2 100644 --- a/webapp/components/ContentMenu.vue +++ b/webapp/components/ContentMenu.vue @@ -53,7 +53,7 @@ export default { }, computed: { routes() { - let routes = [] + const routes = [] if (this.resourceType === 'contribution') { if (this.isOwner) { diff --git a/webapp/components/ContributionForm/ContributionForm.vue b/webapp/components/ContributionForm/ContributionForm.vue index eb849c71f..f5a02e305 100644 --- a/webapp/components/ContributionForm/ContributionForm.vue +++ b/webapp/components/ContributionForm/ContributionForm.vue @@ -223,7 +223,7 @@ export default { this.form.teaserImage = file }, categoryIds(categories) { - let categoryIds = [] + const categoryIds = [] categories.map(categoryId => { categoryIds.push(categoryId.id) }) diff --git a/webapp/components/DeleteData/DeleteData.vue b/webapp/components/DeleteData/DeleteData.vue index f6e6d47f0..451a44eb4 100644 --- a/webapp/components/DeleteData/DeleteData.vue +++ b/webapp/components/DeleteData/DeleteData.vue @@ -101,7 +101,7 @@ export default { } }, handleSubmit() { - let resourceArgs = [] + const resourceArgs = [] if (this.deleteContributions) { resourceArgs.push('Post') } diff --git a/webapp/components/Editor/Editor.spec.js b/webapp/components/Editor/Editor.spec.js index 18eaef3b8..68ed6de53 100644 --- a/webapp/components/Editor/Editor.spec.js +++ b/webapp/components/Editor/Editor.spec.js @@ -79,7 +79,7 @@ describe('Editor.vue', () => { describe('limists suggestion list to 15 users', () => { beforeEach(() => { - let manyUsersList = [] + const manyUsersList = [] for (let i = 0; i < 25; i++) { manyUsersList.push({ id: `user${i}` }) } @@ -120,7 +120,7 @@ describe('Editor.vue', () => { describe('limists suggestion list to 15 hashtags', () => { beforeEach(() => { - let manyHashtagsList = [] + const manyHashtagsList = [] for (let i = 0; i < 25; i++) { manyHashtagsList.push({ id: `hashtag${i}` }) } diff --git a/webapp/components/Editor/plugins/eventHandler.js b/webapp/components/Editor/plugins/eventHandler.js index 807949aa8..4e2448d23 100644 --- a/webapp/components/Editor/plugins/eventHandler.js +++ b/webapp/components/Editor/plugins/eventHandler.js @@ -5,6 +5,7 @@ export default class EventHandler extends Extension { get name() { return 'event_handler' } + get plugins() { return [ new Plugin({ diff --git a/webapp/components/Hashtag/Hashtag.spec.js b/webapp/components/Hashtag/Hashtag.spec.js index cfd1a7c2a..a8b9f7641 100644 --- a/webapp/components/Hashtag/Hashtag.spec.js +++ b/webapp/components/Hashtag/Hashtag.spec.js @@ -10,7 +10,7 @@ config.stubs['nuxt-link'] = '' describe('Hashtag', () => { let id - let Wrapper = () => { + const Wrapper = () => { return shallowMount(Hashtag, { localVue, propsData: { diff --git a/webapp/components/LocaleSwitch/LocaleSwitch.vue b/webapp/components/LocaleSwitch/LocaleSwitch.vue index 38334621e..37a6c97e7 100644 --- a/webapp/components/LocaleSwitch/LocaleSwitch.vue +++ b/webapp/components/LocaleSwitch/LocaleSwitch.vue @@ -58,7 +58,7 @@ export default { return find(this.locales, { code: this.$i18n.locale() }) }, routes() { - let routes = this.locales.map(locale => { + const routes = this.locales.map(locale => { return { name: locale.name, path: locale.code, diff --git a/webapp/components/NotificationMenu/NotificationMenu.spec.js b/webapp/components/NotificationMenu/NotificationMenu.spec.js index 87576a5f3..6b19b7fb1 100644 --- a/webapp/components/NotificationMenu/NotificationMenu.spec.js +++ b/webapp/components/NotificationMenu/NotificationMenu.spec.js @@ -10,7 +10,7 @@ localVue.use(Styleguide) localVue.use(Filters) localVue.filter('truncate', string => string) -config.stubs['dropdown'] = '' +config.stubs.dropdown = '' describe('NotificationMenu.vue', () => { let wrapper diff --git a/webapp/components/Paginate/Paginate.spec.js b/webapp/components/Paginate/Paginate.spec.js index 034d33301..a71e8cec8 100644 --- a/webapp/components/Paginate/Paginate.spec.js +++ b/webapp/components/Paginate/Paginate.spec.js @@ -7,13 +7,13 @@ const localVue = createLocalVue() localVue.use(Styleguide) describe('Paginate.vue', () => { - let propsData, wrapper, Wrapper, nextButton, backButton + let propsData, wrapper, nextButton, backButton beforeEach(() => { propsData = {} }) - Wrapper = () => { + const Wrapper = () => { return mount(Paginate, { propsData, localVue }) } describe('mount', () => { diff --git a/webapp/components/RelativeDateTime/spec.js b/webapp/components/RelativeDateTime/spec.js index 15574f539..356ea8874 100644 --- a/webapp/components/RelativeDateTime/spec.js +++ b/webapp/components/RelativeDateTime/spec.js @@ -16,7 +16,7 @@ describe('RelativeDateTime', () => { } }) - let Wrapper = () => { + const Wrapper = () => { return shallowMount(RelativeDateTime, { mocks, localVue, diff --git a/webapp/components/Ribbon/index.spec.js b/webapp/components/Ribbon/index.spec.js index b1c519992..c642378f6 100644 --- a/webapp/components/Ribbon/index.spec.js +++ b/webapp/components/Ribbon/index.spec.js @@ -6,7 +6,7 @@ const localVue = createLocalVue() describe('Ribbon', () => { let text - let Wrapper = () => { + const Wrapper = () => { return shallowMount(Ribbon, { localVue, propsData: { diff --git a/webapp/components/TeaserImage/TeaserImage.vue b/webapp/components/TeaserImage/TeaserImage.vue index d7ba0e7d8..1b64073f2 100644 --- a/webapp/components/TeaserImage/TeaserImage.vue +++ b/webapp/components/TeaserImage/TeaserImage.vue @@ -64,7 +64,7 @@ export default { }, watch: { error() { - let that = this + const that = this setTimeout(function() { that.error = false }, 2000) diff --git a/webapp/components/Upload/index.vue b/webapp/components/Upload/index.vue index 3f84f8a7c..c348dda92 100644 --- a/webapp/components/Upload/index.vue +++ b/webapp/components/Upload/index.vue @@ -43,7 +43,7 @@ export default { }, watch: { error() { - let that = this + const that = this setTimeout(function() { that.error = false }, 2000) diff --git a/webapp/components/utils/ReportModal.spec.js b/webapp/components/utils/ReportModal.spec.js index de4277c4c..babfaa5cc 100644 --- a/webapp/components/utils/ReportModal.spec.js +++ b/webapp/components/utils/ReportModal.spec.js @@ -8,7 +8,7 @@ beforeEach(() => { }) describe('validReport', () => { - let validate = object => { + const validate = object => { const { formSchema } = validReport({ translate }) const validator = new Schema(formSchema) return validator.validate(object, { suppressWarning: true }).catch(({ errors }) => { diff --git a/webapp/components/utils/UniqueSlugForm.spec.js b/webapp/components/utils/UniqueSlugForm.spec.js index de0e3fee6..da65104fc 100644 --- a/webapp/components/utils/UniqueSlugForm.spec.js +++ b/webapp/components/utils/UniqueSlugForm.spec.js @@ -14,7 +14,7 @@ beforeEach(() => { }) describe('UniqueSlugForm', () => { - let validate = object => { + const validate = object => { const { formSchema } = UniqueSlugForm({ translate, apollo, currentUser }) const validator = new Schema(formSchema) return validator.validate(object, { suppressWarning: true }).catch(({ errors }) => { diff --git a/webapp/middleware/authenticated.js b/webapp/middleware/authenticated.js index f2273df58..91a230865 100644 --- a/webapp/middleware/authenticated.js +++ b/webapp/middleware/authenticated.js @@ -1,7 +1,7 @@ import isEmpty from 'lodash/isEmpty' export default async ({ store, env, route, redirect }) => { - let publicPages = env.publicPages + const publicPages = env.publicPages // only affect non public pages if (publicPages.indexOf(route.name) >= 0) { return true @@ -17,7 +17,7 @@ export default async ({ store, env, route, redirect }) => { // await store.dispatch('auth/logout', null, { root: true }) // set the redirect path for after the login - let params = {} + const params = {} if (!isEmpty(route.path) && route.path !== '/') { params.path = route.path } diff --git a/webapp/middleware/termsAndConditions.js b/webapp/middleware/termsAndConditions.js index 68ad49bf8..e056bf40a 100644 --- a/webapp/middleware/termsAndConditions.js +++ b/webapp/middleware/termsAndConditions.js @@ -1,7 +1,7 @@ import isEmpty from 'lodash/isEmpty' export default async ({ store, env, route, redirect }) => { - let publicPages = env.publicPages + const publicPages = env.publicPages // only affect non public pages if (publicPages.indexOf(route.name) >= 0) { return true @@ -11,7 +11,7 @@ export default async ({ store, env, route, redirect }) => { if (store.getters['auth/termsAndConditionsAgreed']) return true - let params = {} + const params = {} if (!isEmpty(route.path) && route.path !== '/') { params.path = route.path } diff --git a/webapp/package.json b/webapp/package.json index 1284f5b99..ea217436c 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -113,7 +113,7 @@ "css-loader": "~3.2.0", "eslint": "~6.6.0", "eslint-config-prettier": "~6.5.0", - "eslint-config-standard": "~12.0.0", + "eslint-config-standard": "~14.1.0", "eslint-loader": "~3.0.2", "eslint-plugin-import": "~2.18.2", "eslint-plugin-jest": "~23.0.4", diff --git a/webapp/pages/settings/index.vue b/webapp/pages/settings/index.vue index 934b10558..8ea6dddaf 100644 --- a/webapp/pages/settings/index.vue +++ b/webapp/pages/settings/index.vue @@ -117,7 +117,7 @@ export default { this.loadingData = true const { name, slug, about } = this.formData let { locationName } = this.formData || this.currentUser - locationName = locationName && (locationName['label'] || locationName) + locationName = locationName && (locationName.label || locationName) try { await this.$apollo.mutate({ mutation, @@ -154,7 +154,7 @@ export default { if (!res || !res.data || !res.data.features || !res.data.features.length) { return [] } - let output = [] + const output = [] res.data.features.forEach(item => { output.push({ label: item.place_name, diff --git a/webapp/store/posts.js b/webapp/store/posts.js index 25a48f0d5..0583388f7 100644 --- a/webapp/store/posts.js +++ b/webapp/store/posts.js @@ -25,7 +25,7 @@ export const state = () => { filter: { ...defaultFilter, }, - order: orderOptions['createdAt_desc'], + order: orderOptions.createdAt_desc, } } diff --git a/webapp/yarn.lock b/webapp/yarn.lock index 7e92d73fa..ae9933ca6 100644 --- a/webapp/yarn.lock +++ b/webapp/yarn.lock @@ -7059,10 +7059,10 @@ eslint-config-prettier@^6.0.0, eslint-config-prettier@~6.5.0: dependencies: get-stdin "^6.0.0" -eslint-config-standard@~12.0.0: - version "12.0.0" - resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-12.0.0.tgz#638b4c65db0bd5a41319f96bba1f15ddad2107d9" - integrity sha512-COUz8FnXhqFitYj4DTqHzidjIL/t4mumGZto5c7DrBpvWoie+Sn3P4sLEzUGeYhRElWuFEf8K1S1EfvD1vixCQ== +eslint-config-standard@~14.1.0: + version "14.1.0" + resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-14.1.0.tgz#b23da2b76fe5a2eba668374f246454e7058f15d4" + integrity sha512-EF6XkrrGVbvv8hL/kYa/m6vnvmUT+K82pJJc4JJVMM6+Qgqh0pnwprSxdduDLB9p/7bIxD+YV5O0wfb8lmcPbA== eslint-import-resolver-node@^0.3.2: version "0.3.2"