-
Notifications
You must be signed in to change notification settings - Fork 275
Expand file tree
/
Copy patheslint.config.mjs
More file actions
77 lines (75 loc) · 2.3 KB
/
Copy patheslint.config.mjs
File metadata and controls
77 lines (75 loc) · 2.3 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
/**
* ESLint flat config (ESLint 9+ format, required by ESLint 10).
*/
import path from "node:path";
import { fileURLToPath } from "node:url";
import { FlatCompat } from "@eslint/eslintrc";
import globals from "globals";
import mochaPlugin from "eslint-plugin-mocha";
import securityPlugin from "eslint-plugin-security";
import prettierRecommended from "eslint-plugin-prettier/recommended";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({ baseDirectory: __dirname });
export default [
{
ignores: ["public/**", "dist/**"],
},
...compat.extends("standard"),
mochaPlugin.configs.recommended,
securityPlugin.configs.recommended,
prettierRecommended,
{
files: ["**/*.js"],
languageOptions: {
ecmaVersion: 13,
sourceType: "commonjs",
globals: {
...globals.es2021,
...globals.node,
...globals.mocha,
config: "readonly",
logger: "readonly",
},
},
plugins: {
mocha: mochaPlugin,
security: securityPlugin,
},
rules: {
"no-trailing-spaces": "error",
"consistent-return": "error",
"no-console": "error",
"mocha/no-pending-tests": "error",
"mocha/no-exclusive-tests": "error",
"prettier/prettier": "error",
},
},
// A few .js files use ESM import/export syntax (the runtime loads them
// through ts-node / Node's module detection). They need module source type.
// (eslint.config.mjs itself is ESM by extension, so it needs no entry here.)
{
files: [
"controllers/logs.js",
"middlewares/validators/fcmToken.js",
"middlewares/validators/notify.js",
"middlewares/validators/task-requests.js",
"models/userStatus.js",
"services/getFcmTokenFromUserId.js",
"services/getUserIdsFromRoleId.js",
"test/fixtures/logs/archievedUsers.js",
"test/fixtures/logs/extensionRequests.js",
"test/fixtures/logs/requests.js",
"test/fixtures/logs/tasks.js",
"test/integration/logs.test.js",
"test/unit/models/userStatus.js",
"test/unit/utils/rqlQueryParser.test.js",
"test/unit/utils/sendTaskUpdate.test.js",
"utils/queryParser.js",
"utils/sendTaskUpdate.js",
],
languageOptions: {
sourceType: "module",
},
},
];