Skip to content

Commit

Permalink
update @nextcloud/eslint-config
Browse files Browse the repository at this point in the history
  • Loading branch information
korelstar committed Jul 13, 2020
1 parent 017e825 commit 4233d62
Show file tree
Hide file tree
Showing 12 changed files with 357 additions and 103 deletions.
392 changes: 323 additions & 69 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
"stylelint:fix": "stylelint 'src/**/*.vue' 'css/**/*.scss' --fix"
},
"dependencies": {
"@nextcloud/axios": "^1.3.2",
"@nextcloud/axios": "^1.3.3",
"@nextcloud/dialogs": "^1.4.0",
"@nextcloud/event-bus": "^1.2.0",
"@nextcloud/moment": "^1.1.1",
"@nextcloud/router": "^1.1.0",
"@nextcloud/vue": "^2.2.0",
"@nextcloud/vue": "^2.2.1",
"easymde": "^2.10.1",
"markdown-it": "^11.0.0",
"vue": "^2.6.11",
Expand All @@ -37,14 +37,14 @@
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/preset-env": "^7.10.4",
"@nextcloud/browserslist-config": "^1.0.0",
"@nextcloud/eslint-config": "^2.0.0",
"@nextcloud/eslint-config": "^2.2.0",
"@nextcloud/eslint-plugin": "^1.4.0",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.1.0",
"core-js": "^3.6.5",
"css-loader": "^3.6.0",
"eslint": "^6.8.0",
"eslint-config-standard": "^12.0.0",
"eslint-config-standard": "^14.1.1",
"eslint-import-resolver-webpack": "^0.12.2",
"eslint-loader": "^3.0.4",
"eslint-plugin-import": "^2.22.0",
Expand Down
4 changes: 2 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default {
NavigationList,
},
data: function() {
data() {
return {
filter: {
category: null,
Expand Down Expand Up @@ -95,7 +95,7 @@ export default {
&& !note.category.startsWith(this.filter.category + '/')) {
return false
}
const searchFields = [ 'title', 'category' ]
const searchFields = ['title', 'category']
if (search !== '') {
return searchFields.some(
searchField => note[searchField].toLowerCase().indexOf(search) !== -1
Expand Down
28 changes: 14 additions & 14 deletions src/NotesService.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const fetchNotes = () => {
if (response.data.errorMessage) {
showError(response.data.errorMessage)
}
store.commit('setSyncETag', response.headers['etag'])
store.commit('setSyncETag', response.headers.etag)
store.commit('setSyncLastModified', response.headers['last-modified'])
return response.data
})
Expand Down Expand Up @@ -102,8 +102,8 @@ export const fetchNote = noteId => {
} else {
console.error(err)
const msg = t('notes', 'Fetching note {id} has failed.', { id: noteId })
store.commit('setNoteAttribute', { noteId: noteId, attribute: 'error', value: true })
store.commit('setNoteAttribute', { noteId: noteId, attribute: 'errorMessage', value: msg })
store.commit('setNoteAttribute', { noteId, attribute: 'error', value: true })
store.commit('setNoteAttribute', { noteId, attribute: 'errorMessage', value: msg })
return store.getter.getNote(noteId)
}
})
Expand All @@ -125,7 +125,7 @@ export const refreshNote = (noteId, lastETag) => {
// only update if local content has not changed
if (oldContent === currentContent) {
store.commit('updateNote', response.data)
return response.headers['etag']
return response.headers.etag
}
return null
})
Expand All @@ -140,9 +140,9 @@ export const refreshNote = (noteId, lastETag) => {

export const setTitle = (noteId, title) => {
return axios
.put(url('/notes/' + noteId + '/title'), { title: title })
.put(url('/notes/' + noteId + '/title'), { title })
.then(response => {
store.commit('setNoteAttribute', { noteId: noteId, attribute: 'title', value: response.data })
store.commit('setNoteAttribute', { noteId, attribute: 'title', value: response.data })
})
.catch(err => {
console.error(err)
Expand All @@ -153,7 +153,7 @@ export const setTitle = (noteId, title) => {

export const createNote = category => {
return axios
.post(url('/notes'), { category: category })
.post(url('/notes'), { category })
.then(response => {
store.commit('updateNote', response.data)
return response.data
Expand Down Expand Up @@ -190,7 +190,7 @@ export const autotitleNote = noteId => {
return axios
.put(url('/notes/' + noteId + '/autotitle'))
.then((response) => {
store.commit('setNoteAttribute', { noteId: noteId, attribute: 'title', value: response.data })
store.commit('setNoteAttribute', { noteId, attribute: 'title', value: response.data })
})
.catch(err => {
console.error(err)
Expand All @@ -213,7 +213,7 @@ export const undoDeleteNote = (note) => {
}

export const deleteNote = noteId => {
store.commit('setNoteAttribute', { noteId: noteId, attribute: 'deleting', value: 'deleting' })
store.commit('setNoteAttribute', { noteId, attribute: 'deleting', value: 'deleting' })
return axios
.delete(url('/notes/' + noteId))
.then(() => {
Expand All @@ -232,9 +232,9 @@ export const deleteNote = noteId => {

export const setFavorite = (noteId, favorite) => {
return axios
.put(url('/notes/' + noteId + '/favorite'), { favorite: favorite })
.put(url('/notes/' + noteId + '/favorite'), { favorite })
.then(response => {
store.commit('setNoteAttribute', { noteId: noteId, attribute: 'favorite', value: response.data })
store.commit('setNoteAttribute', { noteId, attribute: 'favorite', value: response.data })
})
.catch(err => {
console.error(err)
Expand All @@ -245,13 +245,13 @@ export const setFavorite = (noteId, favorite) => {

export const setCategory = (noteId, category) => {
return axios
.put(url('/notes/' + noteId + '/category'), { category: category })
.put(url('/notes/' + noteId + '/category'), { category })
.then(response => {
const realCategory = response.data
if (category !== realCategory) {
handleSyncError(t('notes', 'Updating the note\'s category has failed. Is the target directory writable?'))
}
store.commit('setNoteAttribute', { noteId: noteId, attribute: 'category', value: realCategory })
store.commit('setNoteAttribute', { noteId, attribute: 'category', value: realCategory })
})
.catch(err => {
console.error(err)
Expand Down Expand Up @@ -284,7 +284,7 @@ function _saveNotes() {
}

export const saveNoteManually = (noteId) => {
store.commit('setNoteAttribute', { noteId: noteId, attribute: 'saveError', value: false })
store.commit('setNoteAttribute', { noteId, attribute: 'saveError', value: false })
saveNote(noteId, true)
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/AppSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default {
AppNavigationSettings,
},
data: function() {
data() {
return {
extensions: ['.txt', '.md'],
saving: false,
Expand Down
6 changes: 3 additions & 3 deletions src/components/EditorEasyMDE.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default {
},
},
data: function() {
data() {
return {
config: {
spellChecker: false,
Expand Down Expand Up @@ -61,8 +61,8 @@ export default {
// keys Home/End should apply to the visual line
this.mde.codemirror.addKeyMap({
'Home': 'goLineLeft',
'End': 'goLineRight',
Home: 'goLineLeft',
End: 'goLineRight',
})
// pass event for changes
Expand Down
2 changes: 1 addition & 1 deletion src/components/EditorMarkdownIt.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default {
},
},
data: function() {
data() {
return {
html: '',
md: new MarkdownIt({
Expand Down
2 changes: 1 addition & 1 deletion src/components/NavigationCategoriesItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default {
},
},
data: function() {
data() {
return {
open: false,
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/NavigationList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default {
},
},
data: function() {
data() {
return {
timeslots: [],
monthFormat: new Intl.DateTimeFormat(OC.getLanguage(), { month: 'long', year: 'numeric' }),
Expand Down Expand Up @@ -126,7 +126,7 @@ export default {
return this.notes.reduce((g, note) => {
const timeslot = this.getTimeslotFromNote(note)
if (g.length === 0 || g[g.length - 1].timeslot !== timeslot) {
g.push({ timeslot: timeslot, notes: [] })
g.push({ timeslot, notes: [] })
}
g[g.length - 1].notes.push(note)
return g
Expand Down Expand Up @@ -156,7 +156,7 @@ export default {
},
watch: {
category: function() { this.showFirstNotesOnly = true },
category() { this.showFirstNotesOnly = true },
},
created() {
Expand Down
2 changes: 1 addition & 1 deletion src/components/NavigationNoteItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default {
},
},
data: function() {
data() {
return {
loading: {
note: false,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Note.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default {
},
},
data: function() {
data() {
return {
loading: false,
fullscreen: false,
Expand Down
6 changes: 3 additions & 3 deletions src/components/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default {
},
filters: {
categoryOptionLabel: function(obj) {
categoryOptionLabel(obj) {
const category = obj.isTag ? obj.label : obj
return categoryLabel(category)
},
Expand All @@ -90,7 +90,7 @@ export default {
},
},
data: function() {
data() {
return {
loading: {
category: false,
Expand Down Expand Up @@ -135,7 +135,7 @@ export default {
return t('notes', 'You can create subcategories by using “/” as delimiter between parent category and subcategory, e.g. “{parent}/{sub}”.', { parent: t('notes', 'Category'), sub: t('notes', 'Subcategory') })
},
categories() {
return [ '', ...getCategories(0, false) ]
return ['', ...getCategories(0, false)]
},
sidebarOpen() {
return store.state.app.sidebarOpen
Expand Down

0 comments on commit 4233d62

Please sign in to comment.