mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-21 05:53:30 +01:00
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:
@@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user