Conversation
Allow layout (l-) and page (p-) prefixes in addition to component (c-). Prefix order in patterns: lpc. Made-with: Cursor
Allow layout (l-) and page (p-) prefixes in addition to component (c-). Prefix order in patterns: lpc. Made-with: Cursor
Made-with: Cursor
YusukeHirao
approved these changes
Mar 9, 2026
arktds
reviewed
Apr 13, 2026
| !selector.startsWith('.l-') && | ||
| !selector.startsWith('.p-') | ||
| ) { | ||
| return `クラス名は「l-」「p-」「c-」のいずれかで始めてください: ${selector}`; |
Collaborator
There was a problem hiding this comment.
Suggested change
| return `クラス名は「l-」「p-」「c-」のいずれかで始めてください: ${selector}`; | |
| return `クラス名は「l-」「p-」「c-」のいずれかから始めてください: ${selector}`; |
Collaborator
There was a problem hiding this comment.
手段などの意味の「で」ではなく、手順などの意味の「から」のほうがより良いかなと思います。
| @@ -1,5 +1,5 @@ | |||
| .component { | |||
| // クラス名は「c-」から始めてください: .component | |||
| // クラス名は「l-」「p-」「c-」のいずれかで始めてください: .component | |||
Collaborator
There was a problem hiding this comment.
Suggested change
| // クラス名は「l-」「p-」「c-」のいずれかで始めてください: .component | |
| // クラス名は「l-」「p-」「c-」のいずれかから始めてください: .component |
|
|
||
| expect(violations).toStrictEqual([ | ||
| 'test/fixtures/stylelint/class-name.scss:1:1 クラス名は「c-」から始めてください: .component (selector-class-pattern)', | ||
| 'test/fixtures/stylelint/class-name.scss:1:1 クラス名は「l-」「p-」「c-」のいずれかで始めてください: .component (selector-class-pattern)', |
Collaborator
There was a problem hiding this comment.
Suggested change
| 'test/fixtures/stylelint/class-name.scss:1:1 クラス名は「l-」「p-」「c-」のいずれかで始めてください: .component (selector-class-pattern)', | |
| 'test/fixtures/stylelint/class-name.scss:1:1 クラス名は「l-」「p-」「c-」のいずれかから始めてください: .component (selector-class-pattern)', |
Collaborator
|
@yusasa16 |
Collaborator
|
各所「コンポーネント」から「ブロック」(またはより適切な名称)へリライトしたほうが良さそうな箇所があるので、別途プルリクエスト #848 を作成しました! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
デザイン作成において、Layout層とPage層の設置・ルール化を検討する。
それに伴い、それぞれの層に対応した接頭辞の追加する。
Close #846