2021-12-08 23:43:52 +08:00
|
|
|
{
|
2021-12-13 17:23:35 +08:00
|
|
|
"env": {
|
|
|
|
"browser": true,
|
|
|
|
"es2021": true
|
|
|
|
},
|
|
|
|
"extends": ["eslint:recommended", "plugin:react/recommended", "plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"],
|
|
|
|
"parser": "@typescript-eslint/parser",
|
|
|
|
"parserOptions": {
|
|
|
|
"ecmaFeatures": {
|
|
|
|
"jsx": true
|
|
|
|
},
|
|
|
|
"ecmaVersion": "latest",
|
|
|
|
"sourceType": "module"
|
|
|
|
},
|
|
|
|
"plugins": ["react", "@typescript-eslint", "prettier"],
|
2024-02-01 19:39:41 +08:00
|
|
|
"ignorePatterns": ["node_modules", "dist", "public", "src/wasm"],
|
2021-12-13 17:23:35 +08:00
|
|
|
"rules": {
|
2021-12-14 06:51:06 +08:00
|
|
|
"prettier/prettier": [
|
|
|
|
"error",
|
|
|
|
{
|
|
|
|
"endOfLine": "auto"
|
|
|
|
}
|
|
|
|
],
|
2022-11-04 07:43:56 +08:00
|
|
|
"no-unused-vars": "off",
|
|
|
|
"@typescript-eslint/no-unused-vars": "error",
|
2021-12-13 17:23:35 +08:00
|
|
|
"@typescript-eslint/no-explicit-any": ["off"],
|
2023-03-04 15:06:01 +08:00
|
|
|
"react/react-in-jsx-scope": "off",
|
2023-07-16 21:26:26 +08:00
|
|
|
"react/jsx-no-target-blank": "off",
|
|
|
|
"no-restricted-syntax": [
|
|
|
|
"error",
|
|
|
|
{
|
|
|
|
"selector": "VariableDeclarator[init.callee.name='useTranslation'] > ObjectPattern > Property[key.name='t']:not([parent.declarations.0.init.callee.object.name='i18n'])",
|
|
|
|
"message": "Destructuring 't' from useTranslation is not allowed. Please use the 'useTranslate' hook from '@/utils/i18n'."
|
|
|
|
}
|
|
|
|
]
|
2022-07-07 22:02:40 +08:00
|
|
|
},
|
|
|
|
"settings": {
|
|
|
|
"react": {
|
|
|
|
"version": "detect"
|
|
|
|
}
|
2023-07-16 21:26:26 +08:00
|
|
|
},
|
|
|
|
"overrides": [
|
|
|
|
{
|
|
|
|
"files": ["src/utils/i18n.ts"],
|
|
|
|
"rules": {
|
|
|
|
"no-restricted-syntax": "off"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2021-12-08 23:43:52 +08:00
|
|
|
}
|