OpChan/app/eslint.config.js

41 lines
1023 B
JavaScript
Raw Normal View History

2025-08-30 18:34:50 +05:30
import js from '@eslint/js';
import globals from 'globals';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import tseslint from 'typescript-eslint';
2025-04-15 16:28:03 +05:30
const tsconfigRootDir = new URL('.', import.meta.url).pathname;
2025-04-15 16:28:03 +05:30
export default tseslint.config(
2025-08-30 18:34:50 +05:30
{ ignores: ['dist'] },
2025-04-15 16:28:03 +05:30
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
2025-08-30 18:34:50 +05:30
files: ['**/*.{ts,tsx}'],
2025-04-15 16:28:03 +05:30
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
tsconfigRootDir,
},
2025-04-15 16:28:03 +05:30
},
plugins: {
2025-08-30 18:34:50 +05:30
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
2025-04-15 16:28:03 +05:30
},
rules: {
...reactHooks.configs.recommended.rules,
2025-08-30 18:34:50 +05:30
'react-refresh/only-export-components': [
'warn',
2025-04-15 16:28:03 +05:30
{ allowConstantExport: true },
],
2025-08-30 18:34:50 +05:30
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
2025-04-15 16:28:03 +05:30
},
}
);