- Notifications
You must be signed in to change notification settings - Fork0
Future-R/DOLFishing
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Looking to contribute to Degrees of Lewdity? Read theLexicon of Lewdity.
Failure to do so can lead to your work being denied.
- Open
01-config\sugarcubeConfig.js
. - Edit the
window.StartConfig
object to the relevant config type.- Normal Build -
enableImages
needs to betrue
andenableLinkNumberify
needs to betrue
. - Text Only Build -
enableImages
needs to befalse
andenableLinkNumberify
needs to betrue
. - Android Build -
enableImages
needs to betrue
andenableLinkNumberify
needs to befalse
.
- Normal Build -
version
is optional between release versions but will be displayed on screen in several places and stored in the saves made.debug
is optional and will only effect new games.
- On Windows: Run
compile.bat
orcompile-watch.bat
. - On Linux: Run
compile.sh
- Open
Degrees of Lewdity VERSION.html
.
- InstallTweego and remember the path where it was installed.
- Add path to
tweego.exe
(e.g.C:\Program Files\Twine\tweego-2.1.0-windows-x64
) to WindowsPath
environment variable.
Install project dependencies:
npm i
If you use Visual Studio Code:
InstallESLint extension.
InstallStylelint extension
Install and configureCode Spell Checker extension:
- Use "English - United Kingdom" and "English - United States" dictionaries
- Enable spellchecking for
twee3-sugarcube-2
,markdown
,javascript
and other programming languages
Optionally enable fixing js/css on save. In
settings.json
set:// This disables built-in formatting"[javascript]": {"editor.formatOnSave":false},"[css]": {"editor.formatOnSave":false},// This enables running ESLint, Prettier, Stylelint formatting on file save"editor.codeActionsOnSave": {"source.fixAll.eslint":true,"source.fixAll.stylelint":true},
JavaScript code linting is handled byESLint
.
ESLint isconfigured to follow some of best practices (ESLint Recommended Rules,JavaScript Standard Style) with formatting handled by Prettier (eslint --fix
formats code with Prettier). You don't need to usePrettier
VS Code extension to format.js
files.
To run ESLint for single file:
npx eslint"game/03-JavaScript/02-Helpers/Utils.js"
or for all files insidegame
directory:
npx eslint"game/**"
Some issues are fixable and can be auto-fixed when you save a file (provided ESLint extension is configured to run fix on save) or by runningeslint --fix file_relative_path
If you find a rule that doesn't make sense for the project you can disable it insiderules
section inside.eslintrc.cjs
:
rules: {...// SugarCube extends native objects and we follow it"no-extend-native":"off",...}
Please discuss the reasons with the team before disabling the rule. Add a comment explaining why the rule was disabled
If ESLint reports a lot of issues for particular file and you cannot fix them all at once feel free todisable particular rule for the file (there is quick actions menu when code with error is hovered):
/* eslint-disable camelcase -- TODO: Fix variables' names */...letdemo_rainbow_colors=[...
Add a TODO comment explaining that this will be fixed someday
ESLint may report a issue like'myVariable' is not defined
. It means ESLint cannot figure out where the variable is defined. If you really meant to make variable global add the new variable to.eslintrc.cjs
globals
section inside corresponding group:
myVariable: "readonly"
If the variable is suppose to be writable setmyVariable: "writable"
instead.
CSS linting is handled byStylelint
.
Stylelint isconfigured to followcommon conventions along withrules for properties order and formatting handled by Prettier (stylelint --fix
formats code with Prettier). You don't need to usePrettier
VS Code extension to format.css
files.
To run Stylelint for the file:
npx stylelint"game/02-CSS/pillsInventory.css"
or for all CSS file insidegame
directory:
npx stylelint"game/**/*.css"
Some issues are fixable and can be auto-fixed when you save a file (provided Stylelint extension is configured to run fix on save) or by runningstylelint --fix file_relative_path
.
Sometimes all issues cannot be fixed within single "fix" run (e.g. properties order). Simply run fix command several time until all auto-fixable issues are resolved.
If you find a rule that doesn't make sense for the project you can disable it insiderules
section insidestylelint.config.cjs
:
rules:{// Class and ID patterns disabled for now due to the large amounts of classes and IDs that break this rule"selector-class-pattern":null,"selector-id-pattern":null, ...}
Please discuss the reasons with the team before disabling the rule. Add a comment explaining why the rule was disabled
Formatting CSS and other non-JavaScript file is handled byPrettier
. Formatting rules are set in.prettierrc.json
On pre-commitlint-staged
usinghusky
lints/formats.js
,.css
with ESLint, Stylelint and formats other supported files with Prettier.
Pre-commit hook is the last quality gate to avoid "bad" code getting into the repository. It's better to make sure you aren't committing files with issues beforehand - you can run commandnpm run lint-staged
when you've staged the files to check if there are issues.
If for some reason you really want to commit the code that fails linting add--no-verify
parameter tocommit
call
commit --no-verify