How to set .eslintrc to recognize 'require'?

后端 未结 4 1668
孤独总比滥情好
孤独总比滥情好 2021-02-02 05:02

I am new to ESLint, and I have successfully integrated ESLint with IntelliJ.

Out of the box, my integration of ESLint did not recognize node, but basic revi

4条回答
  •  Happy的楠姐
    2021-02-02 05:34

    The problem is not with ESLint. If you look closely at your message, it says JSHint.

    Since you're trying to configure ESLint, simplest solution would be to disable or remove JSHint plugin form your IDE.

    If you still want to use JSHint along with ESLint, you can do the following:

    Single file solution: add /* global require */ at the top of your file.

    General solution for all files: add "node": true line to your .jshintrc.

提交回复
热议问题