Fix circular imports and lint against them

Summary: When trying to refactor some components, did once again run into circular imports that cause the flipper startup sequence to fail. Added linting rules to make sure this is much less likely to happen in the future, and fixed all resulting errors

Reviewed By: nikoant

Differential Revision: D24390583

fbshipit-source-id: 9b20cf6a4d3555dc68f0069c2950dd7162b17e67
This commit is contained in:
Michel Weststrate
2020-10-20 03:22:15 -07:00
committed by Facebook GitHub Bot
parent f14a724fa5
commit ba5f067320
57 changed files with 108 additions and 86 deletions

View File

@@ -0,0 +1,21 @@
/**
* 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
*/
module.exports = {
rules: {
'no-restricted-imports': [
'error',
{
// These paths lead to circular import issues in Flipper app and are forbidden
paths: ['flipper'],
patterns: ['app/src/*'],
},
],
},
};