Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESLINT_MODES is undefined #483

Closed
mhenke96 opened this issue Dec 21, 2022 · 2 comments
Closed

ESLINT_MODES is undefined #483

mhenke96 opened this issue Dec 21, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@mhenke96
Copy link

What's happening
I want to set a custom eslint file according to the receipt, but @craco/craco does not export ESLINT_MODES.

What should happen
@craco/craco should export ESLINT_MODES and therefore allow a custom eslint file.

To reproduce
Try to import ESLINT_MODES from @craco/craco anywhere. It's clearly not exported in the index.ts. Furthermore, it just appears in the documentation when searching the entire repository: https://github.com/dilanx/craco/search?q=ESLINT_MODES

CRACO version
7.0.0

CRACO config

const { ESLINT_MODES } = require('@craco/craco');

module.exports = {
  eslint: {
    mode: ESLINT_MODES.file,
  },
};

package.json

{
  "module": "false",
  "scripts": {
    "dev": "craco start",
    "build": "craco build",
    "test": "craco test",
  },
  "dependencies": {
  },
  "devDependencies": {
    "@babel/core": "7.20.5",
    "@babel/eslint-parser": "^7.17.0",
    "@babel/preset-env": "^7.16.11",
    "@babel/preset-react": "^7.16.7",
    "@commitlint/cli": "17.3.0",
    "@commitlint/config-conventional": "17.3.0",
    "@craco/craco": "7.0.0",
    "@testing-library/dom": "^8.17.1",
    "@testing-library/jest-dom": "^5.15.0",
    "@testing-library/react": "^13.0.0",
    "@testing-library/user-event": "^14.0.0",
    "eslint": "^8.30.0",
    "eslint-config-airbnb": "^19.0.0",
    "eslint-config-prettier": "^8.5.0",
    "eslint-plugin-import": "^2.25.3",
    "eslint-plugin-jsx-a11y": "^6.5.1",
    "eslint-plugin-prettier": "^4.0.0",
    "eslint-plugin-react": "7.31.11",
    "eslint-plugin-react-hooks": "^4.6.0",
    "eslint-plugin-sonarjs": "^0.17.0",
    "eslint-plugin-testing-library": "^5.0.0",
    "husky": "^8.0.1",
    "prettier": "2.8.1",
    "serve": "14.1.2",
    "source-map-loader": "^4.0.1"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

Additional information
None

@mhenke96 mhenke96 added the bug Something isn't working label Dec 21, 2022
@dilanx
Copy link
Owner

dilanx commented Dec 21, 2022

Thanks for the catch. Since CRACO 7, ESLINT_MODES does not exist, and the config property should be set to either 'extends' or 'file' (as a string, see the TS interface here). The documentation does not accurately reflect that so I'll fix that soon. Sorry!

To solve your issue, just set mode to 'file'.

I'll close this issue once the docs are updated.

@dilanx
Copy link
Owner

dilanx commented Dec 21, 2022

The docs that still included references to ESLINT_MODES have been updated!

@dilanx dilanx closed this as completed Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants