Add rule for warning against electron.remote
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
This commit is contained in:
committed by
Facebook GitHub Bot
parent
fe3a6bd55e
commit
d42932c111
@@ -68,6 +68,13 @@ module.exports = {
|
||||
'no-unsafe-negation': 2,
|
||||
'no-useless-computed-key': 2,
|
||||
'no-useless-rename': 2,
|
||||
'no-restricted-properties': [
|
||||
1,
|
||||
{
|
||||
object: 'electron',
|
||||
property: 'remote',
|
||||
},
|
||||
],
|
||||
|
||||
// additional rules for this project
|
||||
'header/header': [2, 'block', {pattern}],
|
||||
@@ -76,6 +83,7 @@ module.exports = {
|
||||
'node/no-extraneous-import': [2, {allowModules: builtInModules}],
|
||||
'node/no-extraneous-require': [2, {allowModules: builtInModules}],
|
||||
'flipper/no-relative-imports-across-packages': [2],
|
||||
'flipper/no-electron-remote-imports': [1],
|
||||
},
|
||||
settings: {
|
||||
'import/resolver': {
|
||||
|
||||
Reference in New Issue
Block a user