[web] eslint: create lint rules to warn when using certain imports (#1617)

Co-authored-by: Yangshun Tay <tay.yang.shun@gmail.com>
This commit is contained in:
Zhou Yuhang 2025-08-04 07:56:12 +08:00 committed by GitHub
parent b0087fd52b
commit 567500c3cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 1 deletions

View File

@ -17,6 +17,7 @@ export default [
formatjs,
},
rules: {
'formatjs/enforce-default-message': ['error', 'literal'],
'formatjs/enforce-description': ['error', 'literal'],
'formatjs/enforce-id': [
'error',
@ -24,7 +25,17 @@ export default [
idInterpolationPattern: '[sha512:contenthash:base64:6]',
},
],
'formatjs/enforce-default-message': ['error', 'literal'],
'no-restricted-imports': [
'error',
{
patterns: [
{
group: ['react-intl', 'react-intl/*'],
message: 'Please use `~/components/intl` instead.',
},
],
},
],
},
},
];