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 not working after updating eslint-config-next to v12.1.1 #35606
Comments
having the same problem (but only the import plugin). i think it happens because they pinned a specific version in 12.1.1. 12.1.0:
12.1.1:
and another config i use uses i fixed it for now by using following in the package.json (you may also add the
maybe nextjs should revert their change back to |
I fixed mine by reverting to |
Having error with StaticImage type as well |
@tal-rofe would like to elobrate the problem or maybe file another issue for that? wanna to make sure if there some details we might miss, thank you |
@huozhi Then fortunately my Github Actions alerts these upgrades would break my code. So I started investigating why it happened, by upgrading manually both packages to After manually upgrade And of course it works fine w/o upgrading. |
is don't think this has anything to do with this issue. this should be a separate issue. |
Same to me. I updated all packages for nextjs@12.1.1 last night but the package eslint-config-next@12.1.1 does not work. eslint-config-next@12.1.0 does still work with the attached config! {
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"next/core-web-vitals",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:storybook/recommended",
"airbnb",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
"mui-unused-classes",
"react",
"prettier",
"import"
],
"ignorePatterns": [
"node_modules/**"
],
"rules": {
"prettier/prettier": "error",
"no-unused-vars": "warn",
"no-undef": "off",
"no-console": "off",
"no-underscore-dangle": "off",
"no-nested-ternary": "off",
"func-names": "off",
"no-process-exit": "off",
"object-shorthand": "off",
"class-methods-use-this": "off",
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": "off",
"no-param-reassign": ["error", { "props": false }],
"react/react-in-jsx-scope": "off",
"react/jsx-filename-extension": [
1,
{
"extensions": [
".jsx",
".tsx"
]
}
],
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"import/no-unresolved": "off",
"import/extensions": "off"
},
"overrides": [
{
"files": [
"*.js",
"*.jsx"
]
},
{
"files": [
"*.ts",
"*.tsx"
],
"rules": {
// explicit should be "error"
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/explicit-function-return-type": "off"
}
}
],
"settings": {
"import/resolver": null
}
} |
Same problem here, |
Hi, this has been fixed in the latest version of Next.js |
For me update to 12.1.2 does work again Thanks |
We are now seeing this problem, but it looks like the {
"scripts": {
"lint": "our-scripts lint",
},
"devDependencies": {
"@ourstuff/our-scripts": "^9.3.0",
// projects do not install any eslint libraries directly
},
"eslintConfig": {
"extends": "./node_modules/@ourstuff/our-scripts/lib/config/eslintrc.js"
},
} The {
"dependencies": {
"eslint": "^8.9.0",
"eslint-config-next": "^12.1.0",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
},
} It appears the recent |
This is still broken because of #34823 @robertwbradford you should have your team change |
@ijjk thx for trying to fix it. but please reopen as the issue isnt fixed. i'm using a setup like @robertwbradford and the fix dosn't work for me either. |
@wuifdesign can you provide a link to a repo with a minimal reproduction where you are seeing this not working with the latest version? The initial reproduction is working and is added as a test case here https://github.com/vercel/next.js/blob/canary/test/production/eslint-plugin-deps/index.test.ts |
@ijjk sure i can. i use a separate repo for my eslint config. i think it is the same setup as robertwbradford used. i made a quick example with minimal setup: just try to run |
@tm1000 Thanks for the reply. We had considered something like this but had a couple other considerations preventing this:
We also have Not sure what to do at this point. I was able to see the same error from wulfdesign's latest comment. |
Yes my team does the same thing. Keeping them as PeerDeps doesn't cause issues there and in newer versions of npm it will auto install PeerDeps anyways (if they dont exist somewhere else). In our eslint library we dont have next as a plugin.
We also have prettier in ours and doing it this way doesn't cause an issue. There's still an issue though. Not negating that, as we had to remove the conflicting next eslint plugins from our root package.json in our nextjs project. @wuifdesign is a good demo of this |
any updates on this? or should i open a new issue? |
Any update on when this is being fixed? |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
What browser are you using? (if relevant)
Safari Version 15.4 (17613.1.17.1.6)
How are you deploying your application? (if relevant)
Vercel
Describe the Bug
ESLint doesn't work after updating
eslint-config-next
to version 12.1.1. I assume it's because you locked the dependencies #34823, but I also use theeslint-plugin-import
.Before I realized it's from the
eslint-config-next
package, I removed the rules in my config files that used theimport
plugin then the error wasHere is my ESLint config file
Expected Behavior
For ESLint to catch and report errors in my files
To Reproduce
Use the config I provided above
Create a JS or TS file with a semicolon or quotes error
Run ESLint
The text was updated successfully, but these errors were encountered: