-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
62 lines (59 loc) · 1.65 KB
/
eslint.config.mjs
File metadata and controls
62 lines (59 loc) · 1.65 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import js from '@eslint/js';
import globals from 'globals';
/**
* Root ESLint configuration for the design-system-toolkit monorepo
*
* This configuration provides shared JavaScript/TypeScript linting rules
* across all packages. Individual packages can extend or override these
* rules in their own eslint.config files.
*
* Packages should import and extend this config:
* ```js
* import rootConfig from '../../eslint.config.mjs';
* export default [...rootConfig, { your overrides }];
* ```
*/
export default [
{
ignores: [
'**/node_modules/**',
'**/dist/**',
'**/coverage/**',
'**/storybook-static/**',
'**/*.config.js', // Build config files often need different rules
'**/build/**',
'**/.turbo/**',
],
},
js.configs.recommended,
{
files: ['**/*.js', '**/*.mjs'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
...globals.browser,
...globals.node,
...globals.es2021,
},
},
rules: {
// Possible Problems
'no-unused-vars': ['error', {
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
}],
'no-console': ['warn', { allow: ['warn', 'error'] }],
// Best Practices
'eqeqeq': ['error', 'always', { null: 'ignore' }],
'no-var': 'error',
'prefer-const': 'error',
'prefer-arrow-callback': 'warn',
// Stylistic (aligned with Prettier)
'quotes': ['error', 'single', { avoidEscape: true }],
'semi': ['error', 'always'],
'comma-dangle': ['error', 'always-multiline'],
'indent': ['error', 2, { SwitchCase: 1 }],
},
},
];