Skip to content

Commit d8703fc

Browse files
DilumAluthgecodex
andauthored
[🤖] Add CI job that runs the linter (ESLint), and fix some ESLint complaints in our source code (#172)
* Set up ESLint locally Co-authored-by: OpenAI Codex <codex@openai.com> * Add CI lint job Co-authored-by: OpenAI Codex <codex@openai.com> * Fix source for lint compliance Co-authored-by: OpenAI Codex <codex@openai.com> * Enable installed ESLint plugins Co-authored-by: OpenAI Codex <codex@openai.com> * Format renovate config for ESLint Co-authored-by: OpenAI Codex <codex@openai.com> * Update AGENTS lint guidance Co-authored-by: OpenAI Codex <codex@openai.com> * Remove unused npm dependencies Co-authored-by: OpenAI Codex <codex@openai.com> * Refresh npm lockfile Co-authored-by: OpenAI Codex <codex@openai.com> * Remove unused Jest toolchain Co-authored-by: OpenAI Codex <codex@openai.com> * Run tsc in lint command Co-authored-by: OpenAI Codex <codex@openai.com> * Build and check-in --------- Co-authored-by: OpenAI Codex <codex@openai.com>
1 parent b4d3330 commit d8703fc

File tree

17 files changed

+3366
-9502
lines changed

17 files changed

+3366
-9502
lines changed

‎.eslintrc.cjs‎

Lines changed: 0 additions & 7 deletions
This file was deleted.

‎.github/workflows/ci.yml‎

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ jobs:
1818
if: always() # this line is important to keep the `finalize` job from being marked as skipped; do not change or delete this line
1919
runs-on: ubuntu-latest
2020
timeout-minutes: 10
21-
needs: [build, checked-in-files, example, make-targets, stalecheck-npm-install]
21+
needs: [build, checked-in-files, example, lint-check, make-targets, stalecheck-npm-install]
2222
steps:
2323
- run: |
2424
echo build: ${{ needs.build.result }}
2525
echo checked-in-files: ${{ needs.checked-in-files.result }}
2626
echo example: ${{ needs.example.result }}
27+
echo lint-check: ${{ needs.lint-check.result }}
2728
echo make-targets: ${{ needs.make-targets.result }}
2829
echo stalecheck-npm-install: ${{ needs.stalecheck-npm-install.result }}
2930
# The last line must NOT end with ||
@@ -33,6 +34,7 @@ jobs:
3334
(needs.build.result != 'success') ||
3435
(needs.checked-in-files.result != 'success') ||
3536
(needs.example.result != 'success') ||
37+
(needs.lint-check.result != 'success') ||
3638
(needs.make-targets.result != 'success') ||
3739
(needs.stalecheck-npm-install.result != 'success')
3840
build:
@@ -167,22 +169,24 @@ jobs:
167169
cmd = Base.julia_cmd()
168170
julia_path = cmd.exec[1]
169171
@info "" julia_path Base.VERSION
170-
# lint-check:
171-
# timeout-minutes: 30
172-
# runs-on: ubuntu-latest
173-
# strategy:
174-
# fail-fast: false
175-
# steps:
176-
# ### Check out the repo:
177-
# - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
178-
# with:
179-
# persist-credentials: false
180-
# ### Install mise-en-place
181-
# - uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1
182-
# ### Install NodeJS (by using mise-en-place)
183-
# - run: make mise-install
184-
# ### Lint:
185-
# - run: make check-lint
172+
lint-check:
173+
timeout-minutes: 30
174+
runs-on: ubuntu-latest
175+
strategy:
176+
fail-fast: false
177+
steps:
178+
### Check out the repo:
179+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
180+
with:
181+
persist-credentials: false
182+
### Install mise-en-place
183+
- uses: jdx/mise-action@5228313ee0372e111a38da051671ca30fc5a96db # v3.6.3
184+
### Install NodeJS (by using mise-en-place)
185+
- run: make mise-install
186+
### Install the NodeJS packages that we depend on:
187+
- run: make install-packages
188+
### Lint:
189+
- run: make check-lint
186190
make-targets: # This is a job to make sure that none of the `make` targets bitrot
187191
timeout-minutes: 30
188192
runs-on: ${{ matrix.os }}

‎AGENTS.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
## Project Structure & Module Organization
44

5-
Core source lives in `src/` and is compiled to `lib/` with TypeScript. The GitHub Action bundle checked into releases is `dist/index.js`, generated with `tsup`. Repository metadata and runtime inputs are defined in `action.yml`. CI and integration validation live in `.github/workflows/` and `ci/test.jl`. Helper scripts are under `bin/`, and contributor notes are in `devdocs/`.
5+
Core source lives in `src/` and is compiled to `lib/` with TypeScript. The GitHub Action bundle checked into releases is `dist/index.cjs`, generated with `tsup`. Repository metadata and runtime inputs are defined in `action.yml`. CI and integration validation live in `.github/workflows/` and `ci/test.jl`. Helper scripts are under `bin/`, and contributor notes are in `devdocs/`.
66

7-
Treat `lib/` and `dist/` as generated outputs: when behavior changes in `src/`, rebuild and commit the updated artifacts. The action bundle must remain a single self-contained `dist/index.js`; if you touch the bundler config, verify runtime dependencies are not being externalized into separate files.
7+
Treat `lib/` and `dist/` as generated outputs: when behavior changes in `src/`, rebuild and commit the updated artifacts. The action bundle must remain a single self-contained `dist/index.cjs`; if you touch the bundler config, verify runtime dependencies are not being externalized into separate files.
88

99
## Build, Test, and Development Commands
1010

@@ -13,23 +13,23 @@ Use the `Makefile` wrappers documented in `devdocs/local_setup.md`:
1313
- `make mise-install`: install the pinned Node.js version from `.tool-versions`.
1414
- `make install-packages`: install dependencies with `npm ci`.
1515
- `make build`: compile TypeScript from `src/` to `lib/`.
16-
- `make pack`: bundle the action into `dist/index.js`.
16+
- `make pack`: bundle the action into `dist/index.cjs`.
1717
- `make everything-from-scratch`: clean, reinstall, build, pack, and clean again.
1818
- `make clean` / `make cleanall`: remove `node_modules/`, then also `lib/` and `dist/`.
1919

2020
## Coding Style & Naming Conventions
2121

22-
This project uses TypeScript with strict compiler settings from `tsconfig.json` and ESLint via `.eslintrc.cjs`. Follow the existing style: 4-space indentation, LF line endings, and simple module-level functions. Source files use lowercase names such as `juliaup.ts` and `platform.ts`; many internal helpers use snake_case names to match the current codebase.
22+
This project uses TypeScript with strict compiler settings from `tsconfig.json` and ESLint via `eslint.config.js`. Follow the existing style: 4-space indentation, LF line endings, and simple module-level functions. Source files use lowercase names such as `juliaup.ts` and `platform.ts`; many internal helpers use snake_case names to match the current codebase.
2323

2424
This repo uses ESM with `moduleResolution: "NodeNext"`. Local TypeScript imports in `src/` should use explicit `.js` extensions, and `tsconfig.json` should keep compilation scoped to `src/` so tool configs do not leak into `lib/`.
2525

26-
If you run linting manually, use `npx eslint .`. Prefer small, direct functions over abstractions.
26+
If you run linting manually, use `npm run lint`; it runs both `tsc --noEmit` and ESLint. Prefer small, direct functions over abstractions.
2727

2828
## Testing Guidelines
2929

30-
CI currently emphasizes build correctness and end-to-end validation. The main integration check is `julia ci/test.jl`, run after the local action installs Julia on the GitHub runner. If you add TypeScript unit tests, place them beside the source or in a matching test location with names ending in `*.test.ts`; Jest is already configured in `package.json`, so `npx jest --coverage` will pick them up.
30+
CI currently emphasizes build correctness and end-to-end validation. The main integration check is `julia ci/test.jl`, run after the local action installs Julia on the GitHub runner. If you add TypeScript unit tests, place them beside the source or in a matching test location with names ending in `*.test.ts`, and document any new test runner setup in `package.json` and this file.
3131

32-
Before opening a PR, run at least `make build` and `make pack`, then confirm there are no unintended diffs.
32+
Before opening a PR, run at least `npm run lint`, `make build`, and `make pack`, then confirm there are no unintended diffs.
3333

3434
## Commit & Pull Request Guidelines
3535

‎Makefile‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ cleanall: clean
3535

3636
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3737

38-
# .PHONY: check-lint
39-
# check-lint:
40-
# npx eslint .
38+
.PHONY: check-lint
39+
check-lint:
40+
npm run lint
4141

4242
# .PHONY: fix-lint
4343
# fix-lint:

0 commit comments

Comments
 (0)