-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
95 lines (91 loc) · 2.27 KB
/
eslint.config.mjs
File metadata and controls
95 lines (91 loc) · 2.27 KB
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 path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import globals from "globals";
import pluginImport from "eslint-plugin-import";
import pluginN from "eslint-plugin-n";
import pluginPromise from "eslint-plugin-promise";
import eslintConfigPrettier from "eslint-config-prettier";
const nodeFiles = ["**/*.js", "**/*.mjs", "**/*.cjs"];
const nodeLanguageOptions = {
ecmaVersion: 2023,
sourceType: "module",
globals: {
...globals.node,
},
};
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const PLATFORM_SRC_PATH = path.resolve(__dirname, "platform/src");
export default [
{
ignores: [
"**/node_modules/**",
"public/**",
"data/**",
"dist/**",
"tests/**",
"prisma/data/**",
"prisma/migrations/**",
"prisma/schema.prisma",
"prisma/reset.sh",
"eslint.config.mjs",
"package-lock.json",
"plugins/papertrail/**",
"tools/plugin-templates/**",
],
},
js.configs.recommended,
pluginImport.flatConfigs.recommended,
pluginN.configs["flat/recommended"],
pluginPromise.configs["flat/recommended"],
eslintConfigPrettier,
{
files: nodeFiles,
languageOptions: nodeLanguageOptions,
settings: {
"import/internal-regex": "^\\$/",
},
rules: {
"import/no-unresolved": [
"error",
{
ignore: ["^\\$/"],
},
],
"import/order": [
"error",
{
groups: [
"builtin",
"external",
"internal",
"parent",
"sibling",
"index",
"object",
"type",
],
"newlines-between": "always",
},
],
"n/no-missing-import": [
"error",
{
tryExtensions: [".js", ".mjs", ".cjs", ".json"],
resolverConfig: {
alias: [
{
name: "$",
alias: PLATFORM_SRC_PATH,
onlyModule: false,
},
],
},
},
],
"n/no-process-exit": "off",
"import/no-unresolved": "off", // TODO: Make this for some specific files
"n/no-extraneous-import": "off", // TODO: Make this for some specific files
},
},
];