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

enable a few ESLint rules #1173

Merged
merged 7 commits into from Nov 8, 2022
Merged

enable a few ESLint rules #1173

merged 7 commits into from Nov 8, 2022

Conversation

mrm007
Copy link
Collaborator

@mrm007 mrm007 commented Oct 26, 2022

@mrm007 mrm007 requested a review from a team as a code owner October 26, 2022 05:07
@changeset-bot
Copy link

changeset-bot bot commented Oct 26, 2022

⚠️ No Changeset found

Latest commit: 1bd1480

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@mrm007 mrm007 marked this pull request as draft October 26, 2022 05:52
@mrm007
Copy link
Collaborator Author

mrm007 commented Oct 26, 2022

Converting to draft while I tweak a few ESLint settings.

@seek-oss/braid-maintainers how do we feel about @typescript-eslint/consistent-type-imports?

@michaeltaranto
Copy link
Contributor

Converting to draft while I tweak a few ESLint settings.

@seek-oss/braid-maintainers how do we feel about @typescript-eslint/consistent-type-imports?

I quite like the explicitness. Does that disallow single-lined multi-typed imports? Eg.

import { fn, Foo } from 'Foo';

(where fn is a function and Foo is a type)

@mrm007
Copy link
Collaborator Author

mrm007 commented Oct 26, 2022

@michaeltaranto

The rule auto-fixes

import { fn, Foo } from 'foo';

to

import type { Foo } from 'foo';
import { fn } from 'Foo';

But if you (re)write it as

import { fn, type Foo } from 'foo';

that's also valid

@mrm007 mrm007 marked this pull request as ready for review October 31, 2022 05:12
Copy link
Contributor

@michaeltaranto michaeltaranto left a comment

Choose a reason for hiding this comment

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

Is the thinking that we will touch many of these files twice now? Once to extract type imports to standalone imports, and a second to revert to inline when the plugin supports that preference?

Outside of that, a few other minor comments.

.eslintrc.js Outdated Show resolved Hide resolved
package.json Outdated
@@ -59,7 +59,8 @@
"enquirer": "^2.3.6",
"escape-string-regexp": "^4.0.0",
"eslint": "^8.21.0",
"eslint-config-seek": "10.0.0",
"eslint-config-seek": "^10.1.0",
"eslint-plugin-canonical": "^3.1.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add this now or later when typescript-eslint/typescript-eslint#4338 is done?

Have we considered this going into eslint-config-seek or too opinionated you think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If TypeScript 4.5 is a blocker, I would add it later; forgot to remove it now.

Same thing with adding it to eslint-config-seek, aside from being (too) opinionated. If TS 4.5 stops people from upgrading, then it's not great.

Copy link
Contributor

@michaeltaranto michaeltaranto left a comment

Choose a reason for hiding this comment

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

Looks good to me 😅

@mrm007 mrm007 merged commit 3559582 into master Nov 8, 2022
@mrm007 mrm007 deleted the eslint-import-rules branch November 8, 2022 00:58
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.

None yet

2 participants