Repository navigation
Conversation
Closes OpenModelica#465. The @actions packages are already on their ESM-only majors (core 3, exec 3, tool-cache 4, cache 6) via dependabot, but the surrounding config never caught up with the template, and most of it was not actually being exercised. - eslint: `eslint src/**/*.ts` only ever linted `src`, so the jest plugin config and `tsconfig.test.json` in `parserOptions.project` were dead weight -- `__tests__` was never linted. Lint the whole tree with `eslint .` instead. That requires the root config files to belong to a project, so swap `parserOptions.project` for the template's `projectService` + `allowDefaultProject`, and ignore `coverage/` alongside `dist/`. - eslint.config.mjs had never been linted by its own rules: it kept `js` and a `__filename`/`__dirname` pair left over from the flat config migration, none of them used. Removed, along with the now-unused `node:path` and `node:url` imports. - rollup.config.ts imported `nodeResolve` as a default import, which `import/no-named-as-default` flags once the file is linted. Use the named import. - jest: `preset` was the deprecated `ts-jest/presets/default-esm` while `transform` already set `useESM`, and `moduleNameMapper` duplicated what `ts-jest-resolver` does. Reduce to the template's `preset: 'ts-jest'` + resolver, and add its `reporters`. - tsconfig: exclude `__tests__` and `dist` as the template does. `tsconfig.test.json` declares its own `exclude`, so tests are still type-checked there. - scripts: use the template's `format:write` / `format:check` names and run prettier over the whole tree rather than only `**/*.ts`. - CI ran neither lint nor format, so none of the above was enforced. Add both to the build job. `npm run package` produces a byte-identical `dist/index.js`, and the test suite reports the same results as before the change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`format:check` runs over the whole tree rather than only `**/*.ts`, so the Markdown and YAML that prettier had never touched need formatting once for CI to pass. Whitespace, quote style and Markdown table separators only -- `git diff -w` reduces this to prettier's own `singleQuote` preference and table padding, with no content change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
@AnHeuermann review please — this closes #465, which you assigned to @JKRT. (Claude Code agent acting on behalf of @JKRT.) Two things worth knowing before you look:
The second commit is a one-time prettier pass over the Markdown and YAML that One thing I did not do, deliberately: the issue asks for the ESLint config to |
`format:check` now covers the whole tree and runs in CI, which surfaced a latent problem: on windows-latest git checks out CRLF, prettier expects LF, and all 23 files fail. Neither condition held before -- the check was scoped to `**/*.ts` and CI never ran it -- so this never showed up. Add the template's `* text=auto eol=lf` so working trees are LF regardless of platform. Co-Authored-By: JKRT <jtinnerholm@gmail.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Head branch was pushed to by a user without write access
1a4f9bf to
fea339d
Compare
The apt release channel now serves OpenModelica 1.27.0, so the release test failed against its 1.26 expectation. The last version bump moved nightly and stable but missed this case. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Closes #465.
Starting point
The dependency half of #465 is already done — dependabot moved the repo onto the
ESM-only majors (
@actions/core3,@actions/exec3,@actions/tool-cache4,@actions/cache6), and"type": "module"+ rollup + flat ESLint config are allin place. What never caught up is the surrounding config — and most of it turned
out not to be exercised at all.
What was actually wrong
__tests__was never linted.lintwaseslint src/**/*.ts, so theeslint-plugin-jestsetup and thetsconfig.test.jsonentry inparserOptions.projectwere dead weight. Noweslint .covers the tree. Thatneeds the root config files to belong to a project, so
parserOptions.projectis replaced by the template's
projectService+allowDefaultProject, andcoverage/joinsdist/in the ignores.eslint.config.mjshad never been checked by its own rules. Once linted itreported an unused
jsimport and an unused__filename/__dirnamepair leftover from the flat-config migration. Removed, along with the
node:pathandnode:urlimports that only fed them.rollup.config.tsimportednodeResolveas a default import, whichimport/no-named-as-defaultflags as soon as the file is linted. Switched to thenamed import.
Jest config was doubled up.
presetwas the deprecatedts-jest/presets/default-esmwhiletransformalready passeduseESM: true,and
moduleNameMapperre-implemented whatts-jest-resolverwas already doing.Reduced to the template's
preset: 'ts-jest'+ resolver, plus itsreporters.tsconfig now excludes
__tests__anddistas the template does.tsconfig.test.jsondeclares its ownexclude, so tests are still type-checkedthere —
tsc --noEmit -p tsconfig.test.jsonpasses.Nothing enforced any of it.
test.ymlran onlypackageandtest, neverlint or format, so all of the above could drift indefinitely. Both are now steps
in the build job.
Scripts move to the template's
format:write/format:checknames and run overthe whole tree instead of
**/*.ts.Two commits
format:checknowcovers — kept separate because it is 118 lines of pure churn.
git diff -wreduces it to prettier's own
singleQuotepreference and Markdown tablepadding; no content changes.
Verification
npm run packageproduces a byte-identicaldist/index.js—git status dist/is clean, socheck-distis unaffected and the shipped action does notchange.
npm run lint,npm run format:checkandtsc --noEmit -p tsconfig.test.jsonall pass.
npm testreports the same results as before the change (the failures areenvironmental — the suite really does
apt installomc — and are identical onmain).Deliberately not done
eslint-plugin-githuband@stylisticare kept rather than swapped for thetemplate's prettier-plugin-based ESLint config. The issue asks for the ESLint
configuration to resemble the template, but that swap changes which rules apply
to
src/, which is a behavioural change to the action source rather than configalignment. Happy to do it as a follow-up if you want the full template ruleset.
Also noticed while running the suite: the tests leave
installLibs.mosandlinux-64.tar.gzin the working tree and neither is gitignored. Left alone here.🤖 Generated with Claude Code