-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy patheslint.config.mjs
47 lines (44 loc) · 1.64 KB
/
eslint.config.mjs
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
import { FlatCompat } from "@eslint/eslintrc";
import path from "path";
import { fileURLToPath } from "url";
// mimic CommonJS variables -- not needed if using CommonJS
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
});
import globals from "globals";
import pluginJs from "@eslint/js";
export default [
// mimic ESLintRC-style extends
...compat.extends("airbnb", "prettier", "plugin:jsdoc/recommended"),
{
files: ["**/*.js"],
languageOptions: {
sourceType: "commonjs",
parserOptions: {
ecmaVersion: 2021,
},
},
},
{ languageOptions: { globals: globals.node } },
{
rules: {
"consistent-return": "off",
"no-return-await": "off", // deprecated
"no-restricted-syntax": "off", // TODO: enable but make better lol
"no-underscore-dangle": "off", // Needed for mongo _id
"no-restricted-globals": "off", // globals work differently
"guard-for-in": "off", // TODO: enable but make better lol
"no-continue": "off", // doesn't seem to work properly
"no-await-in-loop": "off", // TODO: use promise.all
"jsdoc/no-undefined-types": "off", // doesn't seem to work with TS types
"jsdoc/require-param-description": "off", // TODO: maybe add descriptions
"jsdoc/require-returns-description": "off", // TODO: maybe add descriptions
"jsdoc/require-property-description": "off", // TODO: maybe add descriptions
"jsdoc/valid-types": "off", // doesn't seem to work with TS types
"jsdoc/require-returns": "off",
},
},
pluginJs.configs.recommended,
];