-
-
Notifications
You must be signed in to change notification settings - Fork 927
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
Add url
secondary option to any rules
#7743
Conversation
🦋 Changeset detectedLatest commit: 8170609 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@emmacharp Thanks for the pull request! First of all, you can fix the system test failures by running the command: npx jest system-tests --updateSnapshot |
url
secondary option to any rules
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[suggest] We should add a new section for url
under the rules
section in the documentation:
https://github.com/stylelint/stylelint/blob/9a2e6540f92509628df76032262293ae57d32dda/docs/user-guide/configure.md#rules
[ask] @emmacharp Just to be sure, how will you specifically configure your rules when this |
Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
@ybiquitous, I do not see the need for function support as of now. |
This command is giving me errors. For instance:
Any idea why? |
Hum, I've never seen this error I might be wrong, but it seems due to environmental issues. Here's my environment (macOS latest) $ node -v && npm -v
v22.2.0
10.8.1 And the clean installation and updating Jest snapshots work for me. $ npm ci
...
$ npx jest system-tests --updateSnapshot
...
$ git status
On branch custom_urls
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: system-tests/002/__snapshots__/fs.test.mjs.snap
modified: system-tests/002/__snapshots__/no-fs.test.mjs.snap
modified: system-tests/003/__snapshots__/fs.test.mjs.snap
modified: system-tests/003/__snapshots__/no-fs.test.mjs.snap
modified: system-tests/004/__snapshots__/fs.test.mjs.snap
modified: system-tests/004/__snapshots__/no-fs.test.mjs.snap
modified: system-tests/005/__snapshots__/commonjs.test.cjs.snap
no changes added to commit (use "git add" and/or "git commit -a") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[suggest] Can you add a new test file named lib/__tests__/standalone-custom-url.mjs
to test this new feature? If you prefer another file name, you may take it.
I've been able to run jest by following the second option here: |
Oh, I forgot about Line 77 in 7a78847
So, we should run Jest like this (of course, npm run test --ignore-scripts -- --updateSnapshot system-tests/ |
I'm not really familiar with these kinds of test but I'll give it a shot and report back! |
This test file might be helpful: 👇🏼 If you find it too hard, feel free to ask for help. If you don't mind, I can also do that instead of you. 😃 |
Reporting back! I've created a test file here which seems to work as intended. Still new to Jest so I hope it really is. Hehe. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! LGTM 👍🏼
The only use case that I can see would be to dynamically change the anchor/fragment. |
Closes #7484
Based on @ybiquitous implementation proposal here. Additional changes were made to
lintSource.mjs
andvalidateOptions.mjs
as to prevent undefined errors and invalid option warnings.customUrls
property was added tocheckAgainstRule.mjs
as to pass certain tests.