2024-07-02 02:38:34 +00:00
|
|
|
import tsParser from '@typescript-eslint/parser';
|
|
|
|
import sharedConfig from '../shared/eslint.config.js';
|
2024-10-16 01:32:03 +00:00
|
|
|
import globals from 'globals';
|
2024-07-02 02:38:34 +00:00
|
|
|
|
|
|
|
export default [
|
|
|
|
...sharedConfig,
|
|
|
|
{
|
2024-07-19 01:05:34 +00:00
|
|
|
ignores: ['**/node_modules', 'built', '@types/**/*', 'migration'],
|
2024-07-02 02:38:34 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
files: ['**/*.ts', '**/*.tsx'],
|
|
|
|
languageOptions: {
|
|
|
|
parserOptions: {
|
|
|
|
parser: tsParser,
|
|
|
|
project: ['./tsconfig.json', './test/tsconfig.json'],
|
|
|
|
sourceType: 'module',
|
|
|
|
tsconfigRootDir: import.meta.dirname,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
rules: {
|
|
|
|
'import/order': ['warn', {
|
|
|
|
groups: [
|
|
|
|
'builtin',
|
|
|
|
'external',
|
|
|
|
'internal',
|
|
|
|
'parent',
|
|
|
|
'sibling',
|
|
|
|
'index',
|
|
|
|
'object',
|
|
|
|
'type',
|
|
|
|
],
|
|
|
|
pathGroups: [{
|
|
|
|
pattern: '@/**',
|
|
|
|
group: 'external',
|
|
|
|
position: 'after',
|
|
|
|
}],
|
|
|
|
}],
|
|
|
|
'no-restricted-globals': ['error', {
|
|
|
|
name: '__dirname',
|
|
|
|
message: 'Not in ESModule. Use `import.meta.url` instead.',
|
|
|
|
}, {
|
|
|
|
name: '__filename',
|
|
|
|
message: 'Not in ESModule. Use `import.meta.url` instead.',
|
|
|
|
}],
|
2024-12-07 15:22:45 +00:00
|
|
|
// https://typescript-eslint.io/rules/prefer-nullish-coalescing/
|
|
|
|
'@typescript-eslint/prefer-nullish-coalescing': ['warn', {
|
|
|
|
ignorePrimitives: {
|
|
|
|
// Without this, the rule breaks for nullable booleans
|
|
|
|
boolean: true,
|
|
|
|
},
|
|
|
|
}],
|
2024-07-02 02:38:34 +00:00
|
|
|
},
|
|
|
|
},
|
2024-10-16 01:32:03 +00:00
|
|
|
{
|
|
|
|
files: ['src/server/web/**/*.js', 'src/server/web/**/*.ts'],
|
|
|
|
languageOptions: {
|
|
|
|
globals: {
|
|
|
|
...globals.browser,
|
|
|
|
LANGS: true,
|
|
|
|
CLIENT_ENTRY: true,
|
|
|
|
LANGS_VERSION: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2024-10-16 14:30:38 +00:00
|
|
|
{
|
|
|
|
ignores: [
|
|
|
|
"**/lib/",
|
|
|
|
"**/temp/",
|
|
|
|
"**/built/",
|
|
|
|
"**/coverage/",
|
|
|
|
"**/node_modules/",
|
|
|
|
"**/migration/",
|
|
|
|
]
|
|
|
|
},
|
2024-07-02 02:38:34 +00:00
|
|
|
];
|