Skip to content

Commit 263f831

Browse files
committed
chore: fix styleguide config to comply with ESLint
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent 64c2f67 commit 263f831

File tree

3 files changed

+40
-40
lines changed

3 files changed

+40
-40
lines changed

styleguide.config.cjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ module.exports = async () => {
2929
path.join(__dirname, 'styleguide/window.js'),
3030
path.join(__dirname, 'styleguide/global.requires.js'),
3131
path.join(__dirname, 'styleguide/assets/icons.css'),
32-
!!process.env.NEXTCLOUD_LEGACY
33-
? path.join(__dirname, 'styleguide/assets/legacy.css')
34-
: path.join(__dirname, 'styleguide/assets/additional.css'),
32+
!process.env.NEXTCLOUD_LEGACY
33+
? path.join(__dirname, 'styleguide/assets/additional.css')
34+
: path.join(__dirname, 'styleguide/assets/legacy.css'),
3535
path.join(__dirname, 'styleguide/assets/styleguide.css'),
3636
],
3737

@@ -45,8 +45,8 @@ module.exports = async () => {
4545
webpackConfig: merge(newConfig, {
4646
plugins: [
4747
new webpack.DefinePlugin({
48-
NEXTCLOUD_VERSION: JSON.stringify(`${!!process.env.NEXTCLOUD_LEGACY ? '31' : '32'}.0.0`),
49-
})
48+
NEXTCLOUD_VERSION: JSON.stringify(`${!process.env.NEXTCLOUD_LEGACY ? '32' : '31'}.0.0`),
49+
}),
5050
],
5151
// https://webpack.js.org/configuration/dev-server/#devserverproxy
5252
devServer: {

styleguide/global.requires.js

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -45,39 +45,6 @@ function mockRequests(error) {
4545

4646
axios.interceptors.response.use((r) => r, (e) => mockRequests(e))
4747

48-
/**
49-
* From server util.js
50-
*
51-
* @param {string} t The string to chunkify
52-
* @return {Array}
53-
*/
54-
function chunkify(t) {
55-
// Adapted from http://my.opera.com/GreyWyvern/blog/show.dml/1671288
56-
const tz = []
57-
let x = 0
58-
let y = -1
59-
let n = 0
60-
let c
61-
62-
while (x < t.length) {
63-
c = t.charAt(x) // only include the dot in strings
64-
65-
const m = !n && (c === '.' || (c >= '0' && c <= '9'))
66-
67-
if (m !== n) {
68-
// next chunk
69-
y++
70-
tz[y] = ''
71-
n = m
72-
}
73-
74-
tz[y] += c
75-
x++
76-
}
77-
78-
return tz
79-
}
80-
8148
// app name fallback
8249
window.appName = 'nextcloud-vue'
8350

styleguide/window.js

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
33
* SPDX-License-Identifier: AGPL-3.0-or-later
44
*/
5-
5+
66
// Global variables
77
window._oc_webroot = ''
88

@@ -24,7 +24,7 @@ window.OC = {
2424
return true
2525
},
2626
config: {
27-
// added by webpack
27+
// eslint-disable-next-line no-undef -- added by webpack
2828
version: NEXTCLOUD_VERSION,
2929
},
3030
Util: {
@@ -77,3 +77,36 @@ window.OC = {
7777
webroot: '',
7878
}
7979
window.OCA = {}
80+
81+
/**
82+
* From server util.js
83+
*
84+
* @param {string} t The string to chunkify
85+
* @return {Array}
86+
*/
87+
function chunkify(t) {
88+
// Adapted from http://my.opera.com/GreyWyvern/blog/show.dml/1671288
89+
const tz = []
90+
let x = 0
91+
let y = -1
92+
let n = 0
93+
let c
94+
95+
while (x < t.length) {
96+
c = t.charAt(x) // only include the dot in strings
97+
98+
const m = !n && (c === '.' || (c >= '0' && c <= '9'))
99+
100+
if (m !== n) {
101+
// next chunk
102+
y++
103+
tz[y] = ''
104+
n = m
105+
}
106+
107+
tz[y] += c
108+
x++
109+
}
110+
111+
return tz
112+
}

0 commit comments

Comments
 (0)