portfolio-page/eslint.config.js

35 lines
1.0 KiB
JavaScript

import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import jsxA11y from 'eslint-plugin-jsx-a11y'
import tseslint from 'typescript-eslint'
import { globalIgnores } from 'eslint/config'
export default tseslint.config([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
js.configs.recommended,
tseslint.configs.recommended,
reactHooks.configs.flat['recommended-latest'],
reactRefresh.configs.vite,
jsxA11y.flatConfigs.recommended,
],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
},
{
// Context files intentionally co-locate the Provider component with its
// consumer hook (and small helpers); splitting them for Fast Refresh
// purity isn't worth the extra indirection at this app's size.
files: ['src/contexts/**/*.tsx'],
rules: {
'react-refresh/only-export-components': 'off',
},
},
])