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

Remove syntax option #5297

Merged
merged 10 commits into from May 15, 2021
Merged

Remove syntax option #5297

merged 10 commits into from May 15, 2021

Conversation

jeddy3
Copy link
Member

@jeddy3 jeddy3 commented May 12, 2021

Which issue, if any, is this issue related to?

Closes #5289

Is there anything in the PR that needs further explanation?

A work-in-progress pull request showing the removal of the:

  • syntax option in favour of customSyntax
  • syntaxes that aren't compatible with PostCSS 8

The rule tests reliant on the syntax option will fail until the Jest preset is updated and the tests themselves moved to customSyntax. The color-function-notation rule is done, and we can do the rest once #5295 and #5296 are merged.

This would be the third pull request for the v14 branch.

@jeddy3
Copy link
Member Author

jeddy3 commented May 14, 2021

I've:

  • added a message when the syntax option is used
  • moved all the rules over to customSyntax

I've commented out the PostCSS@8-incompatible syntax tests for each rule. We can reinstate them if the existing syntaxes are made compatible or move them to leaner and more specific syntaxes if they are written.

Once this pull request is merged, we can start work on all the other release issues including adding more messages to ease updating.

The tests will pass once stylelint/jest-preset-stylelint#32 is merged and released.

@jeddy3 jeddy3 marked this pull request as ready for review May 14, 2021 10:48
@jeddy3
Copy link
Member Author

jeddy3 commented May 14, 2021

This pull request is now ready for review.

@hudochenkov hudochenkov linked an issue May 14, 2021 that may be closed by this pull request
lib/getPostcssResult.js Outdated Show resolved Hide resolved
jeddy3 and others added 2 commits May 14, 2021 13:29
Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
Copy link
Member

@ybiquitous ybiquitous left a comment

Choose a reason for hiding this comment

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

[suggestion] It seems that we can remove this file: ⬇️

declare module '@stylelint/postcss-css-in-js';
declare module '@stylelint/postcss-markdown';
declare module 'postcss-html';
declare module 'postcss-sass';
declare module 'sugarss';

@ybiquitous
Copy link
Member

Also for postcss-syntax:

declare module 'postcss-syntax' {

@jeddy3
Copy link
Member Author

jeddy3 commented May 14, 2021

I've removed the redundant types.

docs/user-guide/usage/postcss-plugin.md Outdated Show resolved Hide resolved
lib/rules/color-function-notation/__tests__/index.js Outdated Show resolved Hide resolved
@@ -21531,10 +21797,68 @@
"resolved": "https://registry.npmjs.org/style-search/-/style-search-0.1.0.tgz",
"integrity": "sha1-eVjHk+R+MuB9K1yv5cC/jhLneQI="
},
"stylelint": {
Copy link
Member

Choose a reason for hiding this comment

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

Hope we won't have problems, that this stylelint will be always behind. “Thanks”, npm 7.

Copy link
Member Author

Choose a reason for hiding this comment

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

Where's this entry coming from, is it the jest-preset? We can set the peer to 14 when it's out.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, peerDependency of jest-preset.

Copy link
Member Author

Choose a reason for hiding this comment

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

Shall we remove the peer dependency? It's odd having stylelint installed in stylelint automatically.

Copy link
Member Author

Choose a reason for hiding this comment

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

I can do it as a patch release of the preset. We probably don't want an old version of stylelint (and postcss) hanging around as we migrate to PostCSS 8 it adds a bit of an unknown variable into the mix.

Copy link
Member

Choose a reason for hiding this comment

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

I don't think anyone uses jest-preset to test stylelint plugin without stylelint installed. So it's probably safe to remove peer dependency.

jeddy3 and others added 2 commits May 14, 2021 17:38
Co-authored-by: Aleks Hudochenkov <aleks@hudochenkov.com>
Co-authored-by: Aleks Hudochenkov <aleks@hudochenkov.com>
lib/cli.js Show resolved Hide resolved
@jeddy3 jeddy3 requested a review from ybiquitous May 15, 2021 07:25
Copy link
Member

@ybiquitous ybiquitous left a comment

Choose a reason for hiding this comment

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

@jeddy3 Thank you so much for your great work! 👏🏼

@jeddy3 jeddy3 merged commit 52f99c6 into v14 May 15, 2021
@jeddy3 jeddy3 deleted the remove-syntax branch May 15, 2021 07:29
@jeddy3
Copy link
Member Author

jeddy3 commented May 15, 2021

Changelog:

  • Removed: syntax option (#5297).

@ybiquitous No worries. Thank you for your spot-on suggestions and reviews!

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.

Remove syntax option
3 participants