小编Jos*_*chi的帖子

Eslint 规则“语句之间的填充行”未按预期工作

我正在尝试配置 eslint 以在 return 语句后强制换行并使用 padding-line- Between-statements 规则阻止开口。在返回之前强制换行效果很好,但我无法通过交换上一个/下一个来获得它。

这是我在 eslintrc.js 中尝试的内容

"padding-line-between-statements": [ "warn",
        { blankLine: "always", prev: "return", next: "*" }
]
Run Code Online (Sandbox Code Playgroud)

我缺少什么?它不应该像文档中描述的那样工作吗?或者是否有更好的规则将块内容换行?

javascript eslint

5
推荐指数
1
解决办法
7339
查看次数

Bootstrap - Sass:相对glyphicons图标路径

如何在bootstrap sass版本中设置相对glyphicons图标路径?

默认情况下,css font-face中使用的路径是绝对路径.

@font-face {
  font-family: 'Glyphicons Halflings';
  src: url(/fonts/bootstrap/glyphicons-halflings-regular.eot?1422262129);
  src: url(/fonts/bootstrap/glyphicons-halflings-regular.eot?&1422262129#iefix) format("embedded-opentype"), url(/fonts/bootstrap/glyphicons-halflings-regular.woff2?1422262129) format("woff2"), url(/fonts/bootstrap/glyphicons-halflings-regular.woff?1422262129) format("woff"), url(/fonts/bootstrap/glyphicons-halflings-regular.ttf?1422262129) format("truetype"), url(/fonts/bootstrap/glyphicons-halflings-regular.svg?1422262129#glyphicons_halflingsregular) format("svg");
}
Run Code Online (Sandbox Code Playgroud)

但我需要一个相对的:"../ fonts/bootstrap" - 所以在文件_bootstrap-variables.scss中,我设置了$ icon-font-path

$icon-font-path: "../fonts/bootstrap/"
Run Code Online (Sandbox Code Playgroud)

给出以下内容

@font-face {
  font-family: 'Glyphicons Halflings';
  src: url(/fonts/../fonts/bootstrap/glyphicons-halflings-regular.eot?1422262129);
  src: url(/fonts/../fonts/bootstrap/glyphicons-halflings-regular.eot?&1422262129#iefix) format("embedded-opentype"), url(/fonts/../fonts/bootstrap/glyphicons-halflings-regular.woff2?1422262129) format("woff2"), url(/fonts/../fonts/bootstrap/glyphicons-halflings-regular.woff?1422262129) format("woff"), url(/fonts/../fonts/bootstrap/glyphicons-halflings-regular.ttf?1422262129) format("truetype"), url(/fonts/../fonts/bootstrap/glyphicons-halflings-regular.svg?1422262129#glyphicons_halflingsregular) format("svg");
}
Run Code Online (Sandbox Code Playgroud)

在网络上,我找到了在变量之前包含"bootstrap-sprockets"的提示,结果是

@font-face {
  font-family: 'Glyphicons Halflings';
  src: url(font-path("../fonts/bootstrap/glyphicons-halflings-regular.eot"));
  src: url(font-path("../fonts/bootstrap/glyphicons-halflings-regular.eot?#iefix")) format("embedded-opentype"), url(font-path("../fonts/bootstrap/glyphicons-halflings-regular.woff2")) format("woff2"), url(font-path("../fonts/bootstrap/glyphicons-halflings-regular.woff")) format("woff"), url(font-path("../fonts/bootstrap/glyphicons-halflings-regular.ttf")) format("truetype"), url(font-path("../fonts/bootstrap/glyphicons-halflings-regular.svg#glyphicons_halflingsregular")) format("svg");
}
Run Code Online (Sandbox Code Playgroud)

网址本身似乎没问题 - 但这个"字体路径"来自哪里,我该如何摆脱它呢?

或者是否有另一种指定相对路径的方法?我错了什么?

twitter-bootstrap bootstrap-sass

3
推荐指数
1
解决办法
1万
查看次数