一、jsconfig.json

{
compilerOptions: {
target: 'es6',
experimentalDecorators: true,
allowSyntheticDefaultImports: true,
baseUrl: '.',
paths: {
// "@/*": [
// "./src/*"
// ],
'@assets/*': ['./src/assets/*'],
'@components/*': ['./src/components/*'],
'@config/*': ['./src/config/*'],
'@service/*': ['./src/service/*'],
'@mixins/*': ['./src/mixins/*']
}
},
exclude: ['node_modules', 'dist'],
include: ['./src/**/*']
}

二、.postcssrc.js

// https://github.com/michael-ciniawsky/postcss-load-config
module.exports = {
plugins: {
'postcss-import': {},
'postcss-url': {},
// to edit target browsers: use "browserslist" field in package.json
autoprefixer: {
browsers: ['Firefox >= 10', 'IE >= 8', 'chrome >= 10', 'safari >= 10']
}
}
}

三、.babelrc

{
presets: [
[
'env',
{
modules: false,
targets: {
browsers: ['> 1%', 'last 2 versions', 'not ie <= 8']
}
}
],
'es2015',
'stage-2'
],
plugins: [
'transform-vue-jsx',
['transform-runtime', { polyfill: false }],
[
'component',
{
libraryName: 'element-ui',
styleLibraryName: 'theme-chalk'
}
]
]
}

四、 .prettierrc

{
"bracketSpacing": true, // 是否在对象属性添加空格,这里选择是 { foo: bar }
"printWidth": 160, // 指定代码换行的行长度。单行代码宽度超过指定的最大宽度,将会换行,如果都不想换,可以添加 "proseWrap": "never"
"semi": false, // 是否在语句末尾打印分号,这里选择不加
"singleQuote": true // 是否使用单引号,这里选择使用
}

五、 .editorconfig

root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

六、 .eslintrc.js(强制开启验证模式)

// http://eslint.org/docs/user-guide/configuring
module.exports = {
extends: 'eslint:recommended',
parserOptions: {
sourceType: 'module'
},
parser: 'babel-eslint',
globals: {
// Put things like jQuery, etc
jQuery: true,
$: true,
Swiper: true
},
env: {
browser: true,
commonjs: true,
es6: true,
node: true
},
rules: {
'no-alert': 0,
'no-console': 0,
indent: ['error', 2, { SwitchCase: 1}], // switchcase 解决 switch case 缩进报错问题
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single']
// "semi": [
// "error",
// "always"
// ]
}
}

JavaScript开发中常用的代码规范配置文件的更多相关文章

  1. NC65在日常开发中常用的代码写法

    标题 NC65开发相关代码 版本 1.0.1 作者 walton 说明 收集NC在日常开发中常用的代码写法,示例展示 1.查询 1.1 通过BaseDAO查询结果集并转换 //通过BaseDAO进行查 ...

  2. WebApp 开发中常用的代码片段

    其实这里面的多数都是 iOS 上面的代码.其他平台的就没有去验证了. HTML, 从HTML文档的开始到结束排列: <meta name=”viewport” content=”width=de ...

  3. Struts2页面开发中常用标签使用说明

    1. Struts2页面开发中常用标签使用说明 1.1.往action里传值的使用方式: <input name="userName" type="text&quo ...

  4. .net开发中常用的第三方组件

    .net开发中常用的第三方组件 2013-05-09 09:33:32|  分类: dotnet |举报 |字号 订阅     下载LOFTER 我的照片书  |   RSS.NET.dll RSS. ...

  5. spring注解开发中常用注解以及简单配置

    一.spring注解开发中常用注解以及简单配置 1.为什么要用注解开发:spring的核心是Ioc容器和Aop,对于传统的Ioc编程来说我们需要在spring的配置文件中邪大量的bean来向sprin ...

  6. 开发中常用的es6知识

    结合实际开发,开发中常用的es6的知识: 1.新增let和const命令: ES6 新增了let命令,用来声明变量.它的用法类似于var,但是所声明的变量,只在let命令所在的代码块内有效: cons ...

  7. Java开发中常用jar包整理及使用

    本文整理了我自己在Java开发中常用的jar包以及常用的API记录. <!-- https://mvnrepository.com/artifact/org.apache.commons/com ...

  8. 团队开发前端VUE项目代码规范

    团队开发前端VUE项目代码规范 2018年09月22日 20:18:11 我的小英短 阅读数 1658   一.规范目的: 统一编码风格,命名规范,注释要求,在团队协作中输出可读性强,易维护,风格一致 ...

  9. MyEclipse中阿里JAVA代码规范插件(P3C)的安装及使用

    JAVA代码规范插件(P3C)是阿里巴巴2017年10月14日在杭州云栖大会上首发的,使之前的阿里巴巴JAVA开发手册正式以插件形式公开走向业界.插件的相关信息及安装包都可以在GitHub(https ...

随机推荐

  1. Centos7下用FastDFS搭建图片服务器

    1.所用到的工具: 1.FastDFS_v5.05.tar 2.fastdfs-nginx-module_v1.16.tar 3.libfastcommonV1.0.7.tar 4.nginx-1.1 ...

  2. FreeNas搭建踩坑指南(一)

    0x00 背景 最近公司的旧群晖服务器Raid6,因为同时坏了两块硬盘存储池损毁,所以领导决定买了Dell R730自己搭NAS,选来选去最后选了FreeNAS,这里记录一些踩过的坑. 0x01 问题 ...

  3. 使用Huginn抓取Discourse论坛

    Hi! I don't know why the xpath does not work, but have an easier solution. Discourse also has a JSON ...

  4. 查看apk签名 和 keystore 的信息

    原文出处:https://www.jianshu.com/p/90b698002215 1.keytool -printcert -file ***(把apk文件下的META- INF文件夹解压出来, ...

  5. TCP点对点转发的实现与原理(nodejs)

    Nagent Nagent是TCP点对点转发实现,名称来源于Nat与Agent的组合.类似frp项目,可以在局域网与互联网提供桥梁. 前提是你要有一台流量服务器并且有一个公网IP.如果没有,也可以找服 ...

  6. VSCode 下载Models 报错

    VSCode调试部分代码时,报错,提示不能自动获取Models.报错信息如下. go: golang.org/x/crypto@v0.-80db560fac1f: unrecognized impor ...

  7. hbase 过滤器 rowfilter

    HBase为筛选数据提供了一组过滤器,通过这个过滤器可以在HBase中的数据的多个维度(行,列,数据版本)上进行对数据的筛选操作,也就是说过滤器最终能够筛选的数据能够细化到具体的一个存储单元格上(由行 ...

  8. 黑阔主流攻防之不合理的cookie验证方式

    最近博主没事干中(ZIZUOZISHOU),于是拿起某校的习题研究一番,名字很6,叫做黑阔主流攻防习题 虚拟机环境经过一番折腾,配置好后,打开目标地址:192.168.5.155 如图所示 这里看出题 ...

  9. java 开发工具记录

    jenkins 持续构建项目 lombok  优雅代码插件 sonarqube 代码检测插件

  10. QMainWindow class

    Help on class QMainWindow in module PyQt5.QtWidgets: class QMainWindow(QWidget)  |  QMainWindow(pare ...