Skip to content

Commit 55918a8

Browse files
committed
chore: add editor config
chore: reuse commands
1 parent e15554b commit 55918a8

File tree

12 files changed

+81
-36
lines changed

12 files changed

+81
-36
lines changed

.editorconfig

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
indent_style = tab
8+
indent_size = 4
9+
trim_trailing_whitespace = true
10+
11+
[package*.json]
12+
indent_size = 2
13+
indent_style = space
14+
15+
[*.md]
16+
trim_trailing_whitespace = false
17+
18+
[*.svg]
19+
insert_final_newline = false
20+
21+
[*.{yml,yaml}]
22+
indent_size = 2
23+
indent_style = space

.eslintrc.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
module.exports = {
22
globals: {
3-
appVersion: true
3+
appVersion: true,
44
},
55
parserOptions: {
6-
requireConfigFile: false
6+
requireConfigFile: false,
77
},
8-
extends: [
9-
'@nextcloud'
10-
],
8+
extends: ['@nextcloud'],
119
rules: {
1210
'jsdoc/require-jsdoc': 'off',
1311
'jsdoc/tag-lines': 'off',
1412
'vue/first-attribute-linebreak': 'off',
15-
'import/extensions': 'off'
16-
}
13+
'import/extensions': 'off',
14+
'max-len': ['error', { code: 120 }],
15+
},
16+
ignorePatterns: ['node_modules/*', 'js/*', 'vendor/*', 'dev/apps/*', 'l10n/*'],
1717
}

jest.config.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
const path = require('path')
2-
const rootDir = path.resolve(__dirname, '../../../')
3-
41
module.exports = {
52
testMatch: ['**/tests/**/*.spec.{js,ts}'],
63
moduleNameMapper: {
@@ -10,6 +7,7 @@ module.exports = {
107
transform: {
118
// process *.vue files with vue-jest
129
'\\.vue$': '@vue/vue2-jest',
10+
// eslint-disable-next-line max-len
1311
'.+\\.(css|styl|less|sass|scss|jpg|jpeg|png|svg|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|avif)$':
1412
'jest-transform-stub',
1513
'\\.c?js$': 'babel-jest',

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
"scripts": {
1010
"build": "NODE_ENV=production webpack --progress --config webpack.js",
1111
"dev": "NODE_ENV=development webpack --progress --config webpack.js",
12-
"watch": "NODE_ENV=development webpack --progress --watch --config webpack.js",
12+
"watch": "npm run dev -- --watch",
1313
"lint": "eslint --ext .js,.vue src tests",
14-
"lint:fix": "eslint --ext .js,.vue src tests --fix",
14+
"lint:fix": "npm run lint -- --fix",
1515
"stylelint": "stylelint css src",
16-
"stylelint:fix": "stylelint css src --fix",
16+
"stylelint:fix": "npm run stylelint -- --fix",
1717
"test:unit": "jest --silent",
1818
"test:unit:watch": "jest --watch --no-coverage"
1919
},

src/adminSettings.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ import Vue from 'vue'
1515
import './bootstrap.js'
1616
import AdminSettings from './components/AdminSettings.vue'
1717

18-
// eslint-disable-next-line
18+
// eslint-disable-next-line no-unused-expressions
1919
'use strict'
2020

21-
// eslint-disable-next-line
21+
// eslint-disable-next-line no-new
2222
new Vue({
2323
el: '#openproject_prefs',
2424
render: h => h(AdminSettings),

src/personalSettings.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ import Vue from 'vue'
1515
import './bootstrap.js'
1616
import PersonalSettings from './components/PersonalSettings.vue'
1717

18-
// eslint-disable-next-line
18+
// eslint-disable-next-line no-unused-expressions
1919
'use strict'
2020

21-
// eslint-disable-next-line
21+
// eslint-disable-next-line no-new
2222
new Vue({
2323
el: '#openproject_prefs',
2424
render: h => h(PersonalSettings),

src/reference.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ __webpack_public_path__ = OC.linkTo('integration_openproject', 'js/') // eslint-
3030
registerWidget('integration_openproject_work_package', async (el, { richObjectType, richObject, accessible }) => {
3131
// here we lazy load the components so it does not slow down the initial page load
3232
const { default: Vue } = await import(/* webpackChunkName: "reference-wp-lazy" */'vue')
33-
const { default: WorkPackageReferenceWidget } = await import(/* webpackChunkName: "reference-wp-lazy" */'./views/WorkPackageReferenceWidget.vue')
33+
const { default: WorkPackageReferenceWidget } = await import(
34+
/* webpackChunkName: "reference-wp-lazy" */'./views/WorkPackageReferenceWidget.vue'
35+
)
3436
Vue.mixin({ methods: { t, n } })
3537
const Widget = Vue.extend(WorkPackageReferenceWidget)
3638
new Widget({
@@ -44,7 +46,8 @@ registerWidget('integration_openproject_work_package', async (el, { richObjectTy
4446

4547
registerCustomPickerElement('openproject-work-package-ref', async (el, { providerId, accessible }) => {
4648
const { default: Vue } = await import(/* webpackChunkName: "reference-picker-lazy" */'vue')
47-
const { default: WorkPackagePickerElement } = await import(/* webpackChunkName: "reference-picker-lazy" */'./views/WorkPackagePickerElement.vue')
49+
const { default: WorkPackagePickerElement } = await import(
50+
/* webpackChunkName: "reference-picker-lazy" */'./views/WorkPackagePickerElement.vue')
4851
Vue.mixin({ methods: { t, n } })
4952

5053
const Element = Vue.extend(WorkPackagePickerElement)

src/utils.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,14 @@ export const WORKPACKAGES_SEARCH_ORIGIN = {
5656
LINK_MULTIPLE_FILES_MODAL: 'link-multiple-files-modal',
5757
}
5858
export const USER_SETTINGS = {
59-
NAVIGATION_LINK_DESCRIPTION: t('integration_openproject', 'Displays a link to your OpenProject instance in the Nextcloud header.'),
60-
UNIFIED_SEARCH_DESCRIPTION: t('integration_openproject', 'Allows you to search OpenProject work packages via the universal search bar in Nextcloud.'),
59+
NAVIGATION_LINK_DESCRIPTION: t(
60+
'integration_openproject',
61+
'Displays a link to your OpenProject instance in the Nextcloud header.',
62+
),
63+
UNIFIED_SEARCH_DESCRIPTION: t(
64+
'integration_openproject',
65+
'Allows you to search OpenProject work packages via the universal search bar in Nextcloud.',
66+
),
6167
}
6268

6369
export const NO_OPTION_TEXT_STATE = {

stylelint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ stylelintConfig.rules = {
33
...stylelintConfig.rules,
44
'declaration-colon-space-after': 'always',
55
'max-empty-lines': 1,
6-
"block-opening-brace-space-before": "always"
6+
'block-opening-brace-space-before': 'always',
77
}
88
module.exports = stylelintConfig

tests/jest/views/LinkMultipleFilesModal.spec.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,14 @@ describe('LinkMultipleFilesModal.vue', () => {
161161
beforeEach(() => {
162162
wrapper = mountWrapper()
163163
})
164-
it.each([STATE.NO_TOKEN, STATE.ERROR, STATE.OK])('shows the empty message when state is other than loading', async (state) => {
165-
await wrapper.setData({ state })
166-
await localVue.nextTick()
167-
expect(wrapper.find(emptyContentSelector).exists()).toBeTruthy()
168-
})
164+
it.each([STATE.NO_TOKEN, STATE.ERROR, STATE.OK])(
165+
'shows the empty message when state is other than loading',
166+
async (state) => {
167+
await wrapper.setData({ state })
168+
await localVue.nextTick()
169+
expect(wrapper.find(emptyContentSelector).exists()).toBeTruthy()
170+
},
171+
)
169172

170173
it('shows message "Add a new link to all selected files" when admin config is okay', async () => {
171174
wrapper = mount(LinkMultipleFilesModal, {

0 commit comments

Comments
 (0)