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

fix(eslint-plugin): fix schemas across several rules and add schema tests#6947

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

Conversation

domdomegg
Copy link
Contributor

PR Checklist

Overview

Rebase of#6894 on top of v6, as per#6894 (comment)

@typescript-eslint
Copy link
Contributor

Thanks for the PR,@domdomegg!

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 onhttps://opencollective.com/typescript-eslint.

@netlify
Copy link

netlifybot commentedApr 22, 2023
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commit218f866
🔍 Latest deploy loghttps://app.netlify.com/sites/typescript-eslint/deploys/64ac791cbdc0840007912d71
😎 Deploy Previewhttps://deploy-preview-6947--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@nx-cloud
Copy link

nx-cloudbot commentedApr 22, 2023
edited
Loading

☁️ Nx Cloud Report

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

📂 See all runs for this branch


✅ Successfully ran 31 targets

Sent with 💌 fromNxCloud.

@codecov
Copy link

codecovbot commentedApr 22, 2023
edited
Loading

Codecov Report

Merging#6947 (218f866) intomain (6ae1fa7) willdecrease coverage by0.01%.
The diff coverage is92.85%.

Additional details and impacted files
@@            Coverage Diff             @@##             main    #6947      +/-   ##==========================================- Coverage   87.55%   87.54%   -0.01%==========================================  Files         375      377       +2       Lines       13167    13181      +14       Branches     3899     3899              ==========================================+ Hits        11528    11539      +11- Misses       1259     1262       +3  Partials      380      380
FlagCoverage Δ
unittest87.54% <92.85%> (-0.01%)⬇️

Flags with carried forward coverage won't be shown.Click here to find out more.

Impacted FilesCoverage Δ
...es/eslint-plugin/src/rules/parameter-properties.ts94.11% <ø> (ø)
packages/utils/src/ts-utils/isArray.ts0.00% <ø> (ø)
...s/eslint-plugin/src/rules/no-restricted-imports.ts95.38% <92.30%> (-0.92%)⬇️
packages/utils/src/ts-utils/index.ts100.00% <100.00%> (ø)

@bradzacherbradzacher added this to the6.0.0 milestoneApr 27, 2023
@bradzacherbradzacher added the bugSomething isn't working labelApr 27, 2023
}
};

const baseSchema = baseRule.meta.schema as {
Copy link
Member

Choose a reason for hiding this comment

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

question: why did you switch back to basing off of the base rule's schema here?
Any reason or was it just to go back to de-duping things?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

No strong reason: just to dedupe things / keep things in sync.

Comment on lines +2161 to +2175
describe('schema validation', () => {
// https://github.com/typescript-eslint/typescript-eslint/issues/6852
test("array-type does not accept 'simple-array' option", () => {
if (areOptionsValid(rule, [{ default: 'simple-array' }])) {
throw new Error(`Options succeeded validation for bad options`);
}
});

// https://github.com/typescript-eslint/typescript-eslint/issues/6892
test('array-type does not accept non object option', () => {
if (areOptionsValid(rule, ['array'])) {
throw new Error(`Options succeeded validation for bad options`);
}
});
});
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we should do a rule-tester style API here to remove the boilerplate.
For example something like this:

ruleOptionsTester(rule,{valid:[ ...],invalid:[[{default:'simple-array'}],['array'],],});

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Yeah, I think something like this would be neat if we end up doing a lot of these kinds of tests. For now I think it's simple enough that we can leave this to be done in future if necessary?

JoshuaKGoldberg reacted with thumbs up emoji
Copy link
Member

@bradzacherbradzacherJun 24, 2023
edited
Loading

Choose a reason for hiding this comment

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

Note that there is
eslint/rfcs#103 and the implementing PReslint/eslint#16823

This would allow us to include these tests in the rule like:

tester.run('rule',rule,{valid:[ ...],invalid:[ ...],fatal:[{options:['simple-array'],error:{name:'SchemaValidationError',message:'Whatever the json schema error is',},},{options:['array'],error:{name:'SchemaValidationError',message:'Whatever the json schema error is',},},],}

so definitely we don't need to bother with building a bespoke test framework!

@bradzacherbradzacher added the awaiting responseIssues waiting for a reply from the OP or another party labelApr 27, 2023
@JoshuaKGoldbergJoshuaKGoldberg removed this from the6.0.0 milestoneMay 25, 2023
@JoshuaKGoldberg
Copy link
Member

Removing from the v6 milestone as it doesn't actually block releasing v6 (I believe). Someone yell at me if that's wrong. 🙂

@JoshuaKGoldberg
Copy link
Member

Oh also,@domdomegg just checking in - are you waiting on us for anything? I believe our last status was waiting on you to re-request review to take another look.

domdomegg reacted with thumbs up emoji

@bradzacherbradzacher removed the awaiting responseIssues waiting for a reply from the OP or another party labelJun 24, 2023
bradzacher
bradzacher previously approved these changesJun 24, 2023
@bradzacher
Copy link
Member

@domdomegg if you want to update this againstv6 and resolve the conflicts, and get the CI passing - then we're good to merge this in!

@bradzacherbradzacher added awaiting responseIssues waiting for a reply from the OP or another party 1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we merge labelsJun 24, 2023
@domdomegg
Copy link
ContributorAuthor

I think we're ready@bradzacher /@JoshuaKGoldberg :)

@JoshuaKGoldbergJoshuaKGoldberg deleted the branchtypescript-eslint:mainJuly 10, 2023 17:52
@JoshuaKGoldberg
Copy link
Member

JoshuaKGoldberg commentedJul 10, 2023
edited
Loading

This was unintentionally auto-closed when we merged thev6 branch 🙃 it'll berecreated reopened.

@JoshuaKGoldbergJoshuaKGoldberg merged commitdd31bed intotypescript-eslint:mainJul 10, 2023
@domdomegg
Copy link
ContributorAuthor

Thanks@JoshuaKGoldberg 🙌

JoshuaKGoldberg reacted with heart emoji

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

@bradzacherbradzacherbradzacher left review comments

Assignees
No one assigned
Labels
1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we mergeawaiting responseIssues waiting for a reply from the OP or another partybugSomething isn't working
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Bug: [array-type] the configsimple-array should be disallowed by the schema
3 participants
@domdomegg@JoshuaKGoldberg@bradzacher

[8]ページ先頭

©2009-2025 Movatter.jp