Add linters in images repository#1786
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds automated code linting infrastructure to the repository using GitHub Actions and super-linter. The linting covers Bash scripts, JavaScript files, JSON/JSONC files, and Dockerfiles across the repository, with test scripts specifically excluded from linting.
Changes:
- New GitHub Actions workflow for automated code linting on push to main and pull requests
- ESLint configuration for JavaScript and JSON/JSONC files with specific rules for build scripts
- ShellCheck configuration for Bash script validation with error-level severity
- Hadolint configuration for Dockerfile linting with specific rule exceptions
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| .github/workflows/code-linter.yml | Adds workflow using super-linter to validate Bash, JavaScript, JSON, and Dockerfiles on main branch pushes and PRs |
| .github/linters/eslint.config.mjs | ESLint flat config with rules for JavaScript files and JSON/JSONC parsing, including exceptions for specific build scripts |
| .github/linters/.shellcheckrc | ShellCheck config setting Bash mode, error-only severity, and disabling SC1101/SC1102 |
| .github/linters/.hadolint.yaml | Hadolint config with error threshold and ignored rules for Docker best practices |
Comments suppressed due to low confidence (1)
.github/linters/eslint.config.mjs:9
- Remove the
defineConfig()wrapper from the export statement. ESLint flat config does not use adefineConfigfunction. The export should beexport default [...]instead ofexport default defineConfig([...]).
export default defineConfig([
| @@ -0,0 +1,55 @@ | |||
| import { defineConfig } from "eslint/config"; | |||
There was a problem hiding this comment.
The import statement import { defineConfig } from "eslint/config" is incorrect. ESLint does not export a defineConfig function from "eslint/config". In ESLint flat config format, you should directly export an array of configuration objects without using defineConfig. Remove the import and the defineConfig() wrapper, and directly export the array.
This issue also appears on line 9 of the same file.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Description of changes: As part of this PR adding linters for the following type of files.
build/vscdccomponent.Changelog: The following files are changed.
.github/linterslocation.Checklist: