refactor: standardize export style to named exports (#10630)

* refactor: standardize export style to named exports

* refactor: export enums directly

* fix: update importing in generateRequires script

* fix: missed places

* feat: add eslint rule

* fix: ci errors

* fix: leftovers

* fix: remove accidentally readded interaction response

* fix: remove interaction response export

* fix: correct collection export

* chore: add another eslint rule

---------

Co-authored-by: almeidx <github@almeidx.dev>
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
Danial Raza
2025-01-18 19:58:28 +01:00
committed by GitHub
parent c6e16c3675
commit ad6b006d35
287 changed files with 1183 additions and 1137 deletions

View File

@@ -198,6 +198,30 @@
"name": "clearInterval",
"message": "Import clearInterval from `node:timers` instead"
}
],
"no-restricted-syntax": [
"error",
{
"selector": "AssignmentExpression[left.object.name='module'][left.property.name='exports']",
"message": "Use named exports instead of module.exports"
},
{
"selector": "VariableDeclarator[init.callee.name='require'][init.arguments.0.value=/^\\./]:not([id.type='ObjectPattern'])",
"message": "Use object destructuring when requiring local modules"
}
]
}
},
{
"files": ["src/client/websocket/handlers/*.js"],
"rules": {
"no-restricted-syntax": [
"error",
{
"selector": "VariableDeclarator[init.callee.name='require'][init.arguments.0.value=/^\\./]:not([id.type='ObjectPattern'])",
"message": "Use object destructuring when requiring local modules"
}
]
}
},