-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
33 lines (29 loc) · 1.11 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
import jsPlugin from "@eslint/js"
import tsPlugin from "@typescript-eslint/eslint-plugin"
import tsParser from "@typescript-eslint/parser"
import globals from "globals"
export default [
{
// Apply this configuration to JavaScript and TypeScript files
files: ["**/*.{js,mjs,cjs,ts}"],
// Specify the JavaScript and TypeScript language options
languageOptions: {
parser: tsParser, // Set the parser for TypeScript
globals: globals.browser, // Use browser globals (e.g., window, document)
sourceType: "module", // Set ES module type for JavaScript
ecmaVersion: "latest", // Use the latest ECMAScript version
},
// Use JavaScript and TypeScript ESLint rules
plugins: {
"@typescript-eslint": tsPlugin, // Register the TypeScript plugin
},
// Apply recommended rules for both JS and TS
rules: {
...jsPlugin.configs.recommended.rules,
...tsPlugin.configs.recommended.rules, // Access rules properly
// Disable no-explicit-any rule
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off",
},
},
]