forked from tari-project/universe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
58 lines (55 loc) · 1.99 KB
/
eslint.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import react from 'eslint-plugin-react';
import hooksPlugin from 'eslint-plugin-react-hooks';
import i18next from 'eslint-plugin-i18next';
import prettierConfig from 'eslint-config-prettier';
import prettierPluginConfig from 'eslint-plugin-prettier/recommended';
import globals from 'globals';
import tsParser from '@typescript-eslint/parser';
export default [
react.configs.flat.recommended,
react.configs.flat['jsx-runtime'],
eslint.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.stylistic,
prettierConfig,
prettierPluginConfig,
{
settings: {
react: {
version: 'detect',
},
},
languageOptions: {
globals: { ...globals.browser },
parser: tsParser,
parserOptions: { ecmaFeatures: { jsx: true } },
},
files: ['src/**/*.{js,ts,jsx,tsx}', 'scripts/**/*.{js,ts,jsx,tsx}'],
ignores: ['./**/*.config.{js,ts}'],
plugins: { react, 'react-hooks': hooksPlugin, i18next },
rules: {
...react.configs.recommended.rules,
...hooksPlugin.configs.recommended.rules,
'no-console': [
'warn',
{ allow: ['info', 'warn', 'debug', 'error', 'group', 'groupCollapsed', 'groupEnd'] },
],
'no-unused-vars': 'off', // base rule must be disabled
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-explicit-any': 'warn',
'react/prop-types': 'off',
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
'i18next/no-literal-string': ['error', { markupOnly: true }],
},
},
];