refactor: extract signals filter builder, add ESLint 10 config, fix low-hanging issues
This commit is contained in:
62
web/eslint.config.mjs
Normal file
62
web/eslint.config.mjs
Normal file
@@ -0,0 +1,62 @@
|
||||
import js from '@eslint/js';
|
||||
import importX from 'eslint-plugin-import-x';
|
||||
import reactX from 'eslint-plugin-react-x';
|
||||
import globals from 'globals';
|
||||
import tseslint from 'typescript-eslint';
|
||||
|
||||
export default tseslint.config(
|
||||
{
|
||||
ignores: ['**/node_modules', '**/.next', '**/dist', '**/out'],
|
||||
},
|
||||
{
|
||||
files: ['**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
||||
languageOptions: { globals: { ...globals.browser, ...globals.node } },
|
||||
},
|
||||
js.configs.recommended,
|
||||
tseslint.configs.recommended,
|
||||
reactX.configs.recommended,
|
||||
{
|
||||
plugins: {
|
||||
'import-x': importX,
|
||||
},
|
||||
rules: {
|
||||
'@typescript-eslint/consistent-type-imports': [
|
||||
'error',
|
||||
{ prefer: 'type-imports', fixStyle: 'inline-type-imports' },
|
||||
],
|
||||
'@typescript-eslint/no-explicit-any': 'error',
|
||||
'@typescript-eslint/no-non-null-assertion': 'error',
|
||||
'@typescript-eslint/ban-ts-comment': [
|
||||
'error',
|
||||
{
|
||||
'ts-expect-error': 'allow-with-description',
|
||||
'ts-ignore': 'allow-with-description',
|
||||
'ts-nocheck': true,
|
||||
'ts-check': true,
|
||||
},
|
||||
],
|
||||
'react-x/exhaustive-deps': 'error',
|
||||
'react-x/use-state': 'off',
|
||||
'react-x/no-context-provider': 'off',
|
||||
'react-x/no-array-index-key': 'off',
|
||||
'react-x/no-use-context': 'off',
|
||||
'import-x/no-duplicates': 'error',
|
||||
'import-x/order': [
|
||||
'warn',
|
||||
{
|
||||
groups: [
|
||||
'builtin',
|
||||
'external',
|
||||
'internal',
|
||||
['parent', 'sibling'],
|
||||
'index',
|
||||
'object',
|
||||
'type',
|
||||
],
|
||||
'newlines-between': 'always',
|
||||
alphabetize: { order: 'asc', caseInsensitive: true },
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
);
|
||||
Reference in New Issue
Block a user