Skip to content

Commit 0ade5b0

Browse files
authored
Merge pull request #3623 from DennisSmolek/v10-dist
Adds v10-dist so we can alpha test without NPM exposure
2 parents a3999a9 + 6fa688a commit 0ade5b0

File tree

11 files changed

+21056
-0
lines changed

11 files changed

+21056
-0
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
'use strict';
2+
3+
const all = {
4+
plugins: ["@react-three"],
5+
rules: {
6+
"@react-three/no-clone-in-loop": "error",
7+
"@react-three/no-new-in-loop": "error"
8+
}
9+
};
10+
11+
const recommended = {
12+
plugins: ["@react-three"],
13+
rules: {
14+
"@react-three/no-clone-in-loop": "error",
15+
"@react-three/no-new-in-loop": "error"
16+
}
17+
};
18+
19+
function gitHubUrl(name) {
20+
return `https://github.com/pmndrs/react-three-fiber/blob/master/packages/eslint-plugin/docs/rules/${name}.md`;
21+
}
22+
23+
const rule$1 = {
24+
meta: {
25+
messages: {
26+
noClone: "Cloning vectors in the frame loop can cause performance problems. Instead, create once in a useMemo or a single, shared reference outside of the component."
27+
},
28+
docs: {
29+
url: gitHubUrl("no-clone-in-loop"),
30+
recommended: true,
31+
description: "Disallow cloning vectors in the frame loop which can cause performance problems."
32+
}
33+
},
34+
create(ctx) {
35+
return {
36+
["CallExpression[callee.name=useFrame] CallExpression MemberExpression Identifier[name=clone]"](node) {
37+
ctx.report({
38+
messageId: "noClone",
39+
node
40+
});
41+
}
42+
};
43+
}
44+
};
45+
46+
const rule = {
47+
meta: {
48+
messages: {
49+
noNew: "Instantiating new objects in the frame loop can cause performance problems. Instead, create once in a useMemo or a single, shared reference outside of the component."
50+
},
51+
docs: {
52+
url: gitHubUrl("no-new-in-loop"),
53+
recommended: true,
54+
description: "Disallow instantiating new objects in the frame loop which can cause performance problems."
55+
}
56+
},
57+
create(ctx) {
58+
return {
59+
["CallExpression[callee.name=useFrame] NewExpression"](node) {
60+
ctx.report({
61+
messageId: "noNew",
62+
node
63+
});
64+
}
65+
};
66+
}
67+
};
68+
69+
const index = {
70+
"no-clone-in-loop": rule$1,
71+
"no-new-in-loop": rule
72+
};
73+
74+
const configs = {
75+
all,
76+
recommended
77+
};
78+
79+
exports.configs = configs;
80+
exports.rules = index;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import * as eslint from 'eslint';
2+
3+
declare const _default: {
4+
'no-clone-in-loop': eslint.Rule.RuleModule;
5+
'no-new-in-loop': eslint.Rule.RuleModule;
6+
};
7+
8+
declare const configs: {
9+
all: {
10+
plugins: string[];
11+
rules: {
12+
'@react-three/no-clone-in-loop': string;
13+
'@react-three/no-new-in-loop': string;
14+
};
15+
};
16+
recommended: {
17+
plugins: string[];
18+
rules: {
19+
'@react-three/no-clone-in-loop': string;
20+
'@react-three/no-new-in-loop': string;
21+
};
22+
};
23+
};
24+
25+
export { configs, _default as rules };
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import * as eslint from 'eslint';
2+
3+
declare const _default: {
4+
'no-clone-in-loop': eslint.Rule.RuleModule;
5+
'no-new-in-loop': eslint.Rule.RuleModule;
6+
};
7+
8+
declare const configs: {
9+
all: {
10+
plugins: string[];
11+
rules: {
12+
'@react-three/no-clone-in-loop': string;
13+
'@react-three/no-new-in-loop': string;
14+
};
15+
};
16+
recommended: {
17+
plugins: string[];
18+
rules: {
19+
'@react-three/no-clone-in-loop': string;
20+
'@react-three/no-new-in-loop': string;
21+
};
22+
};
23+
};
24+
25+
export { configs, _default as rules };
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import * as eslint from 'eslint';
2+
3+
declare const _default: {
4+
'no-clone-in-loop': eslint.Rule.RuleModule;
5+
'no-new-in-loop': eslint.Rule.RuleModule;
6+
};
7+
8+
declare const configs: {
9+
all: {
10+
plugins: string[];
11+
rules: {
12+
'@react-three/no-clone-in-loop': string;
13+
'@react-three/no-new-in-loop': string;
14+
};
15+
};
16+
recommended: {
17+
plugins: string[];
18+
rules: {
19+
'@react-three/no-clone-in-loop': string;
20+
'@react-three/no-new-in-loop': string;
21+
};
22+
};
23+
};
24+
25+
export { configs, _default as rules };
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
const all = {
2+
plugins: ["@react-three"],
3+
rules: {
4+
"@react-three/no-clone-in-loop": "error",
5+
"@react-three/no-new-in-loop": "error"
6+
}
7+
};
8+
9+
const recommended = {
10+
plugins: ["@react-three"],
11+
rules: {
12+
"@react-three/no-clone-in-loop": "error",
13+
"@react-three/no-new-in-loop": "error"
14+
}
15+
};
16+
17+
function gitHubUrl(name) {
18+
return `https://github.com/pmndrs/react-three-fiber/blob/master/packages/eslint-plugin/docs/rules/${name}.md`;
19+
}
20+
21+
const rule$1 = {
22+
meta: {
23+
messages: {
24+
noClone: "Cloning vectors in the frame loop can cause performance problems. Instead, create once in a useMemo or a single, shared reference outside of the component."
25+
},
26+
docs: {
27+
url: gitHubUrl("no-clone-in-loop"),
28+
recommended: true,
29+
description: "Disallow cloning vectors in the frame loop which can cause performance problems."
30+
}
31+
},
32+
create(ctx) {
33+
return {
34+
["CallExpression[callee.name=useFrame] CallExpression MemberExpression Identifier[name=clone]"](node) {
35+
ctx.report({
36+
messageId: "noClone",
37+
node
38+
});
39+
}
40+
};
41+
}
42+
};
43+
44+
const rule = {
45+
meta: {
46+
messages: {
47+
noNew: "Instantiating new objects in the frame loop can cause performance problems. Instead, create once in a useMemo or a single, shared reference outside of the component."
48+
},
49+
docs: {
50+
url: gitHubUrl("no-new-in-loop"),
51+
recommended: true,
52+
description: "Disallow instantiating new objects in the frame loop which can cause performance problems."
53+
}
54+
},
55+
create(ctx) {
56+
return {
57+
["CallExpression[callee.name=useFrame] NewExpression"](node) {
58+
ctx.report({
59+
messageId: "noNew",
60+
node
61+
});
62+
}
63+
};
64+
}
65+
};
66+
67+
const index = {
68+
"no-clone-in-loop": rule$1,
69+
"no-new-in-loop": rule
70+
};
71+
72+
const configs = {
73+
all,
74+
recommended
75+
};
76+
77+
export { configs, index as rules };

0 commit comments

Comments
 (0)