-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Update to stylelint 13 and latest schema #14
Conversation
6934a1f
to
e05fead
Compare
Not sure why Travis is still expected. We can ignore it. |
It's because branch configuration wasn't changes: Settings → Branches → |
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.
That's a great start, @jeddy3!
Don't release after merge, please. Let's discuss how can we use it for both stylelint core and stylelint plugins. I'll add my thoughts to stylelint/stylelint#4267 Actually, I'll create follow up PR after this one is merged. We'll keep same experience for outside users (add preset, and testRule
is available). For stylelint core we'll export a function require('jest-preset-stylelint/create-test-rule')
, which will inject stylelint
and return testRule
, which could be then added to global scope of stylelint core Jest runner.
Co-Authored-By: Aleks Hudochenkov <aleks@hudochenkov.com>
Sounds good to me! Are there any other changes, besides the peer dependency range change, that you'd like to see in this pull request? |
jest-setup.js
Outdated
|
||
jest.mock("./getOsEol.js", () => () => "\n"); | ||
jest.mock('./getOsEol', () => () => '\n'); | ||
|
||
global.testRule = (rule, schema) => { |
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.
BTW, why do we have rule
here? It's not used anywhere. It looks like it was added long time ago, and since then never had been removed.
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.
I don't know. I'll remove it in this pull request. That'll make for a cleaner function signature in 2.0.0
.
README.md
Outdated
|
||
Turn on autofix. | ||
|
||
### `only` \[boolean\] |
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.
I'm starting adding types #15 based on this PR, and discovered that this is incorrect.
only
could be only on a test case, but not on the whole testRule
. Same applies to skip
.
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.
Good catch.
}); | ||
``` | ||
|
||
## Schema properties |
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.
Missing syntax
.
README.md
Outdated
|
||
Description of the test case. | ||
|
||
#### `fixed` \[string\] |
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.
Discovered that unfixable
property description is missing.
@hudochenkov Thanks for the further review. I've addressed the requested changes. |
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.
Thanks for making changes!
Tiny typo to fix.
Co-Authored-By: Aleks Hudochenkov <aleks@hudochenkov.com>
Did you want to create the pull request into this branch to export the |
Merge it. I'll follow up later this week. And I could test this preset later with |
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.
Awesome work, have had a very quick look and looks good to me, thanks a bunch team 💯
Excellent. I've been testing it locally with |
Closes #13
This pull request overhauls the repository to bring it in line with:
testRule
schemaWhat we've lacked recently is an easy way for plugin authors test using the schema. This pull request addresses that immediate need.
Following on from this pull request, we can:
@stylelint/jest-preset
for setting up a common jest environment for stylelint organisation repositories; the preset would include the settings removed in the pull request, along with the Jest plugins we use in the main repo, e.g. typeahead