A Foundry VTT game system for Delta Green: The RPG! This is a fan made work that is unaffiliated with Shane Ivey or Arc Dream Publishing, published under the Delta Green Community license. http://www.delta-green.com https://foundryvtt.com/
This PR introduces ESLint and Prettier to help keep the code consistent between contributors, and to reduce syntax errors potentially leading to bugs.
NOTE: This PR does two other things which helped fix some linting errors:
Moves the Handlebars.registerHelper(...) calls to their own file (module/other/register-helpers.js).
Moves the Macro functions to their own files (module/other/macro-functions.js)
Steps to test:
NOTE: If you wish to review the code changes in this, I would look at the diffs for each commit, rather than all at once
Open VS Code
Check out this branch
Download the ESLint extensions and Prettier extensions
Open a terminal and run npm i
You should see a new /node_modules folder that is ignored by git.
Open a javascript like actor-sheet.js and notice that ESLint is highlighting warnings in yellow.
Try changing some of the syntax (removing semi-colons, adding multiple blank lines between functions, removing spaces between function names and the opening brackets, etc.)
Notice that ESLint gives red errors and that saving auto-fixes these errors
IMPORTANT LAST STEP: Test as much as you can in the system to make sure that reformatting didn't break anything. Check that sheets look right, buttons behave correctly, etc. Formatting shouldn't break anything, but fixing some of the linting errors has the potential to.
This PR introduces ESLint and Prettier to help keep the code consistent between contributors, and to reduce syntax errors potentially leading to bugs.
NOTE: This PR does two other things which helped fix some linting errors:
Handlebars.registerHelper(...)
calls to their own file (module/other/register-helpers.js
).module/other/macro-functions.js
)Steps to test:
NOTE: If you wish to review the code changes in this, I would look at the diffs for each commit, rather than all at once
npm i
/node_modules
folder that is ignored by git.actor-sheet.js
and notice that ESLint is highlighting warnings in yellow.