2025-11-17 00:25:50 +00:00
|
|
|
const nextCoreWebVitals = require('eslint-config-next/core-web-vitals');
|
|
|
|
|
const i18Next = require('eslint-plugin-i18next');
|
|
|
|
|
const globals = require('globals');
|
|
|
|
|
const tsParser = require('@typescript-eslint/parser');
|
|
|
|
|
const js = require('@eslint/js');
|
2024-10-22 17:21:56 +00:00
|
|
|
|
2025-11-17 00:25:50 +00:00
|
|
|
const { FlatCompat } = require('@eslint/eslintrc');
|
2024-10-22 17:21:56 +00:00
|
|
|
|
|
|
|
|
const compat = new FlatCompat({
|
2025-11-17 00:25:50 +00:00
|
|
|
baseDirectory: __dirname,
|
|
|
|
|
recommendedConfig: js.configs.recommended,
|
|
|
|
|
allConfig: js.configs.all,
|
2024-10-22 17:21:56 +00:00
|
|
|
});
|
|
|
|
|
|
2025-11-17 00:25:50 +00:00
|
|
|
module.exports = [
|
|
|
|
|
{
|
|
|
|
|
ignores: [
|
|
|
|
|
'.next',
|
|
|
|
|
'**/node_modules',
|
|
|
|
|
'**/dist',
|
|
|
|
|
'eslint.config.cjs',
|
|
|
|
|
'node_modules/**',
|
|
|
|
|
'.next/**',
|
|
|
|
|
'out/**',
|
|
|
|
|
'build/**',
|
|
|
|
|
'next-env.d.ts',
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
...compat.extends('eslint:recommended'),
|
|
|
|
|
...compat.extends('prettier'),
|
|
|
|
|
...nextCoreWebVitals,
|
|
|
|
|
...compat.extends('plugin:i18next/recommended'),
|
|
|
|
|
{
|
|
|
|
|
plugins: {
|
|
|
|
|
i18next: i18Next,
|
|
|
|
|
},
|
|
|
|
|
|
2024-10-22 17:21:56 +00:00
|
|
|
languageOptions: {
|
2025-11-17 00:25:50 +00:00
|
|
|
globals: {
|
|
|
|
|
...globals.node,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
parser: tsParser,
|
|
|
|
|
ecmaVersion: 13,
|
|
|
|
|
sourceType: 'module',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
files: ['**/*.ts', '**/*.tsx'],
|
|
|
|
|
|
|
|
|
|
rules: {
|
|
|
|
|
'no-undef': 'off',
|
|
|
|
|
'no-unused-vars': 'off',
|
|
|
|
|
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
|
|
|
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
|
|
|
'import/no-anonymous-default-export': 'off',
|
|
|
|
|
'@typescript-eslint/no-require-imports': 'off',
|
|
|
|
|
'i18next/no-literal-string': 'off',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
files: ['**/*.js'],
|
|
|
|
|
|
|
|
|
|
rules: {
|
|
|
|
|
'@typescript-eslint/no-var-requires': 'off',
|
|
|
|
|
'@typescript-eslint/no-require-imports': 'off',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
files: ['sdk/**/*'],
|
|
|
|
|
|
|
|
|
|
rules: {
|
|
|
|
|
'@next/next/no-img-element': 'off',
|
2024-10-22 17:21:56 +00:00
|
|
|
},
|
2025-11-17 00:25:50 +00:00
|
|
|
},
|
|
|
|
|
];
|