Skip to content

Commit

Permalink
Add eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
mclemente committed Sep 28, 2022
1 parent bdec11b commit ceab681
Show file tree
Hide file tree
Showing 8 changed files with 2,692 additions and 11 deletions.
20 changes: 20 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": ["eslint:recommended", "eslint-config-prettier"],
"plugins": ["eslint-plugin-prettier"],
"overrides": [],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
"prettier/prettier": "error",
"no-plusplus": ["error", { "allowForLoopAfterthoughts": true }],
"no-undef": "off",
"no-unused-vars": "off",
"spaced-comment": "error"
}
}
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
.idea
foundryconfig.json

*.png~
*.bak
/package/
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"printWidth": 180,
"tabWidth": 4,
"useTabs": true
"useTabs": true,
"endOfLine": "auto"
}
7 changes: 3 additions & 4 deletions module/SystemProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ export class dnd5eProvider extends SystemProvider {
name: actor.name,
hp: this.getHitPoints(data),
abilities: data.abilities,
armor: data.attributes.ac.value ? data.attributes.ac.value : 10, //TODO: replace "ac" for "armor" on .hbs
armor: data.attributes.ac.value ? data.attributes.ac.value : 10, // TODO: replace "ac" for "armor" on .hbs
speed: this.getSpeed(data),
spellDC: data.attributes.spelldc,
// passive stuff
Expand All @@ -573,7 +573,7 @@ export class dnd5eProvider extends SystemProvider {
},
experience: { value: data.details.xp.value || 0, max: data.details.xp.max },
// background
background: data.details.hasOwnProperty("trait")
background: Object.prototype.hasOwnProperty.call(data.details, "trait")(obj, "trait")
? {
trait: this.htmlDecode(data.details.trait),
ideal: this.htmlDecode(data.details.ideal),
Expand Down Expand Up @@ -1440,8 +1440,7 @@ export class GURPSProvider extends SystemProvider {
/**
* Default width for the system's overview.
*/
get width() {
get width() {
return 750;
}

}
2 changes: 1 addition & 1 deletion module/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export function initApi() {
case "wfrp4e":
systemProviders.push(new wfrp4eProvider("native.wfrp4e"));
break;
case 'cyphersystem':
case "cyphersystem":
systemProviders.push(new cyphersystemProvider("native.cyphersystem"));
break;
case "CoC7":
Expand Down
10 changes: 5 additions & 5 deletions module/logic.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { currentSystemProvider } from "./api.js";

const DISPLAY_MODE = {
SHOW_ALL: 0, //Scene, Ulfiltered
SHOW_VISIBLE: 1, //Scene, Filtered
SHOW_HIDDEN: 2, //Scene, Hidden
SHOW_MORE: 3, //Player Controlled
SHOW_PC_ONLY: 4, //Selected PCs
SHOW_ALL: 0, // Scene, Ulfiltered
SHOW_VISIBLE: 1, // Scene, Filtered
SHOW_HIDDEN: 2, // Scene, Hidden
SHOW_MORE: 3, // Player Controlled
SHOW_PC_ONLY: 4, // Selected PCs
};

class PartyOverviewApp extends Application {
Expand Down
Loading

0 comments on commit ceab681

Please sign in to comment.