Anonymous
Как использовать свойство «переопределить» в конфигурации Tseslint?
Сообщение
Anonymous » 28 сен 2025, 12:01
Я использую TypeScript-Eslint в своем проекте. У него нет свойства «переопределять» как .estintrc.js.
Как я использую «переопределения» в моем tseslint.config? < /P>
Код: Выделить всё
export default tseslint.config(
{ ignores: ['dist'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended, importPlugin.flatConfigs.recommended, i18next.configs['flat/recommended']],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
'eslint-plugin-react': eslintPluginReact,
'eslint-plugin-i18next': i18next
},
rules: {
...reactHooks.configs.recommended.rules,
'i18next/no-literal-string': [
"error",
{
framework: 'react',
mode: "jsx-only",
'jsx-attributes': {
include: [],
exclude: ['*'],
},
callees: {
exclude: [
'content: '
],
},
},
],
},
"settings": {
"import/resolver": {
"typescript": true,
"node": true,
},
},
"overrides": [
{
"files": ['**/*.stories.{ts,tsx}'],
"rules": {
'i18next/no-literal-string': "off"
}
}
],
}
)
Я хочу переопределить 'i18next/no-literal-string правило для моих файлов сборников рассказов.
Подробнее здесь:
https://stackoverflow.com/questions/797 ... int-config
1759050083
Anonymous
Я использую TypeScript-Eslint в своем проекте. У него нет свойства «переопределять» как .estintrc.js. Как я использую «переопределения» в моем tseslint.config? < /P> [code]export default tseslint.config( { ignores: ['dist'] }, { extends: [js.configs.recommended, ...tseslint.configs.recommended, importPlugin.flatConfigs.recommended, i18next.configs['flat/recommended']], files: ['**/*.{ts,tsx}'], languageOptions: { ecmaVersion: 2020, globals: globals.browser, }, plugins: { 'react-hooks': reactHooks, 'react-refresh': reactRefresh, 'eslint-plugin-react': eslintPluginReact, 'eslint-plugin-i18next': i18next }, rules: { ...reactHooks.configs.recommended.rules, 'i18next/no-literal-string': [ "error", { framework: 'react', mode: "jsx-only", 'jsx-attributes': { include: [], exclude: ['*'], }, callees: { exclude: [ 'content: ' ], }, }, ], }, "settings": { "import/resolver": { "typescript": true, "node": true, }, }, "overrides": [ { "files": ['**/*.stories.{ts,tsx}'], "rules": { 'i18next/no-literal-string': "off" } } ], } ) [/code] Я хочу переопределить 'i18next/no-literal-string правило для моих файлов сборников рассказов. Подробнее здесь: [url]https://stackoverflow.com/questions/79777239/how-use-overrides-property-in-tseslint-config[/url]