mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 12:51:06 +00:00
Bug 1591013 - Add an eslint rule to prevent loading client modules from devtools/server r=nchevobbe
Depends on D51054 This will help catch some issues related to server files importing client files. Note that we still don't validate: - devtools/shared: at the moment devtools/shared still contains client only files which naturally import other client files, so linting here is not an option before we clean this up - require calls using variables eg require(MY_MODULE_URI). Maybe we should prevent this via another linting rule Differential Revision: https://phabricator.services.mozilla.com/D50466 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
0815c788fc
commit
4f668cb36e
@ -82,6 +82,14 @@ module.exports = {
|
||||
"rules": {
|
||||
"no-unused-vars": ["error", {"args": "none", "vars": "local"}],
|
||||
}
|
||||
}, {
|
||||
// For all server files, prevent requiring devtools/client modules.
|
||||
"files": [
|
||||
"server/**",
|
||||
],
|
||||
"rules": {
|
||||
"mozilla/reject-some-requires": ["error", "^devtools/client"],
|
||||
}
|
||||
}, {
|
||||
// Cu, Cc etc... are not available in most devtools modules loaded by require.
|
||||
"files": [
|
||||
|
Loading…
Reference in New Issue
Block a user