Skip to content

Commit 5704b67

Browse files
authored
feat: add require-atomic-updates and no-async-promise-executor (#50)
BREAKING CHANGE: this adds new errors
1 parent 2643dcf commit 5704b67

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

lib/base.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ module.exports = {
5555
// no-useless-escape
5656

5757
// Possible Errors
58+
"no-async-promise-executor": "error",
5859
"no-extra-parens": ["error", "functions"],
60+
"require-atomic-updates": "error",
5961
"valid-typeof": [
6062
"error",
6163
{

package-lock.json

Lines changed: 4 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/base-test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ describe("base", () => {
1212
"no-var",
1313
"no-redeclare",
1414
"getter-return",
15-
"no-self-assign"
15+
"no-self-assign",
16+
"require-atomic-updates",
17+
"no-async-promise-executor"
1618
],
1719
warnings: ["no-useless-return"]
1820
},

test/fixtures/base/error.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,8 @@ const obj = {
77
}
88
};
99

10-
obj.a = obj.a;
10+
obj.a = obj.a;
11+
12+
(async () => {
13+
obj.a += await new Promise(async (r) => r(10));
14+
})();

0 commit comments

Comments
 (0)