bump checkout to 6
Included is a selection of rules which flag common problems.
Lint
-JS ( ESlint )
-JSON ( https://github.com/eslint/json )
-JSDoc (comment matter) in the luci-base module
-Markdown ( https://github.com/eslint/markdown )
For JSON, mandate standard JSON (not JSONC or JSON5) format,
**/*.json checks across the whole repo.
For JS, mandate sourceType: 'script', otherwise the linter
errors out about return methods in modules which masks other
problems. There are a number of structural design changes
needed to bring this repo into compliance with standards.
Each JS file is an individual script, despite their module
like structure, so functions and classes offloaded to
'common' files (individual scripts and not modules) are
invisible to linters unless we define them under the 'globals'
key. Custom rules and parsers are also possible.
For JSDoc, mandate some common checks to ensure the repo
will generate consistent documentation which links and displays
well.
For MD, check also JS syntax inside MD, as well as MD itself.
JS checks inside MD are not strict.
Included also eslint-formatter-gha (-f gha) which comments
on PRs when problems are detected in code additions. Actions
show green when no errors are reported (warnings are a pass)
but the gha will comment about warnings.
Flag `--diff-filter=ACM` shows only additions, and not
deletions.
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
- style with clean-jsdoc-theme (supports dark mode)
- add tutorials (jaguar has a problem with this structure)
- move doc gen stubs to doc_gen folder
This change moves the generated JS API docs from /luci/jsapi
to /luci via README.md which forms the index, and shall
point to a generated html file which exists. It currently
points to LuCI.html, which depends on JSDoc naming
conventions. So it's possible the link can break if modules
change names. But the TOC is always valid.
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
Use a GitHub Action to keep the docs updated, the current onces are 14
month old and outdated.
Use latest jsdoc package
Add full URL to LuCI.html file in README.md
Ignore generated HTML files via .gitignore
Signed-off-by: Paul Spooren <mail@aparcar.org>
Use another template for the JS api documentation which provides a better
overview over the classes and methods.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>