Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,15 @@ module.exports = {
extends: [
'@nextcloud',
],
overrides: [
{
files: ['**/*.ts', '**/*.tsx'],
extends: [
'@nextcloud',
'@nextcloud/eslint-config/typescript',
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
},
],
}
256 changes: 101 additions & 155 deletions package-lock.json

Large diffs are not rendered by default.

20 changes: 16 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@
"build": "webpack --node-env production --progress",
"dev": "webpack --node-env development --progress",
"watch": "webpack --node-env development --progress --watch",
"lint": "eslint --ext .js,.vue src",
"lint:fix": "eslint --ext .js,.vue src --fix",
"lint": "eslint --ext .js,.vue,.ts src",
"lint:fix": "eslint --ext .js,.vue,.ts src --fix",
"stylelint": "stylelint \"css/*.css\" \"css/*.scss\" \"src/**/*.scss\" \"src/**/*.vue\"",
"stylelint:fix": "stylelint \"css/*.css\" \"css/*.scss\" \"src/**/*.scss\" \"src/**/*.vue\" --fix",
"test": "jest",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage"
"test:coverage": "jest --coverage",
"type-check": "tsc --noEmit"
},
"dependencies": {
"@fullcalendar/core": "6.1.17",
Expand Down Expand Up @@ -95,7 +96,14 @@
"@nextcloud/browserslist-config": "^3.0.1",
"@nextcloud/eslint-config": "^8.4.1",
"@nextcloud/stylelint-config": "^3.1.0",
"@nextcloud/typings": "^1.9.1",
"@nextcloud/webpack-vue-config": "^6.2.0",
"@types/jest": "^29.5.5",
"@types/node": "^20.8.0",
"@types/webpack": "^5.28.5",
"@types/webpack-env": "^1.18.8",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"@vue/test-utils": "^2.4.6",
"@vue/vue2-jest": "^29.2.6",
"babel-jest": "^29.7.0",
Expand All @@ -104,6 +112,8 @@
"jest-environment-jsdom": "^29.7.0",
"jest-serializer-vue": "^3.1.0",
"resolve-url-loader": "^5.0.0",
"ts-loader": "^9.4.4",
"typescript": "^5.2.2",
"vue-template-compiler": "^2.7.16"
},
"optionalDependencies": {
Expand All @@ -112,6 +122,7 @@
"jest": {
"moduleFileExtensions": [
"js",
"ts",
"vue"
],
"moduleNameMapper": {
Expand All @@ -120,6 +131,7 @@
},
"transform": {
".*\\.js$": "<rootDir>/node_modules/babel-jest",
".*\\.ts$": "<rootDir>/node_modules/babel-jest",
".*\\.(vue)$": "<rootDir>/node_modules/@vue/vue2-jest"
},
"snapshotSerializers": [
Expand All @@ -128,7 +140,7 @@
"coverageDirectory": "./coverage/",
"collectCoverage": true,
"collectCoverageFrom": [
"<rootDir>/src/**/*.{js,vue}",
"<rootDir>/src/**/*.{js,ts,vue}",
"!**/node_modules/**"
],
"coverageReporters": [
Expand Down
13 changes: 13 additions & 0 deletions src/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

import type { getCSPNonce } from '@nextcloud/auth'

declare global {
let __webpack_nonce__: ReturnType<typeof getCSPNonce>
let __webpack_public_path__: string
}

export {}
43 changes: 43 additions & 0 deletions src/types/vue-shim.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/**
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

declare module '*.vue' {
import Vue from 'vue'
export default Vue
}

declare module '@nextcloud/*' {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const content: any
export = content
}

declare module 'vue-material-design-icons/*' {
import Vue from 'vue'
export default Vue
}

declare module 'v-tooltip' {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const content: any
export = content
}

declare module 'vuedraggable' {
import Vue from 'vue'
export default Vue
}

declare module 'vue-shortkey' {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const content: any
export = content
}

declare module 'vue-click-outside' {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const content: any
export = content
}
19 changes: 19 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"include": ["src/**/*.ts", "src/**/*.vue", "src/env.d.ts"],
"compilerOptions": {
"module": "ESNext",
"moduleResolution": "bundler",
"target": "ESNext",
"strictNullChecks": true,
"sourceMap": true,
"allowSyntheticDefaultImports": true,
"declaration": false,
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
}
},
"vueCompilerOptions": {
"target": "2.7"
}
}
2 changes: 2 additions & 0 deletions tsconfig.json.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
SPDX-License-Identifier: AGPL-3.0-or-later
8 changes: 8 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ webpackConfig.entry['appointments-confirmation'] = path.join(__dirname, 'src', '
webpackConfig.entry['appointments-conflict'] = path.join(__dirname, 'src', 'appointments/main-conflict.js')
webpackConfig.entry['appointments-overview'] = path.join(__dirname, 'src', 'appointments/main-overview.js')

webpackConfig.resolve = {
...webpackConfig.resolve,
alias: {
...webpackConfig.resolve.alias,
'@': path.resolve(__dirname, 'src'),
}
}

// Edit JS rule
webpackRules.RULE_JS.test = /\.m?js$/
webpackRules.RULE_JS.exclude = BabelLoaderExcludeNodeModulesExcept([
Expand Down
Loading