diff --git a/client/.eslintrc.js b/client/.eslintrc.js index 0c86ffaa..92ad96bd 100644 --- a/client/.eslintrc.js +++ b/client/.eslintrc.js @@ -11,7 +11,8 @@ module.exports = { extends: [ // https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention // consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules. - 'plugin:vue/essential', + 'plugin:vue/strongly-recommended', + // 'plugin:vue/recommended', // https://github.com/standard/standard/blob/master/docs/RULES-en.md 'standard' ], @@ -29,5 +30,46 @@ module.exports = { 'semi': 0, 'space-before-function-paren': 'off', 'comma-dangle': 'off', + + // vue rules + 'vue/require-prop-types': 'off', //todo: should we do this? + 'vue/require-default-prop': 'off', //todo: should we do this? + 'vue/attributes-order': ['error', { + 'order': [ + 'OTHER_ATTR', + 'DEFINITION', + 'LIST_RENDERING', + 'CONDITIONALS', + 'RENDER_MODIFIERS', + 'GLOBAL', + 'UNIQUE', + 'TWO_WAY_BINDING', + 'OTHER_DIRECTIVES', + 'EVENTS', + 'CONTENT' + ] + }], + 'vue/order-in-components': ['error', { + 'order': [ + 'el', + 'name', + 'parent', + 'functional', + ['delimiters', 'comments'], + ['props', 'propsData'], + 'mixins', + ['components', 'directives', 'filters'], + 'data', + 'extends', + 'inheritAttrs', + 'model', + 'computed', + 'watch', + 'LIFECYCLE_HOOKS', + 'methods', + ['template', 'render'], + 'renderError' + ] + }] } }; diff --git a/client/src/App.vue b/client/src/App.vue index b1acde34..b6fe73f8 100644 --- a/client/src/App.vue +++ b/client/src/App.vue @@ -1,9 +1,16 @@ diff --git a/client/src/components/AddContentButton.vue b/client/src/components/AddContentButton.vue index b93460f2..df53dc5a 100644 --- a/client/src/components/AddContentButton.vue +++ b/client/src/components/AddContentButton.vue @@ -1,7 +1,9 @@ diff --git a/client/src/components/AddContentElement.vue b/client/src/components/AddContentElement.vue index a1266a67..2f028056 100644 --- a/client/src/components/AddContentElement.vue +++ b/client/src/components/AddContentElement.vue @@ -1,6 +1,8 @@ diff --git a/client/src/components/AddWidget.vue b/client/src/components/AddWidget.vue index c84a70b9..2c915aa9 100644 --- a/client/src/components/AddWidget.vue +++ b/client/src/components/AddWidget.vue @@ -1,7 +1,11 @@ @@ -24,6 +28,10 @@ } }, + components: { + AddIcon + }, + computed: { component() { // only use the router link if the route prop is provided, otherwise render a normal anchor tag @@ -36,10 +44,6 @@ } : {} } }, - - components: { - AddIcon - } } diff --git a/client/src/components/AssignmentWithSubmissions.vue b/client/src/components/AssignmentWithSubmissions.vue index f058086c..fbdaca90 100644 --- a/client/src/components/AssignmentWithSubmissions.vue +++ b/client/src/components/AssignmentWithSubmissions.vue @@ -1,33 +1,41 @@