Skip to content
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

chore(repo): Extend linting #1906

Merged
merged 16 commits into from
Oct 31, 2023
Merged

chore(repo): Extend linting #1906

merged 16 commits into from
Oct 31, 2023

Conversation

tmilewski
Copy link
Member

@tmilewski tmilewski commented Oct 17, 2023

Description

Our current ESLint configuration was global which left a lot to be desired as each of our packages have unique requirements.

This PR extends leans on a generic set of ESLint configurations while also allowing for a lot of customizability at both the ESLint "feature"-level as well as the package-level.

Please focus on this commit as these are the changes: f2c3b64
The other changes are to appease Prettier.

Please Note:

In an effort to keep this PR as minimal as possible, I've disabled a number of rules. The plan is to re-enable them via follow-on PRs.)

Other Notes:

  • The /integration directory has been factored into NPM workspaces and, ultimately, Turborepo. This doesn't have any tangible change other than running linting along with the packages.
  • ESLint (when utilizing Typescript) will target tsconfig.lint.json. If that does not exists, it moves on to tsconfig.json. The lint TSConfig was required in a few cases as the default one wasn't permissive enough with it's includes/excludes.
  • I had to skip the Husky tasks so that it didn't attempt to update and commit all of the "fixable" issues.

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Packages affected

  • @clerk/clerk-js
  • @clerk/clerk-react
  • @clerk/nextjs
  • @clerk/remix
  • @clerk/types
  • @clerk/themes
  • @clerk/localizations
  • @clerk/clerk-expo
  • @clerk/backend
  • @clerk/clerk-sdk-node
  • @clerk/shared
  • @clerk/fastify
  • @clerk/chrome-extension
  • gatsby-plugin-clerk
  • build/tooling/chore

@tmilewski tmilewski self-assigned this Oct 17, 2023
@tmilewski tmilewski requested a review from a team as a code owner October 17, 2023 18:29
@changeset-bot
Copy link

changeset-bot bot commented Oct 17, 2023

🦋 Changeset detected

Latest commit: 2ae8894

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
eslint-config-custom Minor
@clerk/backend Patch
@clerk/chrome-extension Patch
@clerk/clerk-js Patch
@clerk/clerk-expo Patch
@clerk/fastify Patch
gatsby-plugin-clerk Patch
@clerk/localizations Patch
@clerk/nextjs Patch
@clerk/clerk-react Patch
@clerk/remix Patch
@clerk/clerk-sdk-node Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@LekoArts
Copy link
Member

LekoArts commented Oct 18, 2023

How much of an effort would it be to to not use tsconfig.lint.json across the board and instead rely on tsconfig.json (and fixing those)? Just as an estimated guess

@tmilewski
Copy link
Member Author

How much of an effort would it be to to not use tsconfig.lint.json across the board and instead rely on tsconfig.json (and fixing those)? Just as an estimated guess

@LekoArts Not much of an effort, but it would make the tsconfig.json quite all-encompassing. I just didn't want to cause any unnecessary side-effects.

@tmilewski tmilewski force-pushed the tom/eslint branch 2 times, most recently from 32cf88c to 3998f07 Compare October 19, 2023 17:01
@@ -380,15 +380,6 @@ export interface OrganizationSuggestionJSON extends ClerkResourceJSON {
updated_at: number;
}

export interface OrganizationSuggestionJSON extends ClerkResourceJSON {
Copy link
Member Author

Choose a reason for hiding this comment

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

Note: This is an exact copy of the interface above it which ESLint didn't catch until now.

.husky/pre-commit Outdated Show resolved Hide resolved
@LekoArts
Copy link
Member

Is the addition of integration into the workspaces necessary? It'll mean that you have to install more dependencies for the monorepo even though you might not be interested in running the tests + you could more easily run into problems of "multiple different versions of packages".

In CI you could still cache the node_modules on an individual level for each test suite.

@tmilewski
Copy link
Member Author

tmilewski commented Oct 31, 2023

Is the addition of integration into the workspaces necessary? It'll mean that you have to install more dependencies for the monorepo even though you might not be interested in running the tests + you could more easily run into problems of "multiple different versions of packages".

In CI you could still cache the node_modules on an individual level for each test suite.

@LekoArts There's actually no noticeable difference. I should note that integrations is included, not integations/* so it's not attempting to install each integration test's deps.

@LekoArts
Copy link
Member

The integration folder doesn't have a package.json file (I see it in another commit but not in the total view of this PR). What you're saying makes sense then, but isn't that package.json then missing?

@tmilewski
Copy link
Member Author

The integration folder doesn't have a package.json file (I see it in another commit but not in the total view of this PR). What you're saying makes sense then, but isn't that package.json then missing?

Ah, you are correct, it's a remnant of a past commit. Updated, thanks!

Copy link
Member

@LekoArts LekoArts left a comment

Choose a reason for hiding this comment

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

:shipit:

@tmilewski tmilewski added this pull request to the merge queue Oct 31, 2023
Merged via the queue into main with commit c895629 Oct 31, 2023
7 checks passed
@tmilewski tmilewski deleted the tom/eslint branch October 31, 2023 16:26
@LekoArts LekoArts mentioned this pull request Nov 3, 2023
24 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants