chore(deps): bump eslint to v9

This commit is contained in:
Johannes Loher 2025-02-15 18:55:53 +01:00
parent 588b828879
commit 0688aed679
Signed by: saluu
GPG key ID: 7CB0A9FB553DA045
9 changed files with 372 additions and 357 deletions

View file

@ -1,7 +0,0 @@
# SPDX-FileCopyrightText: 2021 Johannes Loher
#
# SPDX-License-Identifier: MIT
/dist
client
common

View file

@ -1,4 +1,5 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"eslint.useFlatConfig": true
}

67
eslint.config.js Normal file
View file

@ -0,0 +1,67 @@
// SPDX-FileCopyrightText: 2025 Johannes Loher
//
// SPDX-License-Identifier: MIT
// @ts-check
import eslint from "@eslint/js";
import eslintConfigPrettier from "eslint-config-prettier";
import tseslint from "typescript-eslint";
import globals from "globals";
const foundryGlobals = {
ActiveEffect: false,
ActiveEffectConfig: false,
Actor: false,
ActorSheet: false,
canvas: false,
Canvas: false,
ChatMessage: false,
CONFIG: false,
DocumentSheetConfig: false,
game: false,
Game: false,
Hooks: false,
Item: false,
ItemSheet: false,
Macro: false,
Notifications: false,
ui: false,
loadTemplates: false,
foundry: false,
Dialog: false,
renderTemplate: false,
TokenDocument: false,
Roll: false,
PoolTerm: false,
DiceTerm: false,
TextEditor: false,
CONST: false,
getProperty: false,
fromUuid: false,
};
export default tseslint.config(
{
ignores: ["dist/**", "client", "common"],
},
eslint.configs.recommended,
tseslint.configs.recommended,
{
languageOptions: {
parserOptions: {
ecmaVersion: 2020,
sourceType: "module",
},
globals: { ...globals.browser, ...globals.jquery, ...foundryGlobals },
},
},
{
files: ["tools/**", "*"],
languageOptions: {
parserOptions: {},
globals: globals.node,
},
},
eslintConfigPrettier,
);

View file

@ -47,9 +47,8 @@
"clean": "run-p clean:files clean:link",
"clean:files": "rimraf dist",
"clean:link": "node ./tools/link-package.js --clean",
"lint": "pnpm eslint",
"lint:fix": "pnpm eslint --fix",
"eslint": "eslint --ext .ts,.js,.cjs,.mjs .",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"format": "pnpm prettier --write",
"format:check": "pnpm prettier --check",
"prettier": "prettier './**/*.(ts|js|cjs|mjs|json|scss|yml|yaml)'",
@ -65,30 +64,31 @@
"devDependencies": {
"@commitlint/cli": "19.7.1",
"@commitlint/config-conventional": "19.7.1",
"@eslint/js": "9.20.0",
"@foundryvtt/foundryvtt-cli": "0.0.9",
"@guanghechen/rollup-plugin-copy": "6.0.4",
"rollup-plugin-styler": "2.0.0",
"@swc/core": "1.10.16",
"@types/fs-extra": "11.0.4",
"@types/jquery": "3.5.32",
"@types/node": "18.19.76",
"@typescript-eslint/eslint-plugin": "7.18.0",
"@typescript-eslint/parser": "7.18.0",
"conventional-changelog-cli": "5.0.0",
"conventional-changelog-conventionalcommits": "8.0.0",
"eslint": "8.57.1",
"eslint": "9.20.1",
"eslint-config-prettier": "10.0.1",
"fs-extra": "11.3.0",
"globals": "15.15.0",
"handlebars": "4.7.8",
"npm-run-all": "4.1.5",
"prettier": "3.5.1",
"rimraf": "6.0.1",
"rollup": "4.34.7",
"rollup-plugin-styler": "2.0.0",
"rollup-plugin-swc3": "0.12.1",
"sass": "1.85.0",
"semver": "7.7.1",
"tslib": "2.8.1",
"typescript": "5.7.3",
"typescript-eslint": "8.24.0",
"vite": "6.1.0",
"vitest": "3.0.5",
"yargs": "17.7.2"

File diff suppressed because it is too large Load diff

View file

@ -68,7 +68,7 @@ export class DS4ActiveEffect extends ActiveEffect {
change.value = Roll.replaceFormulaData(change.value, document);
try {
change.value = DS4ActiveEffect.safeEval(change.value).toString();
} catch (e) {
} catch {
// this is a valid case, e.g., if the effect change simply is a string
}
return super.apply(document, change);

View file

@ -118,7 +118,7 @@ export class DS4Actor extends Actor {
* @protected
*/
static replaceFormulaData(formula, data) {
const dataRgx = new RegExp(/@([a-z.0-9_\-]+)/gi);
const dataRgx = new RegExp(/@([a-z.0-9_-]+)/gi);
try {
return formula.replace(dataRgx, (_, term) => {
const value = foundry.utils.getProperty(data, term);

View file

@ -38,8 +38,6 @@ async function migrateItem(item) {
},
});
}
return updateData;
}
const migrateActor = getActorMigrator(migrateItem);

View file

@ -29,7 +29,7 @@ async function migrateItem(item) {
if (item.type === "spell") {
const spellCategory = item.system?.spellCategory;
const spellGroups = migrateSpellCategory(spellCategory);
const bonus = itemData.system?.bonus;
const bonus = item.system?.bonus;
const spellModifier = migrateBonus(bonus);
await item.update({
system: {