Last active
November 11, 2017 17:30
-
-
Save lakerswgq/ab43aba0c49c489d2b578a43500bba97 to your computer and use it in GitHub Desktop.
eslint config file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // @fix 标记的为可自动修复的规则 | |
| module.exports = { | |
| "root": true, | |
| "env": { | |
| "browser": true, | |
| // "jquery": true, | |
| }, | |
| "globals": { | |
| "Vue": false // read only | |
| }, | |
| "extends": "eslint:recommended", | |
| "parserOptions": { | |
| "sourceType": "module" | |
| }, | |
| "rules": { | |
| "indent": [ // 缩进4空格 @fix | |
| "error", | |
| 4 | |
| ], | |
| "linebreak-style": [ // | |
| "error", | |
| "windows" | |
| ], | |
| "quotes": [ // 使用双引号 @fix | |
| "error", | |
| "double" | |
| ], | |
| "semi": [ // 句尾必须加分号 @fix | |
| "error", | |
| "always" | |
| ], | |
| "space-infix-ops": ["error", // 强制在一元操作符前后使用一致的空格 @fix | |
| { "int32Hint": false } | |
| ], | |
| "space-in-parens": [ // 圆括号内没有空格 @fix | |
| "error", | |
| "never" | |
| ], | |
| "space-before-function-paren": ["error", { // 禁止函数圆括号之前有一个空格 @fix | |
| "anonymous": "always", | |
| "named": "never", | |
| "asyncArrow": "always" | |
| }], | |
| "max-len": [ // 一行最大长度 | |
| "error", | |
| { | |
| "code": 80, | |
| } | |
| ], | |
| "lines-around-comment": [ // 注释控制 @fix | |
| "warn" | |
| ], | |
| "camelcase": [ // 强制驼峰命名 | |
| "error", | |
| { | |
| "properties": "always" | |
| } | |
| ], | |
| "no-eval": [ // 禁用eval | |
| "error" | |
| ] | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment