Skip to content

chore: reorg repo level utils, lint and typecheck repo files #9618

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 28, 2024

Conversation

JamesHenry
Copy link
Member

@JamesHenry JamesHenry commented Jul 23, 2024

Supersedes #8880

Explainer/walkthrough for this PR: https://www.loom.com/share/2c128b6caecb420abda03871f3043bbb

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @JamesHenry!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint.

Copy link

netlify bot commented Jul 23, 2024

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 32036ed
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/66a69050bb310700087c36af
😎 Deploy Preview https://deploy-preview-9618--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 99 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 90 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

nx-cloud bot commented Jul 23, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 32036ed. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 4 targets

Sent with 💌 from NxCloud.

@JamesHenry JamesHenry force-pushed the workspace-level-commands branch 3 times, most recently from 8f505cd to 78f6275 Compare July 23, 2024 12:16
@JamesHenry JamesHenry changed the title chore: WIP chore: reorg repo level utils, lint and typecheck repo files Jul 23, 2024
@JamesHenry JamesHenry force-pushed the workspace-level-commands branch from 78f6275 to 4241c70 Compare July 23, 2024 12:39
@JamesHenry JamesHenry force-pushed the workspace-level-commands branch from 4241c70 to c9881fe Compare July 23, 2024 12:43
@JamesHenry JamesHenry marked this pull request as ready for review July 23, 2024 13:51
@abrahamguo
Copy link
Contributor

Nice! Thanks a bunch for doing this and putting together the detailed walkthrough.

I admire people who are knowledgeable and interested in the parts I'm not, like repo setup withnx haha

@@ -2,7 +2,8 @@
"compilerOptions": {
"types": ["@types/node"],
"noEmit": true,
"allowJs": true
"allowJs": true,
"allowImportingTsExtensions": true
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this needed?

Copy link
Member

Choose a reason for hiding this comment

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

Without it, yarn typecheck's tsc pass fails:

   ✖  nx run repo:typecheck
      > tsc
      
      tools/scripts/generate-configs.mts:18:8 - error TS5097: An import path can only end with a '.mts' extension when 'allowImportingTsExtensions' is enabled.
      
      18 } from './paths.mts';
                ~~~~~~~~~~~~~
      
      tools/scripts/generate-contributors.mts:10:27 - error TS5097: An import path can only end with a '.mts' extension when 'allowImportingTsExtensions' is enabled.
      
      10 import { REPO_ROOT } from './paths.mts';
                                   ~~~~~~~~~~~~~
      
      tools/scripts/generate-lib.mts:24:8 - error TS5097: An import path can only end with a '.mts' extension when 'allowImportingTsExtensions' is enabled.
      
      24 } from './paths.mts';
                ~~~~~~~~~~~~~
      
      tools/scripts/generate-sponsors.mts:6:34 - error TS5097: An import path can only end with a '.mts' extension when 'allowImportingTsExtensions' is enabled.
      
      6 import { PACKAGES_WEBSITE } from './paths.mts';
                                         ~~~~~~~~~~~~~
      
      
      Found 4 errors in 4 files.
      
      Errors  Files
           1  tools/scripts/generate-configs.mts:18
           1  tools/scripts/generate-contributors.mts:10
           1  tools/scripts/generate-lib.mts:24
           1  tools/scripts/generate-sponsors.mts:6

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah this was an option set in the tsconfig of repo-tools that I needed to carry over for this reason

Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Looks great to me, thanks @JamesHenry! Excited to see one less CHANGELOG.md 😄

@@ -1,12 +1,17 @@
// @ts-check
/* eslint-disable jsdoc/no-types */
Copy link
Member

Choose a reason for hiding this comment

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

This makes me think we should change eslint.config.mjs to only apply the TypeScript rules to TypeScript files. That's fine as a followup IMO.

Copy link
Member

Choose a reason for hiding this comment

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

😂 yes, good.

@@ -2,7 +2,8 @@
"compilerOptions": {
"types": ["@types/node"],
"noEmit": true,
"allowJs": true
"allowJs": true,
"allowImportingTsExtensions": true
Copy link
Member

Choose a reason for hiding this comment

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

Without it, yarn typecheck's tsc pass fails:

   ✖  nx run repo:typecheck
      > tsc
      
      tools/scripts/generate-configs.mts:18:8 - error TS5097: An import path can only end with a '.mts' extension when 'allowImportingTsExtensions' is enabled.
      
      18 } from './paths.mts';
                ~~~~~~~~~~~~~
      
      tools/scripts/generate-contributors.mts:10:27 - error TS5097: An import path can only end with a '.mts' extension when 'allowImportingTsExtensions' is enabled.
      
      10 import { REPO_ROOT } from './paths.mts';
                                   ~~~~~~~~~~~~~
      
      tools/scripts/generate-lib.mts:24:8 - error TS5097: An import path can only end with a '.mts' extension when 'allowImportingTsExtensions' is enabled.
      
      24 } from './paths.mts';
                ~~~~~~~~~~~~~
      
      tools/scripts/generate-sponsors.mts:6:34 - error TS5097: An import path can only end with a '.mts' extension when 'allowImportingTsExtensions' is enabled.
      
      6 import { PACKAGES_WEBSITE } from './paths.mts';
                                         ~~~~~~~~~~~~~
      
      
      Found 4 errors in 4 files.
      
      Errors  Files
           1  tools/scripts/generate-configs.mts:18
           1  tools/scripts/generate-contributors.mts:10
           1  tools/scripts/generate-lib.mts:24
           1  tools/scripts/generate-sponsors.mts:6

@JoshuaKGoldberg JoshuaKGoldberg added the 1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge label Jul 24, 2024
bradzacher
bradzacher previously approved these changes Jul 28, 2024
@JamesHenry JamesHenry dismissed stale reviews from bradzacher and JoshuaKGoldberg via 57a7c3f July 28, 2024 15:56
@JamesHenry JamesHenry merged commit 6b92aa5 into main Jul 28, 2024
62 checks passed
@JamesHenry JamesHenry deleted the workspace-level-commands branch July 28, 2024 19:04
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants