Q: How do I configure eslint rules to ignore react-hooks/exhaustive-deps globally? I have a react component with a useEffect hook that looks like this:
const LocationEditor: React.FC<SectionEditorProps> = (props) => {
const [section, setSection] = useState({...(props.section as Location)});
useEffect(() => {
    props.onChange(section);
}, [section]);

I'm getting this warning when I run the project:
React Hook useEffect has a missing dependency: 'props'. Either include it or remove the dependency array. However, 'props' will change when *any* prop changes, so the preferred fix is to destructure the 'props' object outside of the useEffect call and refer to those specific props inside useEffect  react-hooks/exhaustive-deps

So I tried changing the component to look like this, destructuring props:
const LocationEditor: React.FC<SectionEditorProps> = ({section, onClickCancel, onClickSave, onChange}) => {
    const [tmpSection, setSection] = useState({...(section as Location)});
    useEffect(() => {
        onChange(tmpSection);      
    }, [tmpSection]);

If I add this comment before the dependency array, I can make the warning go away:
// eslint-disable-next-line react-hooks/exhaustive-deps

However, when I add the block below to eslintConfig in package.json it doesn't seem to do anything:
{
  "plugins": [
    "react-hooks"
  ],
  "rules": {
    "react-hooks/rules-of-hooks": "error",
    "react-hooks/exhaustive-deps": "off"
  }
}

I see some people talking about using the .eslinrc file, but I thought you could also configure rules globally in package.json and I can't find that file in my project.
Is there something I'm missing here?

A: Usually you don't want to disable the rule. However, there are  few cases where it's worthwhile to disable it.
For example, if you're doing a fetch on mount and you're sure it never has to execute again, you can disable it with the code below.
Be sure the rule is wrong first though. Try to figure out if the rule is right or now, many times I thought it was wrong but it was pointing to a possible bug I didn't notice.
// eslint-disable-next-line react-hooks/exhaustive-deps

You can also disable the rule globally, although that's not advised.
