如何为本例中的项目配置eslintrc ?
\n\nuser\n\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 projectA\n \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 index.html\n \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 lib\n \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 .eslintrc\n \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 main.js\n \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 main_lib.js\nRun Code Online (Sandbox Code Playgroud)\n\nhtml文件包含这两个js文件。.eslintrc需要如何配置才能正确function is not defined克服defined but not used错误?
如何mixin argument从array variable与Sass的循环中获得?示例代码如下:
$colors: red green blue;
$red-foo: 100px;
$red-bar: 110px;
$red-baz: 120px;
$green-foo: 100px;
$green-bar: 110px;
$green-baz: 120px;
$blue-foo: 100px;
$blue-bar: 110px;
$blue-baz: 120px;
@mixin item($color-foo, $color-bar, $color-baz){
width: $color-foo,;
height: $color-bar;
...
}
@each $color in $colors {
.class-#{$color}{
@include item($color#{-foo}, $color#{-bar}, $color#{-baz})
}
}Run Code Online (Sandbox Code Playgroud)
期望的输出如下:
.class-red{
//variables
}
.class-green{
//variables
}
.class-blue{
//variables
}Run Code Online (Sandbox Code Playgroud)
也就是在那里的速记方式$color-foo, $color-bar, $color-baz一样@include item($color-shorthand)?也许可以有更好的解决方案.