前端项目配置文件——粗析

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wukongtutu/article/details/82892904

【.jshintrc】


When set to true, these options will make JSHint produce more warnings about your code,匹配JSHint代码的验证规则。

属性配置http://jshint.com/docs/options/#.jshintrc。以下是一些列举属性:

{
    //是否阻止位运算符的使用
    "bitwise": false,
    //是否要求变量都使用驼峰命名
    "camelcase": true,
    //是否要求 for/while/if 等循环和条件语句中总是使用花括号
    "curly": true,
    //是否强制使用严格等号
    "eqeqeq": false,
    //for-in 语句是否要求过滤原型链上的对象
    //添加 obj.hasOwnProperty(prop)
    "forin": false,
    //是否要求自执行的方法是用括号括起 (function () {} ())
    "immed": true,
    //要求变量在使用前声明
    "latedef": false,
    //定义全局暴露JQuery库
    "jquery": true,
}

【.editorconfig】


文章编码规范配置。

属性配置https://editorconfig.org/。以下是一些列举属性:

# 顶部的EditorConfig文件
root = true

# 对所有文件生效
[*]
#lf |crlf |cr 换行符格式
end_of_line = lf
charset = utf-8
#true |false 删除行尾空格
trim_trailing_whitespace = true
#true |false 是否在文件的最后插入一个空行
insert_final_newline = true

# 对.js结尾文件生效
[**.js]
indent_style = space
indent_size = 4

猜你喜欢

转载自blog.csdn.net/wukongtutu/article/details/82892904