forked from SynkraAI/aiox-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
176 lines (168 loc) · 4.91 KB
/
eslint.config.js
File metadata and controls
176 lines (168 loc) · 4.91 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
// @ts-check
const js = require('@eslint/js');
const tsPlugin = require('@typescript-eslint/eslint-plugin');
const tsParser = require('@typescript-eslint/parser');
/**
* AIOS Framework ESLint Configuration
* ESLint v9 flat config format
* @type {import('eslint').Linter.Config[]}
*/
module.exports = [
// Recommended JavaScript rules
js.configs.recommended,
// Global ignores
{
ignores: [
'**/node_modules/**',
'**/coverage/**',
'**/build/**',
'**/dist/**',
'**/.next/**',
// Dashboard has its own ESLint config
'apps/dashboard/**',
'**/.aios-core/_legacy-v4.31.0/**',
'**/web-bundles/**',
'**/*.min.js',
'**/aios-core/*.js',
'**/templates/squad/**',
// Squad template - ES modules with placeholder imports
'.aios-core/development/templates/squad-template/**',
// ESM bundle files - auto-generated
'**/*.esm.js',
'**/index.esm.js',
// Legacy and backup files
'**/*.backup*.js',
'**/aios-init-old.js',
'**/aios-init-v4.js',
// Scripts that need cleanup (TODO: fix in Story 6.2)
'.aios-core/quality/**',
'.aios-core/scripts/**',
// Development scripts with known ESLint errors (TODO: fix in future story)
'.aios-core/development/scripts/**',
'.claude/commands/AIOS/scripts/**',
// CLI files with legacy issues (TODO: fix)
'.aios-core/cli/**',
'.aios-core/infrastructure/scripts/**',
// Bin files with legacy issues
'bin/aios-init*.js',
'bin/migrate-*.js',
// Template files with placeholder syntax
'.aios-core/product/templates/**',
// Health Dashboard - uses Vite/React with ES modules
'tools/health-dashboard/**',
// Core orchestration/execution - legacy code with no-undef errors (TODO: fix)
'.aios-core/core/orchestration/**',
'.aios-core/core/execution/**',
// Hook integrations - legacy code (TODO: fix)
'.aios-core/hooks/**',
// Pro module - legacy code
'pro/**',
// Glue scripts
'scripts/glue/**',
],
},
// JavaScript files configuration
{
files: ['**/*.js', '**/*.mjs', '**/*.cjs'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'commonjs',
globals: {
// Node.js globals
__dirname: 'readonly',
__filename: 'readonly',
exports: 'writable',
module: 'readonly',
require: 'readonly',
process: 'readonly',
console: 'readonly',
Buffer: 'readonly',
setTimeout: 'readonly',
clearTimeout: 'readonly',
setInterval: 'readonly',
clearInterval: 'readonly',
setImmediate: 'readonly',
global: 'readonly',
// Node.js 18+ globals
fetch: 'readonly',
AbortController: 'readonly',
URL: 'readonly',
URLSearchParams: 'readonly',
structuredClone: 'readonly',
// Jest globals
describe: 'readonly',
it: 'readonly',
test: 'readonly',
expect: 'readonly',
beforeEach: 'readonly',
afterEach: 'readonly',
beforeAll: 'readonly',
afterAll: 'readonly',
jest: 'readonly',
},
},
rules: {
// Error prevention
'no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
'no-undef': 'error',
'no-console': 'off', // We need console for CLI tool
// Code style
semi: ['error', 'always'],
quotes: ['warn', 'single', { avoidEscape: true }],
indent: ['warn', 2, { SwitchCase: 1 }],
'comma-dangle': ['warn', 'always-multiline'],
// Best practices
eqeqeq: ['error', 'always', { null: 'ignore' }],
'no-var': 'error',
'prefer-const': 'warn',
'no-throw-literal': 'error',
// Relaxed rules for legacy code (TODO: fix and re-enable as errors)
'no-case-declarations': 'warn',
'no-useless-escape': 'warn',
'no-control-regex': 'warn',
'no-prototype-builtins': 'warn',
'no-empty': 'warn',
},
},
// TypeScript files configuration
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
},
},
plugins: {
'@typescript-eslint': tsPlugin,
},
rules: {
...tsPlugin.configs.recommended.rules,
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
},
},
// Test files - more relaxed rules
{
files: ['**/*.test.js', '**/*.spec.js', '**/tests/**/*.js'],
rules: {
'no-unused-vars': 'off',
'no-undef': 'off', // Jest globals
},
},
];