punimtag/admin-frontend/eslint.config.mjs
Tanya df7053dbd4
Some checks failed
CI / skip-ci-check (pull_request) Successful in 1m34s
CI / lint-and-type-check (pull_request) Failing after 2m17s
CI / python-lint (pull_request) Failing after 2m0s
CI / test-backend (pull_request) Successful in 3m42s
CI / build (pull_request) Successful in 4m42s
CI / secret-scanning (pull_request) Successful in 1m42s
CI / dependency-scan (pull_request) Successful in 1m41s
CI / sast-scan (pull_request) Successful in 2m44s
CI / workflow-summary (pull_request) Failing after 1m34s
chore: Replace ESLint configuration file with new format and update dependencies
This commit removes the old ESLint configuration file and introduces a new configuration file in ES module format. It also updates several ESLint-related dependencies to their latest versions, ensuring improved linting capabilities and compatibility with the current codebase. Additionally, the linting command in package.json has been simplified for better usability.
2026-01-12 14:42:45 -05:00

85 lines
2.0 KiB
JavaScript

import js from '@eslint/js';
import globals from 'globals';
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import tseslint from 'typescript-eslint';
export default tseslint.config(
{
ignores: ['dist', 'node_modules'],
},
{
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 'latest',
globals: {
...globals.browser,
...globals.node,
...globals.es2021,
},
parser: tseslint.parser,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
},
},
plugins: {
'@typescript-eslint': tseslint.plugin,
react,
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
settings: {
react: {
version: 'detect',
},
},
rules: {
...js.configs.recommended.rules,
...tseslint.configs.recommended.rules,
...react.configs.recommended.rules,
...reactHooks.configs.recommended.rules,
'max-len': [
'error',
{
code: 120,
tabWidth: 2,
ignoreUrls: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreComments: true,
},
],
'react/react-in-jsx-scope': 'off',
'react/no-unescaped-entities': [
'error',
{
forbid: ['>', '}'],
},
],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
'react-hooks/exhaustive-deps': 'warn',
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
},
{
files: ['**/Help.tsx', '**/Dashboard.tsx'],
rules: {
'react/no-unescaped-entities': 'off',
},
},
);