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

fix: call stylelint.validateOptions with the right arg, closes #32 #33

Merged
merged 2 commits into from
Oct 19, 2024

Conversation

MiniDigger
Copy link
Contributor

@MiniDigger MiniDigger commented Oct 17, 2024

Purpose of this pull request?

  • Bug fix

What changes did you make?

Does this pull request introduce a breaking change?

not sure, suddenly validating the rule config could cause malformed configs to break I guess?

Is there anything you'd like reviewers to focus on?

right now the tests fail, because now rule configs are actually validated for once.....
will take a look if I can fix them in a bit, else ill need help with that.

example failure:

plugin/stylelint-bem-namics > reject > { patternPrefixes: [], helperPrefixes: [ 'is', 'has' ] } > '.is-m-block {}' > no description
    Error: expect(received).toMatchObject(expected)

    - Expected  - 1
    + Received  + 1

      Object {
    -   "text": "Expected class name \"is-m-block\" to use the is-[block]--[is] syntax. (plugin/stylelint-bem-namics)",
    +   "text": "Unexpected option value \"{\"patternPrefixes\":[],\"helperPrefixes\":[\"is\",\"has\"]}\" for rule \"plugin/stylelint-bem-namics\"",
      }
        at C:\Gothaer\Projects\stylelint-bem\node_modules\jest-preset-stylelint\getTestRule.js:102:33
        at async file:///C:/Gothaer/Projects/stylelint-bem/node_modules/tinypool/dist/esm/entry/worker.js:72:20

edit: I have pushed changes that fix the tests by properly passing a "possible" object to the validateOptions method. not sure if this is a breaking change or if the validation rules are correct, I am not a direct consumer of this package.

@ernscht
Copy link
Member

ernscht commented Oct 18, 2024

@MiniDigger thanks
The PR is still in draft status. Are you going to do anything else?

@MiniDigger
Copy link
Contributor Author

ah, sorry, no, forgot to remove it after the second commit

and ill also regenerate the lockfile without references to my companies npm proxy, lol

@MiniDigger MiniDigger marked this pull request as ready for review October 19, 2024 07:37
Copy link
Member

@ernscht ernscht left a comment

Choose a reason for hiding this comment

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

Good work. Thank you very much.
Since you cleaned up the lockfile, I'll merge it and maybe clean it up a bit later before we republish.

@ernscht ernscht merged commit 629962b into merkle-open:master Oct 19, 2024
6 checks passed
@MiniDigger MiniDigger deleted the fix/GH-32-stylelint-16.10 branch October 19, 2024 14:07
@ernscht
Copy link
Member

ernscht commented Oct 21, 2024

Fix is published as v10.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

broken with stylelint 16.10: TypeError: Cannot read properties of undefined (reading 'config')
3 participants