Skip to content

Commit 2d1301b

Browse files
committed
chore: update ESLint configuration to enforce 4-space indentation by default and 2-space indentation for JSX files
1 parent fd2d4a7 commit 2d1301b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

eslint.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ export default tseslint.config(
103103
'import/no-duplicates': 'error',
104104

105105
// Spacing rules for consistency
106+
'@stylistic/indent': ['error', 4], // Set default indentation to 4 spaces.
106107
'@stylistic/space-infix-ops': 'error', // Enforces spaces around operators like +, =, etc.
107108
'@stylistic/keyword-spacing': ['error', { 'before': true, 'after': true }], // Enforces spaces around keywords like if, else.
108109
'@stylistic/arrow-spacing': ['error', { 'before': true, 'after': true }], // Enforces spaces around arrow in arrow functions.
@@ -120,4 +121,12 @@ export default tseslint.config(
120121
}],
121122
},
122123
},
124+
// Override for JSX files
125+
{
126+
files: ['**/*.jsx', '**/*.tsx'],
127+
rules: {
128+
'@stylistic/indent': ['error', 2], // Set indentation to 2 spaces for JSX files.
129+
},
130+
},
123131
);
132+

0 commit comments

Comments
 (0)