chore(eslint): replace no-restricted-imports with no-restricted-syntax for require() compat
This commit is contained in:
parent
b76772b8eb
commit
4e3523b2e7
|
|
@ -72,19 +72,16 @@ export default [
|
|||
files: ['routes/**/*.cts'],
|
||||
ignores: ['routes/transactions.cts', 'routes/import.cts'],
|
||||
rules: {
|
||||
'no-restricted-imports': [
|
||||
// no-restricted-imports can't see require() — match the call itself.
|
||||
'no-restricted-syntax': [
|
||||
'error',
|
||||
{
|
||||
paths: [
|
||||
{
|
||||
name: '../middleware/errorFormatter.cts',
|
||||
selector: "CallExpression[callee.name='require'] Literal[value=/errorFormatter/]",
|
||||
message:
|
||||
'Routes emit errors by throwing utils/apiError.cts factories (see CODE_STANDARDS.md); the terminal handler formats them.',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['client/**/*.{js,jsx}'],
|
||||
|
|
|
|||
Loading…
Reference in New Issue