-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
54 lines (51 loc) · 1.37 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
// eslint.config.js
import globals from "globals";
import pluginJs from "@eslint/js";
import pluginSecurity from 'eslint-plugin-security';
export default [
// Backend Configuration: CommonJS
{
files: ["backend/**/*.js", "**/*.cjs"], // Adjust paths as needed
languageOptions: {
sourceType: "commonjs",
globals: globals.node,
},
plugins: {
security: pluginSecurity,
},
rules: {
...pluginJs.configs.recommended.rules,
...pluginSecurity.configs.recommended.rules,
},
},
// Frontend Configuration: ES Modules
{
files: ["frontend/**/*.js", "**/*.mjs"], // Adjust paths and extensions as needed
languageOptions: {
sourceType: "module",
globals: globals.browser,
},
plugins: {
security: pluginSecurity,
},
rules: {
...pluginJs.configs.recommended.rules,
...pluginSecurity.configs.recommended.rules,
},
},
// Optional: Additional Global Configuration
{
files: ["**/*.js", "**/*.mjs", "**/*.cjs"],
languageOptions: {
ecmaVersion: 2021, // or your preferred ECMAScript version
sourceType: "module", // Default to module; can be overridden by specific configurations
},
plugins: {
security: pluginSecurity,
},
rules: {
...pluginJs.configs.recommended.rules,
...pluginSecurity.configs.recommended.rules,
},
},
];