Skip to content

Commit

Permalink
Eslint fix
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv committed Dec 2, 2021
1 parent 71c97de commit 5adab26
Show file tree
Hide file tree
Showing 115 changed files with 849 additions and 637 deletions.
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,9 @@ module.exports = {
// TODO: make sure we fix this as this is bad vue coding style.
// Use proper sync modifier
'vue/no-mutating-props': 'warn',
'vue/custom-event-name-casing': ['error', 'kebab-case', {
// allows custom xxxx:xxx events formats
ignores: ['/^[a-z]+(?:-[a-z]+)*:[a-z]+(?:-[a-z]+)*$/u'],
}],
},
}
7 changes: 5 additions & 2 deletions apps/comments/src/components/Comment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,17 @@ export default {

/**
* Is the current user the author of this comment
* @returns {boolean}
*
* @return {boolean}
*/
isOwnComment() {
return getCurrentUser().uid === this.actorId
},

/**
* Rendered content as html string
* @returns {string}
*
* @return {string}
*/
renderedContent() {
if (this.isEmptyMessage) {
Expand Down Expand Up @@ -208,6 +210,7 @@ export default {
methods: {
/**
* Update local Message on outer change
*
* @param {string} message the message to set
*/
updateLocalMessage(message) {
Expand Down
2 changes: 1 addition & 1 deletion apps/comments/src/services/CommentsInstance.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default class CommentInstance {
* Initialize a new Comments instance for the desired type
*
* @param {string} commentsType the comments endpoint type
* @param {Object} options the vue options (propsData, parent, el...)
* @param {object} options the vue options (propsData, parent, el...)
*/
constructor(commentsType = 'files', options) {
// Add comments type as a global mixin
Expand Down
14 changes: 11 additions & 3 deletions apps/comments/src/services/GetComments.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ export const DEFAULT_LIMIT = 20
/**
* Retrieve the comments list
*
* @param {Object} data destructuring object
* @param {object} data destructuring object
* @param {string} data.commentsType the ressource type
* @param {number} data.ressourceId the ressource ID
* @param {Object} [options] optional options for axios
* @returns {Object[]} the comments list
* @param {object} [options] optional options for axios
* @return {object[]} the comments list
*/
export default async function({ commentsType, ressourceId }, options = {}) {
let response = null
Expand Down Expand Up @@ -64,6 +64,10 @@ export default async function({ commentsType, ressourceId }, options = {}) {
}

// https://github.com/perry-mitchell/webdav-client/blob/9de2da4a2599e06bd86c2778145b7ade39fe0b3c/source/interface/directoryContents.js#L32
/**
* @param result
* @param isDetailed
*/
function processMultistatus(result, isDetailed = false) {
// Extract the response items (directory contents)
const {
Expand All @@ -86,6 +90,10 @@ function processMultistatus(result, isDetailed = false) {
})
}

/**
* @param value
* @param passes
*/
function decodeHtmlEntities(value, passes = 1) {
const parser = new DOMParser()
let decoded = value
Expand Down
2 changes: 1 addition & 1 deletion apps/comments/src/services/NewComment.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import client from './DavClient'
* @param {string} commentsType the ressource type
* @param {number} ressourceId the ressource ID
* @param {string} message the message
* @returns {Object} the new comment
* @return {object} the new comment
*/
export default async function(commentsType, ressourceId, message) {
const ressourcePath = ['', commentsType, ressourceId].join('/')
Expand Down
9 changes: 5 additions & 4 deletions apps/comments/src/utils/cancelableRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,16 @@ import axios from '@nextcloud/axios'

/**
* Create a cancel token
* @returns {CancelTokenSource}
*
* @return {CancelTokenSource}
*/
const createCancelToken = () => axios.CancelToken.source()

/**
* Creates a cancelable axios 'request object'.
*
* @param {function} request the axios promise request
* @returns {Object}
* @param {Function} request the axios promise request
* @return {object}
*/
const cancelableRequest = function(request) {
/**
Expand All @@ -44,7 +45,7 @@ const cancelableRequest = function(request) {
* Execute the request
*
* @param {string} url the url to send the request to
* @param {Object} [options] optional config for the request
* @param {object} [options] optional config for the request
*/
const fetch = async function(url, options) {
return request(
Expand Down
11 changes: 8 additions & 3 deletions apps/comments/src/views/Comments.vue
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ export default {
methods: {
/**
* Update current ressourceId and fetch new data
* @param {Number} ressourceId the current ressourceId (fileId...)
*
* @param {number} ressourceId the current ressourceId (fileId...)
*/
async update(ressourceId) {
this.ressourceId = ressourceId
Expand All @@ -152,8 +153,9 @@ export default {

/**
* Make sure we have all mentions as Array of objects
*
* @param {Array} mentions the mentions list
* @returns {Object[]}
* @return {object[]}
*/
genMentionsData(mentions) {
const list = Object.values(mentions).flat()
Expand Down Expand Up @@ -217,6 +219,7 @@ export default {

/**
* Autocomplete @mentions
*
* @param {string} search the query
* @param {Function} callback the callback to process the results with
*/
Expand All @@ -235,14 +238,16 @@ export default {

/**
* Add newly created comment to the list
* @param {Object} comment the new comment
*
* @param {object} comment the new comment
*/
onNewComment(comment) {
this.comments.unshift(comment)
},

/**
* Remove deleted comment from the list
*
* @param {number} id the deleted comment
*/
onDelete(id) {
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ export default {
* Method to register panels that will be called by the integrating apps
*
* @param {string} app The unique app id for the widget
* @param {function} callback The callback function to register a panel which gets the DOM element passed as parameter
* @param {Function} callback The callback function to register a panel which gets the DOM element passed as parameter
*/
register(app, callback) {
Vue.set(this.callbacks, app, callback)
Expand Down
10 changes: 10 additions & 0 deletions apps/dav/src/service/CalendarService.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ import { parseXML } from 'webdav/dist/node/tools/dav'
import { getZoneString } from 'icalzone'
import { v4 as uuidv4 } from 'uuid'

/**
*
*/
export function getEmptySlots() {
return {
MO: [],
Expand All @@ -37,6 +40,9 @@ export function getEmptySlots() {
}
}

/**
*
*/
export async function findScheduleInboxAvailability() {
const client = getClient('calendars')

Expand Down Expand Up @@ -101,6 +107,10 @@ export async function findScheduleInboxAvailability() {
}
}

/**
* @param slots
* @param timezoneId
*/
export async function saveScheduleInboxAvailability(slots, timezoneId) {
const all = [...Object.keys(slots).flatMap(dayId => slots[dayId].map(slot => ({
...slot,
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/src/views/CalDavSettings.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('CalDavSettings', () => {
global.OCP = originalOCP
})

test('interactions', async() => {
test('interactions', async () => {
const TLUtils = render(
CalDavSettings,
{
Expand Down
3 changes: 2 additions & 1 deletion apps/files/src/components/TemplatePreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ export default {
computed: {
/**
* Strip away extension from name
* @returns {string}
*
* @return {string}
*/
nameWithoutExt() {
return this.basename.indexOf('.') > -1 ? this.basename.split('.').slice(0, -1).join('.') : this.basename
Expand Down
2 changes: 1 addition & 1 deletion apps/files/src/models/Tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default class Tab {
/**
* Create a new tab instance
*
* @param {Object} options destructuring object
* @param {object} options destructuring object
* @param {string} options.id the unique id of this tab
* @param {string} options.name the translated tab name
* @param {string} options.icon the vue component
Expand Down
3 changes: 3 additions & 0 deletions apps/files/src/services/FileInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@

import axios from '@nextcloud/axios'

/**
* @param url
*/
export default async function(url) {
const response = await axios({
method: 'PROPFIND',
Expand Down
5 changes: 3 additions & 2 deletions apps/files/src/services/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default class Settings {
*
* @since 19.0.0
* @param {OCA.Files.Settings.Setting} view element to add to settings
* @returns {boolean} whether registering was successful
* @return {boolean} whether registering was successful
*/
register(view) {
if (this._settings.filter(e => e.name === view.name).length > 0) {
Expand All @@ -47,7 +47,8 @@ export default class Settings {

/**
* All settings elements
* @returns {OCA.Files.Settings.Setting[]} All currently registered settings
*
* @return {OCA.Files.Settings.Setting[]} All currently registered settings
*/
get settings() {
return this._settings
Expand Down
8 changes: 4 additions & 4 deletions apps/files/src/services/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default class Sidebar {
*
* @readonly
* @memberof Sidebar
* @returns {Object} the data state
* @return {object} the data state
*/
get state() {
return this._state
Expand All @@ -51,8 +51,8 @@ export default class Sidebar {
* Register a new tab view
*
* @memberof Sidebar
* @param {Object} tab a new unregistered tab
* @returns {Boolean}
* @param {object} tab a new unregistered tab
* @return {boolean}
*/
registerTab(tab) {
const hasDuplicate = this._state.tabs.findIndex(check => check.id === tab.id) > -1
Expand All @@ -78,7 +78,7 @@ export default class Sidebar {
* Return current opened file
*
* @memberof Sidebar
* @returns {String} the current opened file
* @return {string} the current opened file
*/
get file() {
return this._state.file
Expand Down
3 changes: 2 additions & 1 deletion apps/files/src/utils/davUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ export const getToken = function() {

/**
* Return the current directory, fallback to root
* @returns {string}
*
* @return {string}
*/
export const getCurrentDirectory = function() {
const currentDirInfo = OCA?.Files?.App?.currentFileList?.dirInfo
Expand Down
4 changes: 2 additions & 2 deletions apps/files/src/utils/fileUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ const encodeFilePath = function(path) {
/**
* Extract dir and name from file path
*
* @param {String} path the full path
* @returns {String[]} [dirPath, fileName]
* @param {string} path the full path
* @return {string[]} [dirPath, fileName]
*/
const extractFilePaths = function(path) {
const pathSections = path.split('/')
Expand Down
Loading

0 comments on commit 5adab26

Please sign in to comment.