Skip to content

Commit

Permalink
Add eslint rule
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavithra Kodmad authored and Pavithra Kodmad committed Nov 8, 2021
1 parent 90183a3 commit 11f64f1
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,25 @@
"allow": ["dark_dimmed"]
}
],
"no-restricted-imports": [
"error",
{
"name": "react",
"importNames": ["useLayoutEffect"],
"message":
"`useLayoutEffect` causes a warning in SSR. Use `useIsomorphicLayoutEffect`"
}
],
"no-restricted-syntax": [
"error",
// Ensure import from '*use-isomorphic-layout-effect' is `useLayoutEffect` to leverage `eslint-plugin-react-hooks`
{
"selector":
"ImportDeclaration[source.value=/use-isomorphic-layout-effect/] > ImportDefaultSpecifier[local.name!='useLayoutEffect']",
"message":
"Must use `useLayoutEffect` as the name of the import from `*use-isomorphic-layout-effect` to leverage `eslint-plugin-react-hooks`"
}
],
"primer-react/no-deprecated-colors": ["warn", {"checkAllStrings": true}]
},
"overrides": [
Expand Down

0 comments on commit 11f64f1

Please sign in to comment.