-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
48 lines (46 loc) · 1.25 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
import eslintConfigPrettier from "eslint-config-prettier";
import tsLint from "typescript-eslint";
import jsLint from "@eslint/js";
import globals from "globals";
export default [
{ files: ["**/*.{js,ts}"] },
jsLint.configs.recommended,
{
plugins: {
"@typescript-eslint": tsLint.plugin,
},
languageOptions: {
parser: "@typescript-eslint/parser",
globals: { ...globals.browser, ...globals.es2022 },
ecmaVersion: 2022,
sourceType: "module",
parserOptions: {
warnOnUnsupportedTypeScriptVersion: false,
tsconfigRootDir: import.meta.dirname,
},
},
},
...tsLint.configs.recommended,
{
rules: {
"no-bitwise": ["error"],
// Ignore unused vars starting with _
"@typescript-eslint/no-unused-vars": [
"error",
{ argsIgnorePattern: "^_" },
],
// Turn off the need for explicit function return types
"@typescript-eslint/explicit-function-return-type": "off",
// Warn when "any" type is used
"@typescript-eslint/no-explicit-any": "warn",
// Warn on @ts-ignore comments
"@typescript-eslint/ban-ts-comment": "warn",
// Public methods should have return types
"@typescript-eslint/explicit-module-boundary-types": "error",
},
},
{
ignores: ["node_modules/", "dist/"],
},
eslintConfigPrettier,
];