Skip to content

build: convert eslint.config to typescript and add our plugin#1112

Merged
michaelfaith merged 2 commits into
mainfrom
build/lint-config
Jun 16, 2025
Merged

build: convert eslint.config to typescript and add our plugin#1112
michaelfaith merged 2 commits into
mainfrom
build/lint-config

Conversation

@michaelfaith

Copy link
Copy Markdown
Owner

PR Checklist

Overview

This change migrates the eslint config to typescript, and adds our plugin's recommended config.

Tested locally to verify our plugin is working as expected. (This'll be great as an e2e smoke test)

screenshot

This change migrates the eslint config to typescript, and adds our plugin's recommended config.
@codecov

codecov Bot commented Jun 14, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.68%. Comparing base (3da9d12) to head (b0ebeb1).
Report is 8 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1112   +/-   ##
=======================================
  Coverage   99.68%   99.68%           
=======================================
  Files          22       22           
  Lines        1564     1564           
  Branches      205      205           
=======================================
  Hits         1559     1559           
  Misses          5        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This change migrates the eslint config to typescript, and adds our plugin's recommended config.
@michaelfaith michaelfaith marked this pull request as ready for review June 14, 2025 18:56
@michaelfaith

Copy link
Copy Markdown
Owner Author

@JoshuaKGoldberg You mentioned some warnings that you weren't a fan of (a reason to maybe wait until the next node release). What warnings were you talking about? ESLint's typescript config support relies on jiti. Unless you meant doing it without installing jiti?

Comment thread src/tests/index.test.ts
const eslint = new ESLint({
baseConfig: plugin.configs.recommended as Linter.Config,
fix: true,
overrideConfigFile: true,

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was necessary after adding our plugin to the root config. Without this, eslint was using our config in the root as part of this test (which wasn't really good to begin with)

Comment thread package.json
"eslint-plugin-regexp": "2.8.0",
"eslint-plugin-yml": "1.18.0",
"husky": "9.1.7",
"jiti": "^2.4.2",

@JoshuaKGoldberg JoshuaKGoldberg Jun 16, 2025

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JoshuaKGoldberg

Copy link
Copy Markdown
Collaborator

warnings that you weren't a fan of ... Unless you meant doing it without installing jiti?

Exactly: the warnings aren't there when tools like ESLint use runners/transpilers such as jiti. I just meant running a .ts file natively in Node.js with the native type stripping:

echo "console.log(123)" > index.ts
node index.ts
(node:50354) ExperimentalWarning: Type Stripping is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)

👍 that that's not an issue here since the PR has ESLint using jiti.

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙌 Great!

@michaelfaith michaelfaith merged commit 8a186ec into main Jun 16, 2025
14 checks passed
@michaelfaith michaelfaith deleted the build/lint-config branch June 16, 2025 17:43
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This is included in version v0.40.0 🎉

The release is available on:

Cheers! 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🛠 Tooling: Migrate eslint.config.js to typescript

2 participants