Skip to content

Commit 73c199a

Browse files
committed
add integration test case
1 parent 59411a5 commit 73c199a

12 files changed

Lines changed: 245 additions & 0 deletions

File tree

‎eslint/babel-eslint-tests/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"@babel/plugin-proposal-do-expressions": "workspace:^",
1313
"@babel/preset-flow": "workspace:^",
1414
"@babel/preset-react": "workspace:^",
15+
"@eslint/js": "^10.0.1",
1516
"dedent": "^1.5.3",
1617
"eslint": "^10.0.0",
1718
"eslint-plugin-import": "^2.31.0",
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import babelPlugin from "@babel/eslint-plugin";
2+
import babelParser from "@babel/eslint-parser";
3+
import js from "@eslint/js";
4+
import { fileURLToPath } from "url";
5+
6+
export default [
7+
js.configs.recommended,
8+
{
9+
plugins: {
10+
babel: babelPlugin,
11+
},
12+
13+
languageOptions: {
14+
parser: babelParser,
15+
parserOptions: {
16+
requireConfigFile: false,
17+
babelOptions: {
18+
configFile: false,
19+
cwd: fileURLToPath(new URL("..", import.meta.url)),
20+
plugins: [
21+
["@babel/plugin-proposal-decorators", { version: "2023-11" }],
22+
"@babel/plugin-proposal-do-expressions",
23+
],
24+
},
25+
},
26+
},
27+
...babelPlugin.configs.all,
28+
rules: {
29+
...babelPlugin.configs.all.rules,
30+
"babel/no-empty": "warn",
31+
}
32+
},
33+
];
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let a = do { {} };
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
(function () {
2+
class C { accessor x = 2 }
3+
4+
let a = do { 1 + 1 };
5+
let u = do {};
6+
return [C, a, u];
7+
})();
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import babelPlugin from "@babel/eslint-plugin";
2+
import babelParser from "@babel/eslint-parser";
3+
import js from "@eslint/js";
4+
import { fileURLToPath } from "url";
5+
6+
export default [
7+
js.configs.recommended,
8+
babelPlugin.configs.all,
9+
{
10+
plugins: {
11+
babel: babelPlugin,
12+
},
13+
14+
languageOptions: {
15+
parser: babelParser,
16+
parserOptions: {
17+
requireConfigFile: false,
18+
babelOptions: {
19+
configFile: false,
20+
cwd: fileURLToPath(new URL("..", import.meta.url)),
21+
plugins: [
22+
["@babel/plugin-proposal-decorators", { version: "2023-11" }],
23+
"@babel/plugin-proposal-do-expressions",
24+
],
25+
},
26+
},
27+
},
28+
rules: {
29+
"babel/no-empty": "warn",
30+
}
31+
},
32+
];
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let a = do { {} };
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
(function () {
2+
class C { accessor x = 2 }
3+
4+
let a = do { 1 + 1 };
5+
let u = do {};
6+
return [C, a, u];
7+
})();
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import babelPlugin from "@babel/eslint-plugin";
2+
import babelParser from "@babel/eslint-parser";
3+
import js from "@eslint/js";
4+
import { fileURLToPath } from "url";
5+
6+
export default [
7+
js.configs.recommended,
8+
{
9+
plugins: {
10+
babel: babelPlugin,
11+
},
12+
13+
languageOptions: {
14+
parser: babelParser,
15+
parserOptions: {
16+
requireConfigFile: false,
17+
babelOptions: {
18+
configFile: false,
19+
cwd: fileURLToPath(new URL("..", import.meta.url)),
20+
plugins: [
21+
["@babel/plugin-proposal-decorators", { version: "2023-11" }],
22+
"@babel/plugin-proposal-do-expressions",
23+
],
24+
},
25+
},
26+
},
27+
...babelPlugin.configs.recommended,
28+
},
29+
];
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let a = do { {} };
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
(function () {
2+
let a = do { 1 + 1 };
3+
let u = do {};
4+
return [a, u];
5+
})();

0 commit comments

Comments
 (0)