You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
105 lines
2.8 KiB
JavaScript
105 lines
2.8 KiB
JavaScript
import js from '@eslint/js'
|
|
import typescript from '@typescript-eslint/eslint-plugin'
|
|
import typescriptParser from '@typescript-eslint/parser'
|
|
import react from 'eslint-plugin-react'
|
|
import reactHooks from 'eslint-plugin-react-hooks'
|
|
|
|
export default [
|
|
js.configs.recommended,
|
|
{
|
|
files: ['**/*.{ts,tsx}'],
|
|
languageOptions: {
|
|
parser: typescriptParser,
|
|
parserOptions: {
|
|
ecmaVersion: 'latest',
|
|
sourceType: 'module',
|
|
ecmaFeatures: {
|
|
jsx: true,
|
|
},
|
|
},
|
|
globals: {
|
|
// Browser globals
|
|
window: 'readonly',
|
|
document: 'readonly',
|
|
navigator: 'readonly',
|
|
console: 'readonly',
|
|
setTimeout: 'readonly',
|
|
clearTimeout: 'readonly',
|
|
setInterval: 'readonly',
|
|
clearInterval: 'readonly',
|
|
HTMLElement: 'readonly',
|
|
HTMLDivElement: 'readonly',
|
|
HTMLButtonElement: 'readonly',
|
|
HTMLInputElement: 'readonly',
|
|
HTMLParagraphElement: 'readonly',
|
|
HTMLSpanElement: 'readonly',
|
|
HTMLFormElement: 'readonly',
|
|
HTMLTableElement: 'readonly',
|
|
HTMLTableSectionElement: 'readonly',
|
|
HTMLTableRowElement: 'readonly',
|
|
HTMLTableCellElement: 'readonly',
|
|
HTMLTableCaptionElement: 'readonly',
|
|
Event: 'readonly',
|
|
CustomEvent: 'readonly',
|
|
// Node.js globals
|
|
process: 'readonly',
|
|
module: 'readonly',
|
|
require: 'readonly',
|
|
__dirname: 'readonly',
|
|
__filename: 'readonly',
|
|
// Next.js globals
|
|
React: 'readonly',
|
|
// Jest globals (for tests)
|
|
describe: 'readonly',
|
|
it: 'readonly',
|
|
expect: 'readonly',
|
|
test: 'readonly',
|
|
beforeEach: 'readonly',
|
|
afterEach: 'readonly',
|
|
beforeAll: 'readonly',
|
|
afterAll: 'readonly',
|
|
jest: 'readonly',
|
|
},
|
|
},
|
|
plugins: {
|
|
'@typescript-eslint': typescript,
|
|
react: react,
|
|
'react-hooks': reactHooks,
|
|
},
|
|
rules: {
|
|
'@typescript-eslint/no-unused-vars': [
|
|
'error',
|
|
{
|
|
argsIgnorePattern: '^_',
|
|
varsIgnorePattern: '^_',
|
|
},
|
|
],
|
|
'@typescript-eslint/no-explicit-any': 'warn',
|
|
'no-console': ['warn', { allow: ['warn', 'error'] }],
|
|
'no-unused-vars': 'off', // Use @typescript-eslint/no-unused-vars instead
|
|
'react/react-in-jsx-scope': 'off', // Not needed in Next.js
|
|
'react-hooks/rules-of-hooks': 'error',
|
|
'react-hooks/exhaustive-deps': 'warn',
|
|
},
|
|
settings: {
|
|
react: {
|
|
version: 'detect',
|
|
},
|
|
},
|
|
},
|
|
{
|
|
ignores: [
|
|
'node_modules/**',
|
|
'.next/**',
|
|
'out/**',
|
|
'dist/**',
|
|
'build/**',
|
|
'coverage/**',
|
|
'tests/**', // Ignore test files
|
|
'*.config.js',
|
|
'*.config.ts',
|
|
'*.config.mjs',
|
|
],
|
|
},
|
|
]
|