Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: Move shared types into their own package#425

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
bradzacher merged 17 commits intomasterfromutils-pkg
May 10, 2019
Merged

Conversation

bradzacher
Copy link
Member

@bradzacherbradzacher commentedApr 11, 2019
edited
Loading

Fixes#330,#335,#413

Happy to change the name of the package, wasn't sure what to call it.

This PR moves the ESLint override types (and thecreateRule function) out of theeslint-plugin package and into a new package.

This should make it easier for people to consume our libraries when writing rules they don't want to submit here (because they're internal rules, etc), or when they're writing an eslint plugin in typescript.

j-f1 and otofu-square reacted with thumbs up emojiotofu-square and uniqueiniquity reacted with hooray emoji
@bradzacherbradzacher added the enhancementNew feature or request labelApr 11, 2019
@bradzacherbradzacher requested a review froma teamApril 11, 2019 22:39
@codecov
Copy link

codecovbot commentedApr 12, 2019
edited
Loading

Codecov Report

Merging#425 intomaster willdecrease coverage by0.73%.
The diff coverage is68.88%.

@@            Coverage Diff            @@##           master    #425      +/-   ##=========================================- Coverage   96.23%   95.5%   -0.74%=========================================  Files          83      88       +5       Lines        4067    4093      +26       Branches     1149    1150       +1     =========================================- Hits         3914    3909       -5- Misses         52      82      +30- Partials      101     102       +1
Impacted FilesCoverage Δ
...ackages/eslint-plugin/src/rules/prefer-includes.ts100% <ø> (ø)⬆️
...slint-plugin/src/rules/no-unnecessary-qualifier.ts96.07% <ø> (ø)⬆️
packages/eslint-plugin/src/rules/array-type.ts91.35% <ø> (ø)⬆️
packages/eslint-plugin/src/rules/member-naming.ts100% <ø> (ø)⬆️
...plugin/src/rules/prefer-string-starts-ends-with.ts100% <ø> (ø)⬆️
...s/experimental-utils/src/eslint-utils/deepMerge.ts88.23% <ø> (ø)
packages/typescript-estree/src/ast-converter.ts100% <ø> (ø)⬆️
packages/parser/src/scope/scopes.ts100% <ø> (ø)⬆️
...xperimental-utils/src/eslint-utils/applyDefault.ts83.33% <ø> (ø)
...slint-plugin/src/rules/prefer-namespace-keyword.ts100% <ø> (ø)⬆️
... and68 more

@bradzacherbradzacher marked this pull request as ready for reviewApril 27, 2019 03:13
@bradzacherbradzacher requested review fromJamesHenry and removed request fora teamMay 7, 2019 01:00
Copy link
Member

@JamesHenryJamesHenry left a comment

Choose a reason for hiding this comment

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

This looks really good! I will start using it right away on the stuff I mentioned on slack.

However, please could we call it:

@typescript-eslint/experimental-utils

I think it would be really useful for it to initially not fall under propersemver to give us chance to "move fast and break things" for a bit. As we use it outside the monorepo we might well find things we need to tweak.

So we could haveexperimental in the name and then a corresponding disclaimer in the README of the package that that is what our plan is. "Feel free to use it, but no guarantees between minor version s"

We can then promote it to be just:

@typescript-eslint/utils

In v2.0.0.

WDYT?

@bradzacher
Copy link
MemberAuthor

@typescript-eslint/experimental-utils

Sounds like a good idea!
I'll make the change now :)

@bradzacherbradzacher mentioned this pull requestMay 9, 2019
14 tasks
# Conflicts:#packages/eslint-plugin/src/rules/no-extra-parens.ts#packages/eslint-plugin/tests/RuleTester.ts#packages/eslint-plugin/typings/ts-eslint.d.ts
# Conflicts:#packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts
# Conflicts:#packages/eslint-plugin/tests/RuleTester.ts#packages/eslint-plugin/tests/rules/indent/indent.test.ts#packages/eslint-plugin/typings/ts-eslint.d.ts
@bradzacherbradzacher added awaiting responseIssues waiting for a reply from the OP or another party and removed awaiting responseIssues waiting for a reply from the OP or another party labelsMay 9, 2019
@bradzacherbradzacher merged commita7a03ce intomasterMay 10, 2019
@bradzacherbradzacher deleted the utils-pkg branchMay 10, 2019 16:10
@SimenB
Copy link
Contributor

Hello! 👋

This should make it easier for people to consume our libraries when writing rules they don't want to submit here (because they're internal rules, etc), orwhen they're writing an eslint plugin in typescript.

I tried to do this, and it broke horribly since the utils depend ontypescript. Is that on purpose? I'd like to author the plugin in TS, but that shouldn't be visible to consumers of the plugin.

Sorta related, I got a type error in the test unless I specified the TS parser - are the plugins compatible with the standard parser, or will the type safety be wrong if another parser is used?

Refjest-community/eslint-plugin-jest#269

@bradzacher
Copy link
MemberAuthor

@SimenB - there's no direct dependency on typescript, but there is a peer dependency:
https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/experimental-utils/package.json#L42-L45

The package re-exports some things fromtypescript-estree via the default entry point
https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/experimental-utils/src/index.ts#L9-L14

Which causes the package to init, and it has a dependency of typescript (it's marked as a peer dep to help out thecreate-react-app folks that do some dual install stuff (#443).

I'll put up a fix so that this doesn't happen.

SimenB reacted with rocket emoji

@SimenB
Copy link
Contributor

SimenB commentedJun 3, 2019
edited
Loading

Ah, that's awesome! Thanks.

Thoughts on not specifyingparser inRuleTester?

I'd like to run tests with the default eslint parser

@bradzacher
Copy link
MemberAuthor

feel free to open a PR if you want!
I thought about that but was deferring on it till someone complained :)
Happy to have it as a generic so that it is easy to enforce a specific parser string at compile time.

SimenB reacted with thumbs up emoji

@SimenB
Copy link
Contributor

SimenB commentedJun 3, 2019
edited
Loading

Hehe, fair enough! I'll see what I can do

Happy to have it as a generic so that it is easy to enforce a specific parser string at compile time.

How so? I thought to just make itparser?: string

@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsApr 21, 2020
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@uniqueiniquityuniqueiniquityuniqueiniquity left review comments

@j-f1j-f1j-f1 left review comments

@JamesHenryJamesHenryJamesHenry approved these changes

Assignees
No one assigned
Labels
enhancementNew feature or request
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Publish typescript-eslint utilities for 3rd party plugin authors
5 participants
@bradzacher@SimenB@JamesHenry@uniqueiniquity@j-f1

[8]ページ先頭

©2009-2025 Movatter.jp