hyperdx/packages/app/.eslintrc.js
Aaron Knudtson 815e6424a0
chore: add lint rules to treat missing hook dependencies as errors (#1420)
Tested on each of the spots that had hooks that were changed, seems good
2025-12-01 19:12:46 -05:00

64 lines
1.8 KiB
JavaScript

module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: [
'simple-import-sort',
'@typescript-eslint',
'prettier',
'react-hooks',
],
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
extends: [
'next',
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
rules: {
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/no-empty-function': 'warn',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unsafe-function-type': 'warn',
'@typescript-eslint/no-unused-expressions': 'warn',
'@typescript-eslint/no-unused-vars': 'warn',
'react/display-name': 'off',
'simple-import-sort/exports': 'error',
'simple-import-sort/imports': 'error',
'react-hooks/exhaustive-deps': 'error',
'no-console': ['error', { allow: ['warn', 'error'] }],
},
overrides: [
{
files: ['**/*.js', '**/*.ts', '**/*.tsx'],
rules: {
'simple-import-sort/imports': [
'error',
{
groups: [
['^react$', '^next', '^[a-z]', '^@'],
['^@/'],
['^\\.\\.(?!/?$)', '^\\.\\./?$'],
['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
['^.+\\.s?css$'],
['^\\u0000'],
],
},
],
},
},
{
// Disable strict rules for E2E test files
files: ['tests/e2e/**/*.ts', 'tests/e2e/**/*.js'],
rules: {
'no-console': 'off',
'no-empty': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@next/next/no-html-link-for-pages': 'off',
},
},
],
};