memos/web/.eslintrc.json

51 lines
1.3 KiB
JSON
Raw Normal View History

2021-12-08 18:43:52 +03:00
{
2021-12-13 12:23:35 +03: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"],
"ignorePatterns": ["node_modules", "dist", "public"],
"rules": {
2021-12-14 01:51:06 +03:00
"prettier/prettier": [
"error",
{
"endOfLine": "auto"
}
],
2022-11-04 02:43:56 +03:00
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error",
2021-12-13 12:23:35 +03:00
"@typescript-eslint/no-explicit-any": ["off"],
2023-03-04 10:06:01 +03:00
"react/react-in-jsx-scope": "off",
"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'."
}
]
},
"settings": {
"react": {
"version": "detect"
}
},
"overrides": [
{
"files": ["src/utils/i18n.ts"],
"rules": {
"no-restricted-syntax": "off"
}
}
]
2021-12-08 18:43:52 +03:00
}