How do I get this to run? I'm coding a React Native TS app with Expo and pnpm, but I don't seem to be able to run ESLint.
I'm trying to run pnpx expo lint
, it installs ESLint but doesn't run. I get this error:
> expo lint
> pnpm eslint .
Oops! Something went wrong! :(
ESLint: 8.57.1
ReferenceError: Cannot read config file: D:\Desktop\root\projects\coding\budget-app\.eslintrc.js
Error: module is not defined
[...]
The .eslintrc.js
is the following:
// /guides/using-eslint/
module.exports = {
extends: 'expo',
ignorePatterns: ['/dist/*'],
env: {
browser: false,
es2021: false,
node: true,
},
};
The only related problem I've found while researching was .eslintrc.js 'module' is not defined. I've tried every answer but I couldn't solve my problem.
If I change the config to a .json
, it seems to work, but why it does not work as a .js
?
I've also tried to use "export default" instead of "module.exports", no good.