Skip to content

Commit

Permalink
完善在 reporter baidu 情况下,no-require 的报错级别及规范信息
Browse files Browse the repository at this point in the history
  • Loading branch information
ielgnaw committed Jan 8, 2017
1 parent a2894d5 commit b315cb1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/reporter/baidu/es-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,6 @@
654:
level: 1
desc: "[建议] AMD/CommonJS 模块依赖 ESNext 模块时,AMD/CommonJS 模块对 default export 的 require 需要改造。"

655:
level: 1
desc: "[建议] ESNext 的文件中,不要使用 `require`。"
2 changes: 2 additions & 0 deletions lib/reporter/baidu/eslint-map.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ fecs-valid-constructor: "110,111"
fecs-valid-dom-style: "137,138"
fecs-use-async-require: "128"

fecs-no-require: "655"

babel/generator-star-spacing: "604"
babel/new-cap: "027,029,030"
babel/array-bracket-spacing: "012"
Expand Down
6 changes: 6 additions & 0 deletions lib/reporter/baidu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,12 @@ var baidu = {
var origin = error.origin;

return origin.nodeType === 'Literal' ? '138' : '137';
},

'fecs-no-require': function (error) {
var origin = error.origin;

return origin.nodeType === 'CallExpression' ? '655' : '998';
}

},
Expand Down

0 comments on commit b315cb1

Please sign in to comment.