63 lines
1.7 KiB
JavaScript
63 lines
1.7 KiB
JavaScript
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 },
|
|
},
|
|
],
|
|
},
|
|
},
|
|
);
|