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

Latest version not compatible with old ESLint config #54

Open
GorvGoyl opened this issue Nov 21, 2024 · 13 comments
Open

Latest version not compatible with old ESLint config #54

GorvGoyl opened this issue Nov 21, 2024 · 13 comments

Comments

@GorvGoyl
Copy link

I've encountered an issue where the latest version of this plugin is not compatible with older ESLint configurations. Many ESLint plugins are not yet compatible with the new ESLint config, which prevents me from upgrading ESLint to the latest version. I'm sure this is a common issue for many other developers as well.

Would it be possible to make the latest version of this plugin backward compatible with older ESLint configurations?

@dai-shi
Copy link
Member

dai-shi commented Nov 21, 2024

@barelyhuman Can you help?

@GorvGoyl I think we need your help too.

@barelyhuman
Copy link
Collaborator

Is there a specific error that's being thrown or is it not linting at all?

I tried to keep the old scope helper but if that's not working then i know what's the issue, though it did work in the setups i tried the changes on

@GorvGoyl
Copy link
Author

GorvGoyl commented Nov 21, 2024

sure, here are the logs:

> tsc --noEmit && eslint --ext .tsx,.ts ./ 


Oops! Something went wrong! :(

ESLint: 8.57.0

TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'Object'
    |     property 'valtio' -> object with constructor 'Object'
    |     property 'configs' -> object with constructor 'Object'
    |     property 'recommended' -> object with constructor 'Object'
    --- property 'plugins' closes the circle
Referenced from: /Users/gogo/Documents/github/chatgpt-writer-ext/.eslintrc.json
    at JSON.stringify (<anonymous>)
    at /Users/gogo/Documents/github/chatgpt-writer-ext/node_modules/.pnpm/@[email protected]/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2156:45
    at Array.map (<anonymous>)
    at ConfigValidator.formatErrors (/Users/gogo/Documents/github/chatgpt-writer-ext/node_modules/.pnpm/@[email protected]/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2147:23)
    at ConfigValidator.validateConfigSchema (/Users/gogo/Documents/github/chatgpt-writer-ext/node_modules/.pnpm/@[email protected]/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2177:84)
    at ConfigArrayFactory._normalizeConfigData (/Users/gogo/Documents/github/chatgpt-writer-ext/node_modules/.pnpm/@[email protected]/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3019:19)
    at ConfigArrayFactory._loadExtendedPluginConfig (/Users/gogo/Documents/github/chatgpt-writer-ext/node_modules/.pnpm/@[email protected]/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3239:25)
    at ConfigArrayFactory._loadExtends (/Users/gogo/Documents/github/chatgpt-writer-ext/node_modules/.pnpm/@[email protected]/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3154:29)
    at ConfigArrayFactory._normalizeObjectConfigDataBody (/Users/gogo/Documents/github/chatgpt-writer-ext/node_modules/.pnpm/@[email protected]/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3095:25)
    at _normalizeObjectConfigDataBody.next (<anonymous>)
 ELIFECYCLE  Command failed with exit code 2.
 ELIFECYCLE  Command failed with exit code 2.
 ELIFECYCLE  Command failed with exit code 2.

eslint:

{
    "env": {
        "browser": true,
        "es2021": true
    },
    "overrides": [
        {
            "files": ["**/*.cjs"],
            "env": {
                "node": true
            }
        }
    ],
    "extends": [
        "eslint:recommended",
        "plugin:react/recommended",
        "plugin:@typescript-eslint/strict-type-checked",
        "plugin:react-hooks/recommended",
        "plugin:promise/recommended",
        "plugin:valtio/recommended",
        "plugin:react/jsx-runtime",
        "plugin:jsx-a11y/recommended",
        "plugin:regexp/recommended"
    ],
    "parser": "@typescript-eslint/parser",
    "parserOptions": {
        "projectService": true,
        "ecmaFeatures": {
            "jsx": true
        },
        "ecmaVersion": "latest",
        "sourceType": "module"
    },
    "plugins": ["react", "@typescript-eslint", "promise", "restricted-scripting", "jsx-a11y", "regexp"],
    "settings": {
        "react": {
            "version": "detect"
        }
    },
  
}

@barelyhuman
Copy link
Collaborator

Oh, the compat for export broke with the built asset.

Should be an easy fix, give me a few

@barelyhuman
Copy link
Collaborator

Since Codesandbox builds aren't working, can you try the following package for testing instead?

npm add @bhincubator/eslint-plugin-valtio@latest

@GorvGoyl
Copy link
Author

i tried but couldn't make it work "plugin:@bhincubator/valtio/recommended"

ESLint: 8.57.0

ESLint couldn't find the plugin "eslint-plugin-valtio".

(The package "eslint-plugin-valtio" was not found when loaded as a Node module from the directory "/Users/gogo/Documents/github/chatgpt-writer-ext".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

    npm install eslint-plugin-valtio@latest --save-dev

The plugin "eslint-plugin-valtio" was referenced from the config file in ".eslintrc.json » plugin:@bhincubator/valtio/recommended".

@barelyhuman
Copy link
Collaborator

That’s there right… i’ll just make a pr tagged release in the morning, you can use that

@barelyhuman
Copy link
Collaborator

Don't mind the delay

npm add eslint-plugin-valtio@pr-54

should be usable as a package right now

@barelyhuman
Copy link
Collaborator

@GorvGoyl did you get time to try it out?

@GorvGoyl
Copy link
Author

GorvGoyl commented Dec 4, 2024

I tried the latest version but faced the same error
screenshot 2024-12-04 at 14 23 31@2x

@barelyhuman
Copy link
Collaborator

not the latest version but the tag i’ve put in the previous comment, the PR release

@GorvGoyl
Copy link
Author

GorvGoyl commented Dec 4, 2024

Ah, I missed that comment. Yes, it's building fine.

@barelyhuman
Copy link
Collaborator

Cool, will update the release and docs accordingly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants