emotion-js / emotion

šŸ‘©ā€šŸŽ¤ CSS-in-JS library designed for high performance style composition
https://emotion.sh/
MIT License
17.5k stars 1.11k forks source link

Eslint problem after upgrading to Next v11.1.2 #2486

Open tiavina-mika opened 3 years ago

tiavina-mika commented 3 years ago

I do not know if the bug is related to Emotion or not, but these following eslint configuration working since I upgraded Next.js to the latest v11.1.2. The next lint --fix --dir src does not fix the code anymore.

.babelrc

.babelrc

{
  "presets": [
    [
      "next/babel",
      {
        "preset-react": {
          "runtime": "automatic",
          "importSource": "@emotion/react"
        }
      }
    ]
  ],
  "plugins": ["@emotion/babel-plugin"]
}

package.json

  "scripts": {
    "lint": "next lint --fix --dir src",
  },
  "dependencies": {
    "@ant-design/icons": "^4.6.4",
    "@emotion/css": "^11.1.3",
    "@emotion/react": "^11.4.0",
    "@emotion/styled": "^11.3.0",
    "next": "^11.1.2",
  },
  "devDependencies": {
    "@emotion/babel-plugin": "^11.3.0",
    "eslint": "^7.31.0",
    "eslint-config-airbnb": "^18.2.1",
    "eslint-config-next": "^11.1.2",
    "eslint-config-prettier": "^8.3.0",
    "eslint-plugin-import": "^2.23.4",
    "eslint-plugin-jsx-a11y": "^6.4.1",
    "eslint-plugin-prefer-arrow": "^1.2.3",
  }

eslint.json

{
  "extends": ["airbnb", "next"],
  "plugins": [
    "prefer-arrow"
  ],
  ...
}
Andarist commented 3 years ago

Please always try to share a repro case in a runnable form - either by providing a git repository to clone or a codesandbox. OSS maintainers usually can't afford the time to set up the repro, even if exact steps are given.