Skip to content

Commit

Permalink
add eslint and stylelint on vite build
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Veyssier <[email protected]>
  • Loading branch information
julien-nc committed Sep 16, 2024
1 parent 2278e3a commit ff9715b
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 10 deletions.
File renamed without changes.
83 changes: 82 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
"@nextcloud/vite-config": "^1.4.2",
"eslint-webpack-plugin": "^4.0.0",
"stylelint": "^16.5.0",
"stylelint-webpack-plugin": "^5.0.0"
"stylelint-webpack-plugin": "^5.0.0",
"vite-plugin-eslint": "^1.8.1",
"vite-plugin-stylelint": "^5.3.1"
}
}
8 changes: 4 additions & 4 deletions src/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
* @copyright Julien Veyssier 2020
*/

import { linkTo } from '@nextcloud/router'
import { getRequestToken } from '@nextcloud/auth'
// import { linkTo } from '@nextcloud/router'
// import { getRequestToken } from '@nextcloud/auth'

//__webpack_nonce__ = btoa(getRequestToken()) // eslint-disable-line
//__webpack_public_path__ = linkTo('cospend', 'js/') // eslint-disable-line
// __webpack_nonce__ = btoa(getRequestToken()) // eslint-disable-line
// __webpack_public_path__ = linkTo('cospend', 'js/') // eslint-disable-line

document.addEventListener('DOMContentLoaded', () => {
OCA.Dashboard.register('cospend_activity', async (el, { widget }) => {
Expand Down
8 changes: 4 additions & 4 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import './bootstrap.js'
import App from './App.vue'
import { showError } from '@nextcloud/dialogs'
import '@nextcloud/dialogs/style.css'
import { getRequestToken } from '@nextcloud/auth'
import { generateFilePath } from '@nextcloud/router'
// import { getRequestToken } from '@nextcloud/auth'
// import { generateFilePath } from '@nextcloud/router'
import { loadState } from '@nextcloud/initial-state'
import Tooltip from '@nextcloud/vue/dist/Directives/Tooltip.js'
import vueAwesomeCountdown from 'vue-awesome-countdown'
Expand All @@ -31,8 +31,8 @@ Vue.use(VueClipboard)
Vue.use(SmartTable)
Vue.directive('tooltip', Tooltip)

//__webpack_nonce__ = btoa(getRequestToken()) // eslint-disable-line
//__webpack_public_path__ = generateFilePath('cospend', '', 'js/') // eslint-disable-line
// __webpack_nonce__ = btoa(getRequestToken()) // eslint-disable-line
// __webpack_public_path__ = generateFilePath('cospend', '', 'js/') // eslint-disable-line

function restoreOptions() {
network.getOptionValues().then((response) => {
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import { createAppConfig } from '@nextcloud/vite-config'
import eslint from 'vite-plugin-eslint'
import stylelint from 'vite-plugin-stylelint'

export default createAppConfig({
main: 'src/main.js',
Expand All @@ -16,6 +18,7 @@ export default createAppConfig({
localsConvention: 'camelCase',
},
},
plugins: [eslint(), stylelint()],
},
inlineCSS: { relativeCSSInjection: true },
})

0 comments on commit ff9715b

Please sign in to comment.