-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
33 lines (32 loc) · 1.24 KB
/
Copy patheslint.config.mjs
File metadata and controls
33 lines (32 loc) · 1.24 KB
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 globals from "globals";
import pluginJs from "@eslint/js";
/** @type {import('eslint').Linter.Config[]} */
export default [
{
languageOptions: {
globals: globals.browser,
},
},
pluginJs.configs.recommended,
{
files: ["src/**/*.js"],
rules: {
"quotes": ["error", "single"], // Enforce single quotes
"indent": ["error", 4, { "SwitchCase": 1 }],
"semi": ["error", "always"], // Require semicolons
"space-in-parens": ["error", "never"],
"space-infix-ops": "error", // Require spaces around operators
"keyword-spacing": [
"error",
{
before: true, // Require space before keywords
after: true, // Require space after keywords
},
],
"space-before-blocks": ["error", "always"], // Require spaces before blocks
"block-spacing": ["error", "always"], // Require spaces inside block braces
"brace-style": ["error", "1tbs", { allowSingleLine: false }], // Enforce 1TBS brace style
"yoda": ["error", "always", { exceptRange: true }], // Enforce literals-first in comparisons
},
},
];