lint_js | R Documentation |
Runs ESLint on the JavaScript sources in the app/js
directory.
Requires Node.js to be available on the system.
lint_js(fix = FALSE)
fix |
Automatically fix problems. |
If your JS code uses global objects defined by other JS libraries or R packages,
you'll need to let the linter know or it will complain about undefined objects.
For example, the {leaflet}
package defines a global object L
.
To access it without raising linter errors, add /* global L */
comment in your JS code.
You don't need to define Shiny
and $
as these global variables are defined by default.
If you find a particular ESLint error inapplicable to your code, you can disable a specific rule for the next line of code with a comment like:
// eslint-disable-next-line no-restricted-syntax
See the ESLint documentation for full details.
None. This function is called for side effects.
if (interactive()) {
# Lint the JavaScript sources in the `app/js` directory.
lint_js()
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.