Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
53 changed files
with
776 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module.exports = { | ||
rules: { | ||
/** | ||
* 数组的括号内的前后禁止有空格 | ||
* @category Uncategorized | ||
* @fixable | ||
*/ | ||
'vue/array-bracket-spacing': ['error', 'never'] | ||
} | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module.exports = { | ||
rules: { | ||
/** | ||
* 箭头函数的箭头前后必须有空格 | ||
* @category Uncategorized | ||
* @fixable | ||
*/ | ||
'vue/arrow-spacing': [ | ||
'error', | ||
{ | ||
before: true, | ||
after: true | ||
} | ||
] | ||
} | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module.exports = { | ||
rules: { | ||
/** | ||
* 标签属性必须按规则排序 | ||
* @category Minimizing Arbitrary Choices and Cognitive Overhead | ||
* @fixable | ||
*/ | ||
'vue/attributes-order': 'error' | ||
} | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module.exports = { | ||
rules: { | ||
/** | ||
* 代码块如果在一行内,那么大括号内的首尾必须有空格 | ||
* @category Uncategorized | ||
* @fixable | ||
*/ | ||
'vue/block-spacing': ['error', 'always'] | ||
} | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module.exports = { | ||
rules: { | ||
/** | ||
* if 与 else 的大括号风格必须一致 | ||
* @category Uncategorized | ||
* @reason else 代码块可能前面需要有一行注释 | ||
* @fixable | ||
*/ | ||
'vue/brace-style': 'off' | ||
} | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module.exports = { | ||
rules: { | ||
/** | ||
* 变量名必须是 camelcase 风格的 | ||
* @category Uncategorized | ||
* @reason 很多 api 或文件名都不是 camelcase | ||
*/ | ||
'vue/camelcase': 'off' | ||
} | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module.exports = { | ||
rules: { | ||
/** | ||
* 约束自定义标签的命名规则 | ||
* @category Uncategorized | ||
* @fixable | ||
*/ | ||
'vue/component-name-in-template-casing': 'off' | ||
} | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module.exports = { | ||
rules: { | ||
/** | ||
* 支持在模版中使用 eslint-disable-next-line 等注释 | ||
* @category Enabling Correct ESLint Parsing | ||
*/ | ||
'vue/comment-directive': 'error' | ||
} | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module.exports = { | ||
rules: { | ||
/** | ||
* 对象的最后一个属性末尾必须有逗号 | ||
* @category Uncategorized | ||
* @fixable | ||
*/ | ||
'vue/comma-dangle': 'off' | ||
} | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module.exports = { | ||
rules: { | ||
/** | ||
* 链式调用的时候,点号必须放在第二行开头处,禁止放在第一行结尾处 | ||
* @category Uncategorized | ||
* @fixable | ||
*/ | ||
'vue/dot-location': ['error', 'property'] | ||
} | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module.exports = { | ||
rules: { | ||
/** | ||
* 必须使用 === 或 !==,禁止使用 == 或 !=,与 null 比较时除外 | ||
* @category Uncategorized | ||
* @fixable | ||
*/ | ||
'vue/eqeqeq': [ | ||
'error', | ||
'always', | ||
{ | ||
null: 'ignore' | ||
} | ||
] | ||
} | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module.exports = { | ||
rules: { | ||
/** | ||
* 模版中开始标签的反尖括号必须换行 | ||
* @category Improving Readability | ||
* @fixable | ||
*/ | ||
'vue/html-closing-bracket-newline': 'error' | ||
} | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module.exports = { | ||
rules: { | ||
/** | ||
* 模版中开始标签的反尖括号前禁止有空格,自闭和标签前必须有空格 | ||
* @category Improving Readability | ||
* @fixable | ||
*/ | ||
'vue/html-closing-bracket-spacing': 'error' | ||
} | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module.exports = { | ||
rules: { | ||
/** | ||
* 模版中使用 4 个空格缩进 | ||
* @category Improving Readability | ||
* @fixable | ||
*/ | ||
'vue/html-indent': ['error', 4] | ||
} | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module.exports = { | ||
rules: { | ||
/** | ||
* 对象字面量中冒号前面禁止有空格,后面必须有空格 | ||
* @category Uncategorized | ||
* @fixable | ||
*/ | ||
'vue/key-spacing': [ | ||
'error', | ||
{ | ||
beforeColon: false, | ||
afterColon: true, | ||
mode: 'strict' | ||
} | ||
] | ||
} | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module.exports = { | ||
rules: { | ||
/** | ||
* 关键字前后必须有空格 | ||
* @category Uncategorized | ||
* @fixable | ||
*/ | ||
'vue/keyword-spacing': [ | ||
'error', | ||
{ | ||
before: true, | ||
after: true | ||
} | ||
] | ||
} | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module.exports = { | ||
rules: { | ||
/** | ||
* 组件名称必须和文件名一致 | ||
* @category Uncategorized | ||
*/ | ||
'vue/match-component-file-name': 'off' | ||
} | ||
}; |
10 changes: 10 additions & 0 deletions
10
test/vue/multiline-html-element-content-newline/.eslintrc.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module.exports = { | ||
rules: { | ||
/** | ||
* 多行内容或多行标签时,内容前必须换行 | ||
* @category Improving Readability | ||
* @fixable | ||
*/ | ||
'vue/multiline-html-element-content-newline': 'error' | ||
} | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module.exports = { | ||
rules: { | ||
/** | ||
* 模版内 mustache 大括号内前后禁止有空格 | ||
* @category Improving Readability | ||
* @fixable | ||
*/ | ||
'vue/mustache-interpolation-spacing': ['error', 'never'] | ||
} | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module.exports = { | ||
rules: { | ||
/** | ||
* 禁止给布尔值 props 添加默认值 | ||
* @category Uncategorized | ||
* @fixable | ||
*/ | ||
'vue/no-boolean-default': 'off' | ||
} | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module.exports = { | ||
rules: { | ||
/** | ||
* 禁止用已废弃的 scope 属性 | ||
* @category Uncategorized | ||
* @fixable | ||
*/ | ||
'vue/no-deprecated-scope-attribute': 'error' | ||
} | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module.exports = { | ||
rules: { | ||
/** | ||
* 禁止解构中出现空 {} 或 [] | ||
* @category Uncategorized | ||
*/ | ||
'vue/no-empty-pattern': 'error' | ||
} | ||
}; |
Oops, something went wrong.