forked from cvazac/eslint-plugin-react-perf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
47 lines (44 loc) · 1.07 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
"use strict";
var allRules = {
"jsx-no-new-object-as-prop": require("./lib/rules/jsx-no-new-object-as-prop"),
"jsx-no-new-array-as-prop": require("./lib/rules/jsx-no-new-array-as-prop"),
"jsx-no-new-function-as-prop": require("./lib/rules/jsx-no-new-function-as-prop"),
"jsx-no-jsx-as-prop": require("./lib/rules/jsx-no-jsx-as-prop")
};
function configureAsError(rules) {
var result = {};
for (var key in rules) {
if (!rules.hasOwnProperty(key)) {
continue;
}
result["react-perf/" + key] = 2;
}
return result;
}
module.exports = {
rules: allRules,
configs: {
recommended: {
plugins: ["react-perf"],
parserOptions: {
ecmaFeatures: {
jsx: true
}
},
rules: {
"react-perf/jsx-no-new-object-as-prop": 2,
"react-perf/jsx-no-new-array-as-prop": 2,
"react-perf/jsx-no-new-function-as-prop": 2
}
},
all: {
plugins: ["react-perf"],
parserOptions: {
ecmaFeatures: {
jsx: true
}
},
rules: configureAsError(allRules)
}
}
};