66 lines
1.5 KiB
JavaScript
66 lines
1.5 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 tseslint from 'typescript-eslint';
|
|
|
|
export default tseslint.config(
|
|
{
|
|
ignores: ['node_modules', 'build', 'dist', 'public', 'coverage', 'coverage-reports'],
|
|
},
|
|
js.configs.recommended,
|
|
...tseslint.configs.recommended,
|
|
{
|
|
files: ['**/*.{ts,tsx}'],
|
|
languageOptions: {
|
|
parser: tseslint.parser,
|
|
ecmaVersion: 'latest',
|
|
sourceType: 'module',
|
|
globals: {
|
|
...globals.browser,
|
|
},
|
|
},
|
|
plugins: {
|
|
'react-hooks': reactHooks,
|
|
'react-refresh': reactRefresh,
|
|
},
|
|
rules: {
|
|
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
|
|
'react-hooks/rules-of-hooks': 'error',
|
|
'react-hooks/exhaustive-deps': 'warn',
|
|
},
|
|
},
|
|
{
|
|
files: ['**/*.test.{ts,tsx}', '**/__tests__/**/*.{ts,tsx}'],
|
|
rules: {
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
},
|
|
},
|
|
{
|
|
files: ['src/context/**/*.{ts,tsx}'],
|
|
rules: {
|
|
'react-refresh/only-export-components': 'off',
|
|
},
|
|
},
|
|
{
|
|
files: ['src/pwa/service-worker.js'],
|
|
languageOptions: {
|
|
globals: {
|
|
...globals.serviceworker,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
files: ['scripts/**/*.cjs'],
|
|
languageOptions: {
|
|
sourceType: 'commonjs',
|
|
globals: {
|
|
...globals.node,
|
|
},
|
|
},
|
|
rules: {
|
|
'@typescript-eslint/no-require-imports': 'off',
|
|
},
|
|
},
|
|
);
|