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