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: add eslint-plugin-no-attribute-string-literals #5086

Merged
merged 2 commits into from
Nov 1, 2023

Conversation

ricokahler
Copy link
Contributor

Description

This PR overhauls the ESLint config to:

  1. Utilize the typescript config by default. Most of our codebase is in TypeScript now and it doesn't seem necessary to have two separate configs when typescript-eslint works for both javascript and typescript files. This simplifies the overrides section.
  2. The overrides section now includes new patterns for matching and disables localization string rules in those areas.
  3. eslint-plugin-no-attribute-string-literals was added to target string literals inside of JSX attributes with an extensive config to prevent false positives. We can also configure this plugin to target certain elements instead of how it works now.

What to review

Try out the config. Ensure things work correctly.

Notes for release

N/A

@vercel
Copy link

vercel bot commented Oct 27, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
performance-studio ✅ Ready (Inspect) Visit Preview Nov 1, 2023 10:08pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2023 10:08pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Nov 1, 2023 10:08pm

@github-actions
Copy link
Contributor

github-actions bot commented Oct 27, 2023

Package Documentation Change
sanity +16%
@sanity/types +2%
sanity/desk +2%
Full Report
sanity
This branch Next branch
141 documented 122 documented
839 not documented 829 not documented
@sanity/types
This branch Next branch
54 documented 53 documented
233 not documented 233 not documented
sanity/desk
This branch Next branch
84 documented 83 documented
56 not documented 55 not documented
@sanity/diff
This branch Next branch
13 documented 13 documented
16 not documented 16 not documented
@sanity/block-tools
This branch Next branch
4 documented 4 documented
9 not documented 9 not documented
@sanity/portable-text-editor
This branch Next branch
21 documented 21 documented
44 not documented 44 not documented
@sanity/mutator
This branch Next branch
7 documented 7 documented
4 not documented 4 not documented
@sanity/cli
This branch Next branch
1 documented 1 documented
30 not documented 30 not documented
@sanity/schema/_internal
This branch Next branch
0 documented 0 documented
9 not documented 9 not documented
@sanity/util/paths
This branch Next branch
1 documented 1 documented
15 not documented 15 not documented
sanity/router
This branch Next branch
15 documented 15 documented
21 not documented 21 not documented
@sanity/util/legacyDateFormat
This branch Next branch
0 documented 0 documented
3 not documented 3 not documented
@sanity/schema
This branch Next branch
0 documented 0 documented
2 not documented 2 not documented
sanity/cli
This branch Next branch
2 documented 2 documented
0 not documented 0 not documented
@sanity/vision
This branch Next branch
0 documented 0 documented
2 not documented 2 not documented
@sanity/util/fs
This branch Next branch
0 documented 0 documented
3 not documented 3 not documented
sanity/_internal
This branch Next branch
0 documented 0 documented
1 not documented 1 not documented
@sanity/util/content
This branch Next branch
1 documented 1 documented
5 not documented 5 not documented

@github-actions
Copy link
Contributor

github-actions bot commented Oct 27, 2023

Component Testing Report Updated Nov 1, 2023 10:12 PM (UTC)

File Status Duration Passed Skipped Failed
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 10s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 11s 3 0 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 11s 6 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 15s 9 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 50s 18 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 11s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 7s 3 0 0

@rexxars rexxars requested a review from a team October 27, 2023 21:14
@jtpetty
Copy link
Contributor

jtpetty commented Oct 30, 2023

LGTM. It seems the lint issue is due to a literal string in sanity/src/core/studio/components/navbar/NavDrawer.tsx. I think the other failure is a flake.

Copy link
Member

@rexxars rexxars left a comment

Choose a reason for hiding this comment

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

Would have preferred to see the unification of TS/JS configs as a separate PR since this makes it harder to test, but approving given we can address any issues that may occur after the merge.

adds "no-attribute-string-literals/no-attribute-string-literals": "off"
@ricokahler ricokahler merged commit 8da45a0 into feat/i18n Nov 1, 2023
17 of 20 checks passed
@ricokahler ricokahler deleted the chore/lint-config-update branch November 1, 2023 22:08
bjoerge pushed a commit that referenced this pull request Nov 6, 2023
* chore: add eslint-plugin-no-attribute-string-literals

* chore: update workshop eslint configs for i18n

adds "no-attribute-string-literals/no-attribute-string-literals": "off"
bjoerge pushed a commit that referenced this pull request Nov 6, 2023
* chore: add eslint-plugin-no-attribute-string-literals

* chore: update workshop eslint configs for i18n

adds "no-attribute-string-literals/no-attribute-string-literals": "off"
bjoerge pushed a commit that referenced this pull request Nov 6, 2023
* chore: add eslint-plugin-no-attribute-string-literals

* chore: update workshop eslint configs for i18n

adds "no-attribute-string-literals/no-attribute-string-literals": "off"
rexxars pushed a commit that referenced this pull request Nov 17, 2023
* chore: add eslint-plugin-no-attribute-string-literals

* chore: update workshop eslint configs for i18n

adds "no-attribute-string-literals/no-attribute-string-literals": "off"
rexxars pushed a commit that referenced this pull request Nov 20, 2023
* chore: add eslint-plugin-no-attribute-string-literals

* chore: update workshop eslint configs for i18n

adds "no-attribute-string-literals/no-attribute-string-literals": "off"
rexxars pushed a commit that referenced this pull request Nov 22, 2023
* chore: add eslint-plugin-no-attribute-string-literals

* chore: update workshop eslint configs for i18n

adds "no-attribute-string-literals/no-attribute-string-literals": "off"
bjoerge pushed a commit that referenced this pull request Nov 27, 2023
* chore: add eslint-plugin-no-attribute-string-literals

* chore: update workshop eslint configs for i18n

adds "no-attribute-string-literals/no-attribute-string-literals": "off"
bjoerge pushed a commit that referenced this pull request Nov 28, 2023
* chore: add eslint-plugin-no-attribute-string-literals

* chore: update workshop eslint configs for i18n

adds "no-attribute-string-literals/no-attribute-string-literals": "off"
rexxars pushed a commit that referenced this pull request Nov 28, 2023
* chore: add eslint-plugin-no-attribute-string-literals

* chore: update workshop eslint configs for i18n

adds "no-attribute-string-literals/no-attribute-string-literals": "off"
rexxars pushed a commit that referenced this pull request Nov 28, 2023
* chore: add eslint-plugin-no-attribute-string-literals

* chore: update workshop eslint configs for i18n

adds "no-attribute-string-literals/no-attribute-string-literals": "off"
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.

3 participants