Skip to content

Commit 943084a

Browse files
authored
Merge pull request #879 from nextcloud-libraries/chore/eslint-v9
chore: migrate to ESLint v9
2 parents d09c7b2 + e01a02c commit 943084a

8 files changed

Lines changed: 1096 additions & 3410 deletions

File tree

.eslintrc.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

REUSE.toml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,3 @@ path = ["package-lock.json", "package.json", "tsconfig.json"]
1010
precedence = "aggregate"
1111
SPDX-FileCopyrightText = "2019 Nextcloud GmbH and Nextcloud contributors"
1212
SPDX-License-Identifier = "GPL-3.0-or-later"
13-
14-
[[annotations]]
15-
path = [".eslintrc.json"]
16-
precedence = "aggregate"
17-
SPDX-FileCopyrightText = "2023 Nextcloud GmbH and Nextcloud contributors"
18-
SPDX-License-Identifier = "GPL-3.0-or-later"

eslint.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
3+
* SPDX-License-Identifier: CC0-1.0
4+
*/
5+
6+
import { recommendedLibrary } from '@nextcloud/eslint-config'
7+
import { defineConfig } from 'eslint/config'
8+
9+
export default defineConfig([...recommendedLibrary])

lib/env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
*/
55

66
declare interface Window {
7-
_nc_initial_state?: Map<string, unknown>
7+
_nc_initial_state?: Map<string, unknown>
88
}

lib/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function loadState<T>(app: string, key: string, fallback?: T): T {
3030
const parsedValue = JSON.parse(atob(elem.value))
3131
window._nc_initial_state.set(selector, parsedValue)
3232
return parsedValue
33-
} catch (e) {
34-
throw new Error(`Could not parse initial state ${key} of ${app}`)
33+
} catch (error) {
34+
throw new Error(`Could not parse initial state ${key} of ${app}`, { cause: error })
3535
}
3636
}

0 commit comments

Comments
 (0)