小编Hel*_*lks的帖子

多个文件/项目的 Eslint 配置

如何为本例中的项目配置eslintrc ?

\n\n
user\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\n
Run Code Online (Sandbox Code Playgroud)\n\n

html文件包含这两个js文件。.eslintrc需要如何配置才能正确function is not defined克服defined but not used错误?

\n

javascript eslint

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

循环中的Sass动态变量

如何mixin argumentarray variableSass的循环中获得?示例代码如下:

$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)?也许可以有更好的解决方案.

css sass

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

标签 统计

css ×1

eslint ×1

javascript ×1

sass ×1