Summary: I don't think there's an easy way to do this based on types which would be ideal ... So instead I'm checking for - Importing `remote` from `electron`. - Accessing `electron.remote`. You can still hack this by importing `electron`, saving it to a differently named variable and accessing `remote` on it, but this should cover all reasonable cases we see in real code. Reviewed By: mweststrate Differential Revision: D26453006 fbshipit-source-id: 4b3d223bed43ca3f0d1a4f592ea8f8060a823479
23 lines
659 B
TypeScript
23 lines
659 B
TypeScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @format
|
|
*/
|
|
|
|
import noRelativeImportsAcrossPackages, {
|
|
RULE_NAME as noRelativeImportsAcrossPackagesRuleName,
|
|
} from './rules/noRelativeImportsAcrossPackages';
|
|
import noElectronRemoteImports, {
|
|
RULE_NAME as noElectronRemoteImportsRuleName,
|
|
} from './rules/noElectronRemoteImports';
|
|
|
|
module.exports = {
|
|
rules: {
|
|
[noRelativeImportsAcrossPackagesRuleName]: noRelativeImportsAcrossPackages,
|
|
[noElectronRemoteImportsRuleName]: noElectronRemoteImports,
|
|
},
|
|
};
|