Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions apps/frontend/.eslintignore

This file was deleted.

98 changes: 0 additions & 98 deletions apps/frontend/.eslintrc

This file was deleted.

133 changes: 133 additions & 0 deletions apps/frontend/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
import eslint from '@eslint/js';
import tsParser from '@typescript-eslint/parser';
import { defineConfig } from 'eslint/config';
import importPlugin from 'eslint-plugin-import';
import prettier from 'eslint-plugin-prettier';
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import unusedImports from 'eslint-plugin-unused-imports';
import tseslint from 'typescript-eslint';

export default defineConfig([
{
ignores: [
'node_modules',
'.next',
'build',
'dist',
'public',
'src/serviceWorker.js',
'src/setupProxy.js',
'src/generated/sdk.ts',
'server.js',
],
},
// Base configs
eslint.configs.recommended,
tseslint.configs.recommended,
react.configs.flat.recommended,
reactHooks.configs.flat.recommended,
importPlugin.flatConfigs.recommended,
importPlugin.flatConfigs.typescript,

// Custom project configuration
{
files: ['**/*.{ts,tsx,js,jsx}'],
languageOptions: {
parser: tsParser,
ecmaVersion: 2018,
sourceType: 'module',
globals: {
browser: true,
commonjs: true,
node: true,
es6: true,
},
},
settings: {
react: {
version: '18.3.1',
},
'import/resolver': {
typescript: {
project: './tsconfig.json',
},
},
},
plugins: {
'unused-imports': unusedImports,
prettier,
},
rules: {
// Import order
'import/order': [
'error',
{
groups: [
'builtin',
'external',
'internal',
['parent', 'sibling'],
'index',
],
pathGroups: [
{
pattern:
'+(components|context|generated|graphql|hooks|images|models|styles|utils)/**',
group: 'internal',
position: 'after',
},
],
pathGroupsExcludedImportTypes: ['builtin'],
'newlines-between': 'always',
alphabetize: { order: 'asc', caseInsensitive: true },
},
],
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'@typescript-eslint/no-use-before-define': ['error'],
'@typescript-eslint/no-empty-function': [
'error',
{ allow: ['arrowFunctions'] },
],
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'variable',
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
leadingUnderscore: 'allow',
trailingUnderscore: 'allow',
},
{
selector: 'function',
format: ['PascalCase', 'camelCase'],
},
],
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'react/display-name': 'warn',
'react/prop-types': 'off',
'prettier/prettier': 'error',
'padding-line-between-statements': [
'error',
{ blankLine: 'always', prev: '*', next: 'return' },
],
'unused-imports/no-unused-imports': 'error',
'@typescript-eslint/no-unused-expressions': [
'error',
{ allowShortCircuit: true, allowTernary: true },
],
//TS already handles undef variables
'no-undef': 'off',
'no-unused-vars': 'off',
'no-unused-expressions': 'off',

// Maybe we can enable these later
'no-extra-boolean-cast': 'off',
'no-case-declarations': 'off',
'react-hooks/set-state-in-effect': 'off',
'react-hooks/static-components': 'off',
},
},
]);
Loading
Loading