diff --git a/.eslintrc.js b/.eslintrc.js index 06874304a..f867aa193 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,67 +1,8 @@ module.exports = { - root: true, - env: { - browser: true, - es6: true, - node: true, - jest: true - }, - globals: { - t: true, - n: true, - OC: true, - OCA: true, - Vue: true, - VueRouter: true - }, - parserOptions: { - parser: 'babel-eslint', - ecmaVersion: 6 - }, extends: [ - 'eslint:recommended', - 'plugin:node/recommended', - 'plugin:vue/essential', - 'plugin:vue/recommended', - 'standard' + 'nextcloud' ], - plugins: ['vue', 'node'], rules: { - // space before function () - 'space-before-function-paren': ['error', 'never'], - // curly braces always space - 'object-curly-spacing': ['error', 'always'], - // stay consistent with array brackets - 'array-bracket-newline': ['error', 'consistent'], - // 1tbs brace style - 'brace-style': 'error', - // tabs only - indent: ['error', 'tab'], - 'no-tabs': 0, - 'vue/html-indent': ['error', 'tab'], - // only debug console - 'no-console': ['warn', { allow: ['error', 'warn', 'debug'] }], - // classes blocks - 'padded-blocks': ['error', { classes: 'always' }], - // always have the operator in front - 'operator-linebreak': ['error', 'before'], - // ternary on multiline - 'multiline-ternary': ['error', 'always-multiline'], - // es6 import/export and require - 'node/no-unpublished-require': ['off'], - 'node/no-unsupported-features/es-syntax': ['off'], - // space before self-closing elements - 'vue/html-closing-bracket-spacing': 'error', - // code spacing with attributes - 'vue/max-attributes-per-line': [ - 'error', - { - singleline: 3, - multiline: { - max: 3, - allowFirstLine: true - } - } - ] + 'valid-jsdoc': ['warn'], } } diff --git a/package-lock.json b/package-lock.json index e4981f728..ac2afc099 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6976,6 +6976,12 @@ } } }, + "eslint-config-nextcloud": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/eslint-config-nextcloud/-/eslint-config-nextcloud-0.1.1.tgz", + "integrity": "sha512-/1VAkt7Y/m63eZfBiYkSzZMwQtmz0DFXuJnLebrzIY1GtpIj/Y3c//j4ZDiH5o0vbdn9laIc2Mb/01DIjzvt3g==", + "dev": true + }, "eslint-config-standard": { "version": "12.0.0", "resolved": "http://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-12.0.0.tgz", @@ -7276,6 +7282,15 @@ } } }, + "eslint-plugin-nextcloud": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-nextcloud/-/eslint-plugin-nextcloud-0.3.0.tgz", + "integrity": "sha512-LUD2qdirGL0BRt4uaMDGxen17mWVq9JwuGDt7P7Celz7bzdu0X48RrS8mhXn9e0w78+nYN5kPoULG2Bw04r4HA==", + "dev": true, + "requires": { + "requireindex": "~1.2.0" + } + }, "eslint-plugin-node": { "version": "11.0.0", "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-11.0.0.tgz", @@ -15232,6 +15247,12 @@ "integrity": "sha1-eZlTn8ngR6N5KPoZb44VY9q9Nt4=", "dev": true }, + "requireindex": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/requireindex/-/requireindex-1.2.0.tgz", + "integrity": "sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==", + "dev": true + }, "resolve": { "version": "1.12.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz", diff --git a/package.json b/package.json index 74dedc976..542a049a8 100644 --- a/package.json +++ b/package.json @@ -62,10 +62,12 @@ "babel-loader": "^8.0.6", "css-loader": "^3.4.0", "eslint": "^6.8.0", + "eslint-config-nextcloud": "^0.1.1", "eslint-config-standard": "^12.0.0", "eslint-friendly-formatter": "^4.0.1", "eslint-loader": "^3.0.3", "eslint-plugin-import": "^2.19.1", + "eslint-plugin-nextcloud": "^0.3.0", "eslint-plugin-node": "^11.0.0", "eslint-plugin-promise": "^4.2.1", "eslint-plugin-standard": "^4.0.1", diff --git a/src/App.vue b/src/App.vue index 427877404..784f1a394 100644 --- a/src/App.vue +++ b/src/App.vue @@ -41,7 +41,7 @@ const boardApi = new BoardApi() export default { name: 'App', components: { - AppNavigation + AppNavigation, }, data: function() { return { @@ -54,19 +54,19 @@ export default { action: () => { }, reset: () => { - } + }, }, action: () => { this.addButton.classes.push('editing') - } - } + }, + }, } }, computed: { ...mapState({ navShown: state => state.navShown, sidebarShownState: state => state.sidebarShown, - currentBoard: state => state.currentBoard + currentBoard: state => state.currentBoard, }), // TODO: properly handle sidebar showing for route subview and board sidebar sidebarRouterView() { @@ -75,17 +75,17 @@ export default { }, sidebarShown() { return this.sidebarRouterView || this.sidebarShownState - } + }, }, provide: function() { return { - boardApi: boardApi + boardApi: boardApi, } }, created: function() { this.$store.dispatch('loadBoards') this.$store.dispatch('loadSharees') - } + }, } diff --git a/src/BoardSelector.vue b/src/BoardSelector.vue index 1422ee603..7e50bbe1c 100644 --- a/src/BoardSelector.vue +++ b/src/BoardSelector.vue @@ -25,10 +25,10 @@ @@ -71,19 +77,19 @@ export default { board: { type: Object, required: false, - default: null - } + default: null, + }, }, data() { return { newStackTitle: '', stack: '', - showArchived: false + showArchived: false, } }, computed: { ...mapState({ - compactMode: state => state.compactMode + compactMode: state => state.compactMode, }), archivStyle() { @@ -91,7 +97,7 @@ export default { return 'opacity: 1.0' } return 'opacity: 0.3' - } + }, }, methods: { toggleNav() { @@ -112,8 +118,8 @@ export default { this.$store.dispatch('createStack', this.stack) this.newStackTitle = '' this.stack = null - } - } + }, + }, } diff --git a/src/components/List.vue b/src/components/List.vue index fdfb710c5..dcfa29716 100644 --- a/src/components/List.vue +++ b/src/components/List.vue @@ -26,7 +26,7 @@ diff --git a/src/components/Sidebar.vue b/src/components/Sidebar.vue index 3a5234a00..b41af9c2c 100644 --- a/src/components/Sidebar.vue +++ b/src/components/Sidebar.vue @@ -30,8 +30,8 @@ export default { methods: { closeSidebar() { this.$router.push({ name: 'board' }) - } - } + }, + }, } diff --git a/src/components/board/Board.vue b/src/components/board/Board.vue index bbf397b96..0cf5de2c2 100644 --- a/src/components/board/Board.vue +++ b/src/components/board/Board.vue @@ -24,11 +24,11 @@
- - - - - + + + + +
@@ -51,30 +51,30 @@ export default { Controls, Container, Draggable, - Stack + Stack, }, inject: [ - 'boardApi' + 'boardApi', ], props: { id: { type: Number, - default: null - } + default: null, + }, }, data: function() { return { - loading: true + loading: true, } }, computed: { ...mapState({ board: state => state.currentBoard, - showArchived: state => state.showArchived + showArchived: state => state.showArchived, }), stacksByBoard() { return this.$store.getters.stacksByBoard(this.board.id) - } + }, /* cardsByStack() { return (id) => this.$store.getters.cardsByStack(id) } */ @@ -83,7 +83,7 @@ export default { id: 'fetchData', showArchived() { this.fetchData() - } + }, }, created() { this.fetchData() @@ -118,17 +118,17 @@ export default { } }, */ createStack() { - let newStack = { + const newStack = { title: 'FooBar', boardId: this.id, - order: this.stacksByBoard().length + order: this.stacksByBoard().length, } this.$store.dispatch('createStack', newStack) - } + }, /* deleteStack(stack) { this.$store.dispatch('deleteStack', stack) } */ - } + }, } diff --git a/src/components/board/BoardSidebar.vue b/src/components/board/BoardSidebar.vue index eab5c1f57..760bb4dce 100644 --- a/src/components/board/BoardSidebar.vue +++ b/src/components/board/BoardSidebar.vue @@ -21,11 +21,10 @@ --> diff --git a/src/components/board/DeletedTabSidebar.vue b/src/components/board/DeletedTabSidebar.vue index bfcbe132b..e1639236c 100644 --- a/src/components/board/DeletedTabSidebar.vue +++ b/src/components/board/DeletedTabSidebar.vue @@ -8,8 +8,7 @@