Skip to content

Commit 0fd681c

Browse files
committed
fix: code lint
1 parent 343d4db commit 0fd681c

File tree

9 files changed

+31
-168
lines changed

9 files changed

+31
-168
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ npm/node_modules
1414
.npm
1515
.node_repl_history
1616
npm-debug.log*
17+
.yarn
1718

1819
# Generated assets
1920
/assets
@@ -41,6 +42,7 @@ server/views/setup.pug
4142

4243
# Test results
4344
test-results/
45+
.scannerwork
4446

4547
# Localization Resources
4648
/server/locales/**/*.yml

client/components/common/search-results.vue

+9-9
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555

5656
<script>
5757
import _ from 'lodash'
58-
import { get, sync } from 'vuex-pathify'
58+
import { sync } from 'vuex-pathify'
5959
import { OrbitSpinner } from 'epic-spinners'
6060
6161
import searchPagesQuery from 'gql/common/common-pages-query-search.gql'
@@ -105,14 +105,6 @@ export default {
105105
}
106106
}
107107
},
108-
methods: {
109-
setSearchTerm(term) {
110-
this.search = term
111-
},
112-
goToPage(item) {
113-
window.location.assign(`/${item.locale}/${item.path}`)
114-
}
115-
},
116108
mounted() {
117109
this.$root.$on('searchMove', (dir) => {
118110
this.cursor += (dir === 'up' ? -1 : 1)
@@ -130,6 +122,14 @@ export default {
130122
}
131123
})
132124
},
125+
methods: {
126+
setSearchTerm(term) {
127+
this.search = term
128+
},
129+
goToPage(item) {
130+
window.location.assign(`/${item.locale}/${item.path}`)
131+
}
132+
},
133133
apollo: {
134134
response: {
135135
query: searchPagesQuery,

client/components/register.vue

+2-4
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@
9898
/* global siteConfig */
9999
100100
import _ from 'lodash'
101-
import Cookies from 'js-cookie'
102101
import validate from 'validate.js'
103102
import PasswordStrength from './common/password-strength.vue'
104103
@@ -134,7 +133,6 @@ export default {
134133
this.isShown = true
135134
this.$nextTick(() => {
136135
this.$refs.iptEmail.focus()
137-
138136
})
139137
},
140138
methods: {
@@ -184,11 +182,11 @@ export default {
184182
tooShort: this.$t('auth:nameTooShort'),
185183
tooLong: this.$t('auth:nameTooLong')
186184
}
187-
},
185+
}
188186
}, { fullMessages: false })
189187
190188
if (validation) {
191-
if(validation.email) {
189+
if (validation.email) {
192190
this.$store.commit('showNotification', {
193191
style: 'red',
194192
message: validation.email[0],

client/scss/base/reset.scss

-138
This file was deleted.

client/scss/components/v-dialog.scss

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.dialog-header {
22
background-color: mc('blue', '700');
3-
background: radial-gradient(ellipse at top, mc('blue', '500'), mc('blue', '700')),
4-
radial-gradient(ellipse at bottom, mc('blue', '800'), mc('blue', '700'));
3+
background-image: radial-gradient(ellipse at top, mc('blue', '500'), mc('blue', '700')),
4+
radial-gradient(ellipse at bottom, mc('blue', '800'), mc('blue', '700'));
55
height: 60px;
66
color: #FFF;
77
display: flex;
@@ -11,19 +11,19 @@
1111

1212
&.is-red {
1313
background-color: mc('red', '700');
14-
background: radial-gradient(ellipse at top, mc('red', '500'), mc('red', '700')),
15-
radial-gradient(ellipse at bottom, mc('red', '800'), mc('red', '700'));
14+
background-image: radial-gradient(ellipse at top, mc('red', '500'), mc('red', '700')),
15+
radial-gradient(ellipse at bottom, mc('red', '800'), mc('red', '700'));
1616
}
1717

1818
&.is-indigo {
1919
background-color: mc('indigo', '700');
20-
background: radial-gradient(ellipse at top, mc('indigo', '500'), mc('indigo', '700')),
21-
radial-gradient(ellipse at bottom, mc('indigo', '800'), mc('indigo', '700'));
20+
background-image: radial-gradient(ellipse at top, mc('indigo', '500'), mc('indigo', '700')),
21+
radial-gradient(ellipse at bottom, mc('indigo', '800'), mc('indigo', '700'));
2222
}
2323

2424
&.is-dark {
2525
background-color: mc('grey', '900');
26-
background: radial-gradient(ellipse at top, mc('grey', '800'), mc('grey', '900')),
27-
radial-gradient(ellipse at bottom, mc('grey', '800'), mc('grey', '900'));
26+
background-image: radial-gradient(ellipse at top, mc('grey', '800'), mc('grey', '900')),
27+
radial-gradient(ellipse at bottom, mc('grey', '800'), mc('grey', '900'));
2828
}
2929
}

server/core/auth.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@ module.exports = {
7979
stg.config.callbackURL = `${WIKI.config.host}/login/${stg.key}/callback`
8080
strategy.init(passport, stg.config)
8181

82-
fs.readFile(path.join(WIKI.ROOTPATH, `assets/svg/auth-icon-${strategy.key}.svg`), 'utf8').then(iconData => {
83-
strategy.icon = iconData
84-
}).catch(err => {
82+
try {
83+
strategy.icon = await fs.readFile(path.join(WIKI.ROOTPATH, `assets/svg/auth-icon-${strategy.key}.svg`), 'utf8')
84+
} catch (err) {
8585
if (err.code === 'ENOENT') {
8686
strategy.icon = '[missing icon]'
8787
} else {
8888
WIKI.logger.warn(err)
8989
}
90-
})
90+
}
9191
WIKI.auth.strategies[stg.key] = strategy
9292
WIKI.logger.info(`Authentication Strategy ${stg.key}: [ OK ]`)
9393
}

server/models/userKeys.js

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
/* global WIKI */
22

3-
const _ = require('lodash')
4-
const securityHelper = require('../helpers/security')
53
const Model = require('objection').Model
64
const moment = require('moment')
75
const nanoid = require('nanoid')
@@ -68,7 +66,5 @@ module.exports = class UserKey extends Model {
6866
} else {
6967
throw new WIKI.Error.AuthValidationTokenInvalid()
7068
}
71-
72-
return token
7369
}
7470
}

server/setup.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ module.exports = () => {
387387
let key = conn.remoteAddress + ':' + conn.remotePort
388388
openConnections[key] = conn
389389
conn.on('close', () => {
390-
delete openConnections[key]
390+
openConnections.splice(key, 1)
391391
})
392392
})
393393

sonar-project.properties

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
sonar.projectKey=Requarks_wiki
2+
sonar.organization=requarks
3+
sonar.host.url=https://sonarcloud.io
4+
sonar.sources=./server,./client
5+
sonar.exclusions=./server/templates

0 commit comments

Comments
 (0)