-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
41 lines (40 loc) · 1.02 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
import globals from "globals";
import pluginJs from "@eslint/js";
export default [
// Configuration for JavaScript files
{
files: ["**/*.js"], // Applies to all JavaScript files
parserOptions: {
// Correct from `languageOptions` to `parserOptions`
sourceType: "commonjs", // Specifies CommonJS modules
},
env: {
node: true, // Ensure Node.js environment is enabled
},
globals: { ...globals.node }, // Adds Node.js globals
rules: {
// Customize the `no-unused-vars` rule
"no-unused-vars": [
"warn",
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
],
},
},
// Configuration for handling global variables in a browser context
{
parserOptions: {
sourceType: "module",
},
env: {
browser: true, // Explicitly set browser environment if needed
},
globals: globals.browser,
},
pluginJs.configs.recommended,
// Your custom rule modifications can also go here
{
rules: {
// ... other rules
},
},
];