-
Notifications
You must be signed in to change notification settings - Fork 1
/
eslint.config.js
95 lines (94 loc) · 2.1 KB
/
eslint.config.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import js from "@eslint/js";
import tseslint from "typescript-eslint";
import jest from "eslint-plugin-jest";
import babelDevelopment from "@babel/eslint-plugin-development";
import prettier from "eslint-config-prettier";
import globals from "globals";
export default tseslint.config(
js.configs.recommended,
...tseslint.configs.recommended,
jest.configs["flat/recommended"],
prettier,
{
files: ["**/*.@(?([mc])[jt]s|[jt]sx)"],
},
{
ignores: [
"**/dist/**/*",
"packages/babel-plugin-node-cjs-interop/test/fixtures/**/output.*",
"packages/swc-plugin-node-cjs-interop/tests/fixtures/**/output.*",
],
},
{
languageOptions: {
globals: {
console: true,
},
},
},
{
files: ["**/*.c[jt]s"],
languageOptions: {
parserOptions: {
sourceType: "script",
},
globals: {
...globals.commonjs,
__dirname: true,
__filename: true,
},
},
},
{
files: ["**/eslint.config.js"],
languageOptions: {
globals: globals.node,
},
},
{
files: ["**/*.cjs"],
rules: {
"@typescript-eslint/no-var-requires": "off",
},
},
{
files: ["packages/*/@(src|test)/**/*.ts"],
languageOptions: {
parserOptions: {
projectService: true,
},
},
},
...tseslint.configs.recommendedTypeChecked.map((c) => ({
...c,
files: ["packages/*/@(src|test)/**/*.ts"],
})),
{
plugins: {
"@babel/development": babelDevelopment,
},
},
{
rules: {
"@babel/development/no-deprecated-clone": "error",
"@babel/development/no-undefined-identifier": "error",
},
},
{
files: ["packages/babel-plugin-node-cjs-interop/src/index.ts"],
rules: {
"@babel/development/plugin-name": "error",
},
},
{
files: [
"packages/babel-plugin-node-cjs-interop/test/fixtures/**/input.*",
"packages/swc-plugin-node-cjs-interop/tests/fixtures/**/input.*",
],
rules: {
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-unused-vars": "off",
"no-import-assign": "off",
},
},
);