0

I'm getting this error when I try to run my linter that extends the airbnb linter (es-config-airbnb). I don't have an import/no-cycle rule here, so I'm not sure what the problem is:

Error: .eslintrc.js » eslint-config-airbnb » 
Configuration for rule "import/no-cycle" is invalid:
        Value "∞" should be integer.

Here is my .eslintrc.js file:

// https://eslint.org/docs/rules/
// https://prettier.io/docs/en/options.html

module.exports = {
  extends: ['airbnb', 'prettier'],
  parser: 'babel-eslint',
  plugins: ['prettier', 'react-hooks'],
  env: {
    browser: true,
    node: true,
    es6: true,
  },
  globals: {
    _: true,
  },
  rules: {
    'prettier/prettier': 'warn',
    'import/prefer-default-export': 'off',
    'react/jsx-filename-extension': [1, {extensions: ['.js', '.jsx']}],
    'import/no-extraneous-dependencies': 'off',
    'no-param-reassign': 'off',
    'react/jsx-curly-newline': 'off',
    'react/state-in-constructor': 'off',
    'react/static-property-placement': 'off',
    'react/jsx-props-no-spreading': 'off',
    'no-console': 'off',
    'no-undef': 'off',
    'react/destructuring-assignment': 'off',
    'react/prop-types': 'off',
    'func-names': 'off',
    'no-case-declarations': 'warn',
    'prefer-template': 'off',
    'import/no-mutable-exports': 'off',
    'prefer-destructuring': 'off',
    'no-unneeded-ternary': 'off',
    'react/forbid-prop-types': 'off',
    'react/no-array-index-key': 'off',
    'react/no-unescaped-entities': 'off',
    camelcase: 'off',
    'quote-props': ['warn', 'consistent'],
    'react/jsx-indent': 'off',
    'react/button-has-type': 'off',
    'react/jsx-one-expression-per-line': 'off',
    'react/jsx-closing-tag-location': 'off',
    'react/jsx-wrap-multilines': 'off',
    'no-shadow': 'off',
    'react/prefer-stateless-function': 'off',
    'no-useless-concat': 'off',
    'import/no-duplicates': 'off',
    'react/default-props-match-prop-types': 'off',
    'react/require-default-props': 'off',
    'no-prototype-builtins': 'off',
    'no-nested-ternary': 'off',
    'react/no-did-update-set-state': 'off',
    'no-restricted-syntax': 'off',
    'no-restricted-globals': 'off',
    'no-unused-vars': 'warn',
    'consistent-return': 'warn',
    'no-unused-expressions': 'warn',
    'react-hooks/rules-of-hooks': 'error',
    'react-hooks/exhaustive-deps': 'warn',
  },
};

And my package.json file:

{
  "name": "case-ui",
  "version": "1.0.0",
  "private": true,
  "dependencies": {
    "@date-io/moment": "^1.3.13",
    "@fortawesome/fontawesome-svg-core": "^1.2.25",
    "@fortawesome/free-solid-svg-icons": "^5.11.2",
    "@fortawesome/react-fontawesome": "^0.1.7",
    "@material-ui/core": "^4.11.2",
    "@material-ui/icons": "^4.11.2",
    "@material-ui/lab": "^4.0.0-alpha.57",
    "@material-ui/pickers": "^3.2.8",
    "@material-ui/styles": "^4.11.2",
    "@react-admin/ra-audit-log": "^2.5.2",
    "@react-admin/ra-calendar": "^1.2.0",
    "@react-admin/ra-enterprise": "^5.1.1",
    "@sentry/browser": "^6.19.6",
    "@turf/turf": "^6.5.0",
    "axios": "^0.21.1",
    "chai": "^4.2.0",
    "chart.js": "^2.9.4",
    "chartjs-plugin-datalabels": "^0.7.0",
    "date-fns": "^2.8.1",
    "dateformat": "^3.0.3",
    "dompurify": "^2.2.6",
    "idb": "^5.0.4",
    "leaflet": "1.6.0",
    "moment": "^2.24.0",
    "msal": "^1.2.1",
    "node": "^12.6.0",
    "npm": "^6.14.8",
    "prop-types": "15.7.2",
    "query-string": "^6.8.1",
    "ra-compact-ui": "^1.0.10",
    "ra-i18n-polyglot": "^3.18.0",
    "ra-input-rich-text": "^3.7.1",
    "ra-language-english": "^3.18.0",
    "ra-test": "^3.18.0",
    "react": "^16.13.0",
    "react-admin": "3.19.7",
    "react-admin-import-csv": "^1.0.28",
    "react-beautiful-dnd": "^13.0.0",
    "react-chartjs-2": "^2.9.0",
    "react-color": "^2.19.3",
    "react-compare-image": "^1.3.0",
    "react-dom": "^16.13.0",
    "react-latex": "^1.6.0",
    "react-leaflet": "^3.0.0",
    "react-number-format": "^4.4.1",
    "react-redux": "^7.1.3",
    "react-router-redux": "^4.0.8",
    "react-scripts": "^3.4.3",
    "react-scrollspy": "^3.4.3",
    "react-test-renderer": "^16.8.6",
    "react-text-transition": "^1.3.0",
    "react-timeago": "^6.2.1",
    "react-window": "^1.8.6",
    "recompose": "^0.30.0",
    "redux": "^4.0.4",
    "redux-mock-store": "^1.5.3",
    "to-semver": "^2.0.0",
    "typescript": "^3.9.9",
    "uuid": "^3.3.3"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --transformIgnorePatterns",
    "eject": "react-scripts eject",
    "lint": "./node_modules/.bin/eslint ./ | sed '/warning/d' > eslintLogs.txt; exit 0",
    "lint:fix": "./node_modules/.bin/eslint --fix ./;  exit 0",
    "prettier": "prettier --write \"**/*.+(js|jsx|json|css|md)\"; exit 0",
    "storybook": "NODE_PATH=src start-storybook -p 6006 -s public",
    "build-storybook": "build-storybook -s public"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": [
    ">0.2%",
    "not dead",
    "not op_mini all"
  ],
  "devDependencies": {
    "@storybook/addon-actions": "^6.1.21",
    "@storybook/addon-essentials": "^6.2.9",
    "@storybook/addon-links": "^6.1.21",
    "@storybook/node-logger": "^6.1.21",
    "@storybook/preset-create-react-app": "^3.1.7",
    "@storybook/react": "^6.2.1",
    "@types/jest": "^26.0.23",
    "enzyme": "^3.10.0",
    "enzyme-adapter-react-16": "^1.14.0",
    "eslint-config-airbnb": "^18.0.1",
    "eslint-config-prettier": "^6.7.0",
    "eslint-plugin-prettier": "^3.1.1",
    "eslint-plugin-react-hooks": "^2.5.0",
    "husky": "^3.1.0",
    "jest": "^27.0.4",
    "lint-staged": "^9.5.0",
    "prettier": "^1.19.1",
    "ts-jest": "^27.0.2"
  }
}

I need to add some more details, but I'm not sure what else to add.

Andy
  • 61,948
  • 13
  • 68
  • 95
maximosis
  • 89
  • 2
  • 8

1 Answers1

0

Update eslint-plugin-import to 2.22.1 and add to your config 'import/no-cycle': ['error', { maxDepth: '∞' }],

Heliodor
  • 115
  • 6