Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions configs/eslint-config-compass/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
"@babel/eslint-parser": "^7.14.3",
"@mongodb-js/eslint-config-devtools": "^0.9.9",
"@mongodb-js/eslint-plugin-compass": "^1.2.17",
"@typescript-eslint/eslint-plugin": "^8.43.0",
"@typescript-eslint/parser": "^8.43.0",
"@typescript-eslint/eslint-plugin": "^8.46.2",
"@typescript-eslint/parser": "^8.46.2",
"eslint": "^8.57.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-chai-friendly": "^1.1.0",
"eslint-plugin-filename-rules": "^1.2.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-mocha": "^8.0.0",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^5.2.0"
"eslint-plugin-react-hooks": "^7.0.1"
},
"scripts": {
"prettier": "prettier-compass",
Expand Down
7 changes: 7 additions & 0 deletions configs/testing-library-compass/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,12 @@ function createWrapper(
const StoreGetter: React.FunctionComponent = ({ children }) => {
const store = useStore();
const actions = useConnectionActions();
// We're breaking the rules of hooks on purpose here to expose the values
// outside of the render
/* eslint-disable react-hooks/immutability */
wrapperState.connectionsStore.getState = store.getState.bind(store);
wrapperState.connectionsStore.actions = actions;
/* eslint-enable react-hooks/immutability */
return <>{children}</>;
};
const logger = {
Expand Down Expand Up @@ -599,6 +603,9 @@ function createPluginWrapper<
) {
const ref: { current: PluginContext } = { current: {} as any };
function ComponentWithProvider({ children, ...props }: any) {
// We're breaking the rules of hooks on purpose here to expose the ref
// outside of the render
// eslint-disable-next-line react-hooks/immutability
const plugin = (ref.current = Plugin.useActivate(
initialPluginProps ?? ({} as any)
));
Expand Down
Loading
Loading