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): [naming-convention] cover case that requires quotes#4582

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

lonyele
Copy link
Contributor

PR Checklist

Overview

Report errors if it needs quotes

@nx-cloud
Copy link

nx-cloudbot commentedFeb 22, 2022
edited
Loading

☁️ Nx Cloud Report

CI ran the following commands for commitc0b4b29. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 48 targets

Sent with 💌 fromNxCloud.

@typescript-eslint
Copy link
Contributor

Thanks for the PR,@lonyele!

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. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitorsper day.

@netlify
Copy link

netlifybot commentedFeb 22, 2022
edited
Loading

✔️ Deploy Preview fortypescript-eslint ready!

🔨 Explore the source changes:c0b4b29

🔍 Inspect the deploy log:https://app.netlify.com/sites/typescript-eslint/deploys/621e226a702a2900080846e1

😎 Browse the preview:https://deploy-preview-4582--typescript-eslint.netlify.app

@codecov
Copy link

codecovbot commentedFeb 22, 2022
edited
Loading

Codecov Report

Merging#4582 (328c4a1) intomain (fabfc2b) willincrease coverage by1.99%.
The diff coverage is100.00%.

❗ Current head328c4a1 differs from pull request most recent headc0b4b29. Consider uploading reports for the commitc0b4b29 to get more accurate results

@@            Coverage Diff             @@##             main    #4582      +/-   ##==========================================+ Coverage   92.41%   94.41%   +1.99%==========================================  Files         350      151     -199       Lines       12059     8229    -3830       Branches     3430     2623     -807     ==========================================- Hits        11144     7769    -3375+ Misses        642      262     -380+ Partials      273      198      -75
FlagCoverage Δ
unittest94.41% <100.00%> (+1.99%)⬆️

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

Impacted FilesCoverage Δ
...gin/src/rules/naming-convention-utils/validator.ts95.54% <100.00%> (+0.02%)⬆️
packages/type-utils/src/getTypeArguments.ts
...e-manager/src/definition/TSEnumMemberDefinition.ts
...s/scope-manager/src/scope/ClassStaticBlockScope.ts
...ges/typescript-estree/src/create-program/shared.ts
packages/typescript-estree/src/version-check.ts
packages/scope-manager/src/scope/ClassScope.ts
...ckages/scope-manager/src/referencer/TypeVisitor.ts
packages/scope-manager/src/lib/es2021.intl.ts
packages/scope-manager/src/lib/es2020.ts
... and190 more

@lonyele
Copy link
ContributorAuthor

lonyele commentedFeb 22, 2022
edited
Loading

hm... it took some time after the comment because I was trying to fix the playground but failed...

Copy link
Member

@JoshuaKGoldbergJoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Source code looks great, thanks@lonyele!

Just requesting changes on a bit more test coverage please.

lonyele reacted with thumbs up emoji
@JoshuaKGoldbergJoshuaKGoldberg added the awaiting responseIssues waiting for a reply from the OP or another party labelFeb 23, 2022
@bradzacherbradzacher added the bugSomething isn't working labelFeb 23, 2022
@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 labelsMar 1, 2022
Copy link
Member

@bradzacherbradzacher left a comment

Choose a reason for hiding this comment

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

LGTM - thanks heaps for this!
@JoshuaKGoldberg feel free to merge if you're happy too 😄

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

@JoshuaKGoldbergJoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Yup, looks great to me - thanks!

@JoshuaKGoldbergJoshuaKGoldbergenabled auto-merge (squash)March 1, 2022 13:40
@JoshuaKGoldbergJoshuaKGoldberg merged commit3ea0947 intotypescript-eslint:mainMar 1, 2022
@alfaproject
Copy link

Oh man, this got really noisy in our projects. We work with a lot of external APIs and data sources and some of them use all kind of characters like #, @, even spaces

So, we basically quote those properties so that we bypass naming conventions but now that stopped working. Can we add a an option to ignore quoted properties? There's a reason they are quoted to begin with ):

fmal, jviney, and CamilleDrapier reacted with thumbs up emoji

@lonyele
Copy link
ContributorAuthor

Oh god... I hear you. If maintainers agree with it. I'll make a PR that makes this an option

fmal and jviney reacted with thumbs up emoji

@alfaproject
Copy link

That would be awesome

@fmal
Copy link

fmal commentedMar 8, 2022

@lonyele@alfaproject this becomes especially annoying with selectors when you use some css-in-js:

Screenshot 2022-03-08 at 08 14 41

I don't want to addeslint-disable rule before selectors, nor do i want to specify some complex filter regex :(

@alfaproject
Copy link

Yeah that's another good use case to disable quoted properties

@bradzacher
Copy link
Member

No need for an option - the rule is already designed to support this and it's already documented in the rule docs:
https://typescript-eslint.io/rules/naming-convention/#ignore-properties-that-require-quotes

lonyele, CamilleDrapier, and gustavkj reacted with thumbs up emoji

@alfaproject
Copy link

alfaproject commentedMar 8, 2022
edited
Loading

Oh I was using filter to work around it. Didn't realise there was that modifier. Sorry for the noise, I'll give it a try

Edit: Actually, not quite sure how that works. Is this wrong?https://typescript-eslint.io/play/#ts=4.5.2&sourceType=module&code=PQKgUApgzgNglgOwC5gATtQIgAJIJ4AO0AxgE5wFIC008ywCAhgLaIDmVxA9ggG4TI4PTAC5UAbTQZp6TBFKkupTABopMjAG91GjJgBmcGEnmjUmrM0ZJiACzP7GMKBBVZSENhAAeZzOKoRADoAYmwAHXDxSIBdGMxUAF81XRkDJSskM3FMYhYIGABhRhdMGJTUvRcYCGIkJT8AEwhHAFdjTB0NZK6ZbUq9fQzrMwR2mAqBzGYuRrhDeShszA8AR1a4DygARVauEyXy3o1Matr65TEcrgAjACtzgBk4E1InAAVFIlJ8MuOMHoDfoDLCGYymMQWabWOwOJwuNwrTw+PwBYJhSLRcJxBKAkHpUiZZZ5ZgFYqlRHvEp5IolCCqLBQJgAawgAH08hSsABVd7vACiACU2YUAIIAZX5ZUmlUwNUYcwQbG5CGapCg3A8ficMC4AHdxewagB5UgAES4rRuNVU-2kpwK5waV0wtwedWerw+X3kv0R+CIny431+MTtSRl0jDIGAYDA3AQUCQqCGXFQAF5zDoAOQARmzYmzN0YpGzakSYCAA&rules=N4XyA&tsConfig=N4XyA

(the filters are my work-around for other quoted properties but I was hoping to get rid of them)

@bradzacher
Copy link
Member

Afilter will make the config higher precedence than others.
Hence it is matching before therequiresQuotes config.

crapStone pushed a commit to Calciumdibromid/CaBr2 that referenced this pull requestMar 8, 2022
This PR contains the following updates:| Package | Type | Update | Change ||---|---|---|---|| [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint) | devDependencies | minor | [`5.13.0` -> `5.14.0`](https://renovatebot.com/diffs/npm/@typescript-eslint%2feslint-plugin/5.13.0/5.14.0) || [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint) | devDependencies | minor | [`5.13.0` -> `5.14.0`](https://renovatebot.com/diffs/npm/@typescript-eslint%2fparser/5.13.0/5.14.0) |---### Release Notes<details><summary>typescript-eslint/typescript-eslint (@&#8203;typescript-eslint/eslint-plugin)</summary>### [`v5.14.0`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#&#8203;5140-httpsgithubcomtypescript-eslinttypescript-eslintcomparev5130v5140-2022-03-07)[Compare Source](typescript-eslint/typescript-eslint@v5.13.0...v5.14.0)##### Bug Fixes-   **eslint-plugin:** \[naming-convention] cover case that requires quotes ([#&#8203;4582](typescript-eslint/typescript-eslint#4582)) ([3ea0947](typescript-eslint/typescript-eslint@3ea0947))-   **eslint-plugin:** \[no-misused-promises] factor thenable returning function overload signatures ([#&#8203;4620](typescript-eslint/typescript-eslint#4620)) ([56a09e9](typescript-eslint/typescript-eslint@56a09e9))-   **eslint-plugin:** \[prefer-readonly-parameter-types] handle class sharp private field and member without throwing error ([#&#8203;4343](typescript-eslint/typescript-eslint#4343)) ([a65713a](typescript-eslint/typescript-eslint@a65713a))-   **eslint-plugin:** \[return-await] correct autofixer in binary expression ([#&#8203;4401](typescript-eslint/typescript-eslint#4401)) ([5fa2fad](typescript-eslint/typescript-eslint@5fa2fad))##### Features-   **eslint-plugin:** \[no-misused-promises] add granular options within `checksVoidReturns` ([#&#8203;4623](typescript-eslint/typescript-eslint#4623)) ([1085177](typescript-eslint/typescript-eslint@1085177))</details><details><summary>typescript-eslint/typescript-eslint (@&#8203;typescript-eslint/parser)</summary>### [`v5.14.0`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/parser/CHANGELOG.md#&#8203;5140-httpsgithubcomtypescript-eslinttypescript-eslintcomparev5130v5140-2022-03-07)[Compare Source](typescript-eslint/typescript-eslint@v5.13.0...v5.14.0)**Note:** Version bump only for package [@&#8203;typescript-eslint/parser](https://github.com/typescript-eslint/parser)</details>---### Configuration📅 **Schedule**: At any time (no schedule defined).🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.--- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.---This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).Co-authored-by: cabr2-bot <cabr2.help@gmail.com>Reviewed-on:https://codeberg.org/Calciumdibromid/CaBr2/pulls/1201Reviewed-by: 6543 <6543@noreply.codeberg.org>Co-authored-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>Co-committed-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
@philip-firstorder
Copy link

I think this should have been released to a major version, it currently broke our pipelines linting stages and we had no idea what caused this.
Anyone having a version lower than ^5.14.0 might suddenly get errors.

@JoshuaKGoldberg
Copy link
Member

major version

Thus we see the great dislike from language, linter, and similar teams for the illusion of semantic versioning. Pretty much any logical change to a lint rule could be seen as a "breaking" change. Covering cases that previously weren't checked -both in the case of a bugfix and a lacking feature- breaks users who upgrade. If we released a major version every time one of these changes was released and wanted users to receive those updates at any reasonable cadence, we'd have to release a new major version every month and still be shipping dozens of breaking changes per version.

broke our pipelines linting stages

General good practice & our recommendation is to lock your dependencies to a fixed version, such as with a fixed range in apackage.json and/or a lockfile. Use a tool such as dependabot or renovate to send PRs for specific package updates on a cadence.

Happy to move this discussion to a new issue if you think I'm wrong about either of those things and we should reevaluate our release strategy!

@bradzacher
Copy link
Member

Definitely agree on the lock file - you should be using the same versions in dev as you do on your CI. If the two are running different versions then you're in for a bad time!

And strong agree on the versioning. Fixing a bug which uncovers cases that previously weren't caught is not what we define as a breaking change. For us breaking changes are pretty much only for cases where config needs to change.

It's similar to why TS doesn't follow semver - because it's impossible to change a lint rule without changingint results.

As per our contributing guidelines, we prefer to not have discussions on closed PRs because they're not easily searchable.
If you'd like to discuss this further - feel free to open an issue.

@typescript-eslinttypescript-eslint locked asresolvedand limited conversation to collaboratorsMar 10, 2022
@lonyelelonyele deleted the fix/guard-quote branchMarch 11, 2022 05:10
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@JoshuaKGoldbergJoshuaKGoldbergJoshuaKGoldberg approved these changes

@bradzacherbradzacherbradzacher approved these changes

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 mergebugSomething isn't working
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

[naming-convention] camelCase allows kebab-case in property
6 participants
@lonyele@alfaproject@fmal@bradzacher@philip-firstorder@JoshuaKGoldberg

[8]ページ先頭

©2009-2025 Movatter.jp