build: add JSON and YAML linting via ESLint#10975
build: add JSON and YAML linting via ESLint#10975Planeshifter wants to merge 1 commit intophilipp/gh54-delete-legacy-configfrom
Conversation
Ref: stdlib-js/metr-issue-tracker#55 - Add `eslint-plugin-jsonc` and `eslint-plugin-yml` as devDependencies - Create `etc/eslint/rules/json.js` with 10 rules enforcing JSON spec compliance (indent, no-dupe-keys, comma-dangle, etc.) - Create `etc/eslint/rules/yaml.js` with 12 rules for YAML formatting and best practices (indent, block-mapping, quotes as warn, etc.) - Add 5 config blocks to `eslint.config.cjs`: base JSON, cli_opts.json tab override, package.json key ordering (canonical stdlib order), base YAML, and GitHub Actions workflow key ordering - Un-ignore `.github/` and `.codecov.yml` in global ESLint ignores - Create custom `stdlib/yaml-license-header` rule enforcing Apache-2.0 license header at the start of YAML files - Register the new rule in the stdlib ESLint plugin - Add `.cjs` to the filename linter's supported extensions allowlist - Add `lint-json` and `lint-yaml` Make targets with `--cache` - Wire new targets into the top-level `lint` prerequisite --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: passed - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
Resolves stdlib-js/metr-issue-tracker#55.
Description
This pull request:
eslint-plugin-jsoncwith 10 rules enforcing JSON spec compliance (indent, no-dupe-keys, comma-dangle, etc.), acli_opts.jsontab-indent override, andpackage.jsonkey ordering using the canonical stdlib key ordereslint-plugin-ymlwith 12 rules for formatting and best practices (indent, block-mapping, block-sequence, quotes as warn, etc.), plus GitHub Actions workflow root-key orderingstdlib/yaml-license-headerESLint rule enforcing the Apache-2.0 license header at the start of YAML fileslint-jsonandlint-yamlMake targets (with--cache) wired into the top-levellinttarget.github/and.codecov.ymlin ESLint global ignores so YAML files under.github/are linted.cjsto the filename linter's supported extensions allowlistRelated Issues
This pull request has the following related issues:
Questions
yml/quotesbe promoted fromwarntoerrornow, or after a separate auto-fix pass?jsonc/sort-keyskey ordering forpackage.jsoncomplete, or are there additional keys to include?Other
Stacked on
philipp/gh54-delete-legacy-config. The existing custompackage.jsonvalidator (@stdlib/_tools/lint/pkg-json) does AJV schema validation and is complementary — it stays.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was written primarily by Claude Code.
@stdlib-js/reviewers