move eslint global variable ignores to eslint config file

This commit is contained in:
jalensailin
2024-06-08 12:36:28 -04:00
parent b72276fdf8
commit 968968245c
13 changed files with 66 additions and 29 deletions
+52
View File
@@ -39,6 +39,58 @@ rules:
import/extensions:
- warn
- always
globals:
"$": readonly
ActiveEffect: readonly
ActiveEffectConfig: readonly
Actor: readonly
Actors: readonly
ActorSheet: readonly
Babele: readonly
CONFIG: readonly
CONST: readonly
ChatMessage: readonly
Combat: readonly
Combatant: readonly
ContextMenu: readonly
Dialog: readonly
DocumentSheetConfig: readonly
Folder: readonly
FormApplication: readonly
FormDataExtended: readonly
Handlebars: readonly
Hooks: readonly
ImagePopout: readonly
Item: readonly
Items: readonly
ItemSheet: readonly
Macro: readonly
Roll: readonly
Ruler: readonly
Scene: readonly
TextEditor: readonly
TokenDocument: readonly
canvas: readonly
debugger: readonly
document: readonly
dragRuler: readonly
duplicate: readonly
foundry: readonly
fromUuid: readonly
fromUuidSync: readonly
game: readonly
getProperty: readonly
globals: readonly
hasProperty: readonly
isNewerVersion: readonly
loadTemplates: readonly
mergeObject: readonly
parseUuid: readonly
randomID: readonly
renderTemplate: readonly
setProperty: readonly
ui: readonly
window: readonly
settings:
import/extensions:
- ".js"
-2
View File
@@ -1,5 +1,3 @@
/* globals $ game Roll ChatMessage AudioHelper ActorSheet mergeObject Dialog TextEditor ActiveEffect ui duplicate fromUuidSync renderTemplate randomID */
import DG from "../config.js";
import {
DGPercentileRoll,
-2
View File
@@ -1,5 +1,3 @@
/* global Actor Item mergeObject game */
/**
* Extend the base Actor entity by defining a custom roll data structure which is ideal for the Simple system.
* @extends {Actor}
-2
View File
@@ -1,5 +1,3 @@
/* globals $ Hooks game CONFIG Actors Items ActorSheet ItemSheet duplicate */
// Import Modules
import DeltaGreenActor from "./actor/actor.js";
import DeltaGreenActorSheet from "./actor/actor-sheet.js";
-2
View File
@@ -1,5 +1,3 @@
/* global ItemSheet mergeObject TextEditor */
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
-2
View File
@@ -1,5 +1,3 @@
/* globals Item */
import { DGDamageRoll, DGLethalityRoll } from "../roll/roll.js";
/**
-2
View File
@@ -1,5 +1,3 @@
/* global game Macro ChatMessage ui */
import * as DGRolls from "../roll/roll.js";
/* -------------------------------------------- */
-2
View File
@@ -1,5 +1,3 @@
/* global Handlebars CONFIG game */
import DGUtils from "./utility-functions.js";
export default function registerHandlebarsHelpers() {
+14 -8
View File
@@ -1,7 +1,5 @@
/* global Dialog Actor */
function GetNotesFromInput(inputText){
const matchStr = '(?:ATTACKS:[\\S\\s]*?\\.\\n)([\\S\\s]*)';
function GetNotesFromInput(inputText) {
const matchStr = "(?:ATTACKS:[\\S\\s]*?\\.\\n)([\\S\\s]*)";
const re = new RegExp(matchStr, "gi");
const results = inputText.match(re);
let notes = "";
@@ -9,7 +7,7 @@ function GetNotesFromInput(inputText){
try {
if (results != null && results.length > 0) {
notes = results[0];
notes = notes.replace("\n", " ")
notes = notes.replace("\n", " ");
}
} catch (ex) {
console.log("GetNotesFromInput Error");
@@ -111,11 +109,19 @@ async function RegexParseNpcStatBlock(inputStr, actorType) {
if (tempStr.length > 0) {
actorData.name = tempStr[0];
// set the alternate description/profession/etc.
// if this doesn't exist, the next line should be the attributes starting with strength
// so if the second line starts with "STR" then just leave it be.
if (tempStr.length > 1 && tempStr[1].substring(0, 3) != "STR" && tempStr[1].substring(0, 3) != "CON" && tempStr[1].substring(0, 3) != "DEX" && tempStr[1].substring(0, 3) != "INT" && tempStr[1].substring(0, 3) != "POW" && tempStr[1].substring(0, 3) != "CHA") {
if (
tempStr.length > 1 &&
tempStr[1].substring(0, 3) != "STR" &&
tempStr[1].substring(0, 3) != "CON" &&
tempStr[1].substring(0, 3) != "DEX" &&
tempStr[1].substring(0, 3) != "INT" &&
tempStr[1].substring(0, 3) != "POW" &&
tempStr[1].substring(0, 3) != "CHA"
) {
shortDescription = tempStr[1];
}
} else {
@@ -388,7 +394,7 @@ async function RegexParseNpcStatBlock(inputStr, actorType) {
actorData.data.typedSkills[`tskill_${index.toString()}`] = element;
}
if(actorType === "npc" || actorType === "unnatural"){
if (actorType === "npc" || actorType === "unnatural") {
actorData.data.notes = GetNotesFromInput(inputStr);
}
-2
View File
@@ -1,5 +1,3 @@
/* globals game */
export default class DGUtils {
/**
* Attempt to localize a keyword, and gracefully fallback to something else if the key does not exist.
-1
View File
@@ -1,5 +1,4 @@
/* eslint-disable max-classes-per-file */
/* globals game Roll ChatMessage AudioHelper renderTemplate Dialog */
import DGUtils from "../other/utility-functions.js";
-2
View File
@@ -1,5 +1,3 @@
/* global game */
export default function registerSystemSettings() {
game.settings.register("deltagreen", "characterSheetStyle", {
name: "Character Sheet Style",
-2
View File
@@ -1,5 +1,3 @@
/* global loadTemplates */
/**
* Define a set of template paths to pre-load
* Pre-loaded templates are compiled and cached for fast access when rendering