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

perf: 解决提交代码时stylelint格式化less和scss的媒体查询为不支持的语法(Media Queries Level 4) #2931

Merged
merged 2 commits into from Jul 29, 2023

Conversation

lessroc
Copy link
Contributor

@lessroc lessroc commented Jul 26, 2023

General

✏️ Mark the necessary items without changing the structure of the PR template.

  • Pull request template structure not broken

Type

ℹ️ What types of changes does your code introduce?

👉 Put an x in the boxes that apply

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

ℹ️ Check all checkboxes - this will indicate that you have done everything in accordance with the rules in CONTRIBUTING.

👉 Put an x in the boxes that apply.

  • My code follows the style guidelines of this project
  • Is the code format correct
  • Is the git submission information standard?
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@lessroc
Copy link
Contributor Author

lessroc commented Jul 26, 2023

less does not support media queries level 4

Less 有些许时间没有更新了,目前最新版本4.1.3暂不支持媒体查询版本_4_中的语法改进

具体表现见:less/issues

产生这个错误的原因是使用的stylelint更新到了比较新的版本15.10.1,这个版本包含了media-feature-range-notation规则

允许:

@media screen and (500px <= width <= 1200px) {
  .bar {
    display: block;
  }
}

不允许:

@media screen and (min-width: 500px) and (max-width: 1200px) {
  .bar {
    display: block;
  }
}

为避免在提交代码时不被stylelint意外的格式媒体查询为版本_4_中的语法

internal/stylelint-config/src/index.ts配置中添加一条规则:

rules: {
  'media-feature-range-notation': null,
  // ...
}

@lessroc lessroc mentioned this pull request Jul 26, 2023
@Tairy
Copy link

Tairy commented Jul 27, 2023

改了没有效果是咋回事呢

@lessroc
Copy link
Contributor Author

lessroc commented Jul 27, 2023

使用的相关包版本多少呀,有没有拉最新的分支下来合并呢

@jinmao88 jinmao88 merged commit 12924fb into vbenjs:main Jul 29, 2023
@susanliy
Copy link

拉去了最新的代码 这个问题还是存在的
image

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

Successfully merging this pull request may close these issues.

None yet

4 participants