forked from louie007/passport-keycloak-oauth2-oidc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
65 lines (60 loc) · 2.14 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import { FlatCompat } from "@eslint/eslintrc";
import globals from "globals";
import jestPlugin from "eslint-plugin-jest";
import typescriptPlugin from "@typescript-eslint/eslint-plugin";
import typescriptParser from "@typescript-eslint/parser";
// Initialize FlatCompat
const compat = new FlatCompat();
export default [
// Ignore patterns to exclude all `.js`, `.mjs`, and other irrelevant files
{
ignores: ["**/*.js", "**/*.mjs", "dist/", "node_modules/", "temp/", "lib/"],
},
// TypeScript linting rules
{
files: ["**/*.ts"], // Only apply rules to TypeScript files
languageOptions: {
parser: typescriptParser, // Use TypeScript parser
parserOptions: {
project: "./tsconfig.eslint.json", // ESLint-specific TSConfig
},
globals: {
...globals.node,
...globals.jest,
...globals.browser,
},
},
plugins: {
"@typescript-eslint": typescriptPlugin,
jest: jestPlugin,
},
rules: {
// Suppress specific rules globally
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-require-imports": "off",
"@typescript-eslint/no-explicit-any": "off", // Disable warning for `any` types
// Configure no-unused-vars rule
// Update for no-unused-vars rule in eslint.config.mjs
"@typescript-eslint/no-unused-vars": [
"error",
{
args: "all", // Check all arguments
argsIgnorePattern: "^_", // Ignore arguments prefixed with "_"
vars: "all", // Check all variables
varsIgnorePattern: "^_", // Ignore variables prefixed with "_"
caughtErrors: "all", // Check all caught errors
caughtErrorsIgnorePattern: "^_", // Ignore caught errors prefixed with "_"
},
],
"@typescript-eslint/no-unsafe-function-type": "off", // Suppress unsafe function type errors
},
settings: {
jest: {
version: "detect", // Automatically detect Jest version
},
},
},
];