Workflow file: check-javascript-task.yml
Use ESLint to lint the repository's JavaScript files.
Note: This workflow is focused on linting. Formatting checks for JavaScript are provided by the "Check Prettier Formatting" workflow (Task), so both should be used.
This is the version of the workflow for projects using the Task task runner tool.
Install the check-javascript-task.yml GitHub Actions workflow to .github/workflows/
.eslintrc.yml- ESLint configuration file. ❗ The code style defined in this file is the official standardized style to be used in all Arduino projects and should not be modified.- Install to: repository root
.npmrc- npm configuration file.- Install to: repository root.
Taskfile.yml- JavaScript linting tasks.- Install to: repository root (or merge into the existing
Taskfile.yml).
- Install to: repository root (or merge into the existing
Taskfile.yml- npm tasks.- Install to: repository root (or merge into the existing
Taskfile.yml).
- Install to: repository root (or merge into the existing
The tool dependencies of this workflow are managed by Go and npm.
If the project does not already have a go.mod file, install Go and then run the following command:
go mod init <module path>
(where <module path> is the URL of the project repository without the scheme e.g., github.com/foo/bar)
Add the tool dependencies by running the following command:
go get -tool github.com/go-task/task/v3/cmd/task@v3.44.1
Commit the resulting changes to the go.mod and go.sum files.
Add the dependencies by running this command:
npm install --save-dev eslint@^8.57.0 eslint-config-prettier@^10.1.8
npx install-peerdeps --dev eslint-config-airbnb-base
Commit the resulting changes to the package.json and package-lock.json files.
Add the following to /.gitignore:
/node_modules/Configure the version of Node.js used for development of the project by running the following command from a terminal in the project repository folder:
npm pkg set engines.node=22.x
Markdown badge:
[](https://github.com/TODO_REPO_OWNER/TODO_REPO_NAME/actions/workflows/check-javascript-task.yml)Replace the TODO_REPO_OWNER and TODO_REPO_NAME placeholders in the URLs with the final repository owner and name (example).
Asciidoc badge:
image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/check-javascript-task.yml/badge.svg["Check JavaScript status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/check-javascript-task.yml"]Define the {repository-owner} and {repository-name} attributes and use them throughout the readme (example).
Add infrastructure to lint JavaScript code
A task is provided to run ESLint on the project's JavaScript files.
A GitHub Actions workflow is included to automatically run the task. The workflow is triggered on any push or pull that
changes relevant project files, in order to avoid the introduction of problems with the project filesystem. It is also
triggered periodically, in order to catch breakage caused by external changes.
A task is provided to run [**ESLint**](https://eslint.org/) on the project's JavaScript files.
A GitHub Actions workflow is included to automatically run the task. The workflow is triggered on any push or pull that
changes relevant project files, in order to avoid the introduction of problems with the project filesystem. It is also
triggered periodically, in order to catch breakage caused by external changes.