最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

react native - How to run ESLint on Expo with pnpm? - Stack Overflow

programmeradmin1浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论