-
Notifications
You must be signed in to change notification settings - Fork 474
Expand file tree
/
Copy patheslint.config.mjs
More file actions
58 lines (57 loc) · 1.63 KB
/
eslint.config.mjs
File metadata and controls
58 lines (57 loc) · 1.63 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
import eslint from "@eslint/js";
import eslintPluginTypeScript from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
import eslintConfigPrettier from "eslint-config-prettier/flat";
import pluginChaiFriendly from "eslint-plugin-chai-friendly";
import mochaPlugin from "eslint-plugin-mocha";
import { globalIgnores } from "eslint/config";
import globals from "globals";
import tseslint from "typescript-eslint";
export default tseslint.config([
globalIgnores(["coverage/**", "lib/**"]),
eslint.configs.recommended,
tseslint.configs.recommended,
tseslint.configs.strict,
mochaPlugin.configs.flat.recommended,
{
files: ["**/*"],
rules: {
"linebreak-style": ["error", "unix"],
},
},
{
files: ["**/*.{js,ts}"],
languageOptions: {
parser: tsParser,
parserOptions: {
project: "./tsconfig.eslint.json",
ecmaVersion: 2020,
sourceType: "module",
},
globals: { ...globals.node },
},
plugins: {
"@typescript-eslint": eslintPluginTypeScript,
},
rules: {
"no-console": "warn",
"@typescript-eslint/no-non-null-assertion": "error",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-invalid-void-type": "off",
"@typescript-eslint/no-dynamic-delete": "off",
"@typescript-eslint/no-unused-expressions": "off",
},
},
{
files: ["**/*.spec.{js,ts}"],
languageOptions: {
globals: { ...globals.mocha },
},
plugins: {
mocha: mochaPlugin,
"chai-friendly": pluginChaiFriendly,
},
rules: {},
},
eslintConfigPrettier, // goes last
]);