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_LEGACY_OBJECT_REST_SPREAD] #1888

Closed
kmaitski opened this issue Aug 17, 2018 · 4 comments
Closed

[ESLINT_LEGACY_OBJECT_REST_SPREAD] #1888

kmaitski opened this issue Aug 17, 2018 · 4 comments

Comments

@kmaitski
Copy link

kmaitski commented Aug 17, 2018

Hey I was following #1834 since I was getting the same warning. I have since upgraded to the latest airbnb config and eslint hoping that it would solve the issue for me, but I am still getting the same message. I have run the peer deps install command for eslint-config-airbnb. When I run npm ls I get what looks like a huge dependency tree/graph. My .eslintrc is inside of my package.json and looks like this:

"eslintConfig":{  
        "parser": "babel-eslint",  
        "plugins": [  
            "react"  
        ],  
        "rules": {  
            "import/extensions": "off",  
            "import/no-unresolved": "off"  
        },  
        "extends": [  
            "airbnb-base",  
            "plugin:react/recommended"  
        ],  
        "env": {  
            "browser": true  
        }  
    }

And my dev dependencies are:

        "eslint": "^5.3.0",  
        "eslint-config-airbnb": "^17.1.0",  
        "eslint-config-airbnb-base": "^13.1.0",  
        "eslint-loader": "^2.1.0",  
        "eslint-plugin-import": "^2.14.0",  
        "eslint-plugin-jsx-a11y": "^6.1.1",  
        "eslint-plugin-react": "^7.11.1"

And the warning message is: (node:2750) [ESLINT_LEGACY_OBJECT_REST_SPREAD] DeprecationWarning: The 'parserOptions.ecmaFeatures.experimentalObjectRestSpread' option is deprecated. Use 'parserOptions.ecmaVersion' instead. (found in "airbnb-base")

If anyone has any information I would be very appreciative.

@ljharb
Copy link
Collaborator

ljharb commented Aug 17, 2018

if you look in node_modules/eslint-config-airbnb-base/package.json, what is the version listed?

Separately, why are you extending airbnb-base and react, when you have the main "airbnb" config available?

Try changing your config to this:

"eslintConfig": { 
        "extends": [  
            "airbnb"
        ],
        "parser": "babel-eslint",
        "rules": {  
            "import/extensions": "off",  // these should really be on, though
            "import/no-unresolved": "off"  
        },
        "env": {  
            "browser": true  
        }  
    }

@kmaitski
Copy link
Author

kmaitski commented Aug 17, 2018

After that change this is the new output:
(node:3070) [ESLINT_LEGACY_OBJECT_REST_SPREAD] DeprecationWarning: The 'parserOptions.ecmaFeatures.experimentalObjectRestSpread' option is deprecated. Use 'parserOptions.ecmaVersion' instead. (found in "../../../../usr/local/lib/node_modules/eslint-config-airbnb/node_modules/eslint-config-airbnb-base/index.js") (node:3070) [ESLINT_LEGACY_OBJECT_REST_SPREAD] DeprecationWarning: The 'parserOptions.ecmaFeatures.experimentalObjectRestSpread' option is deprecated. Use 'parserOptions.ecmaVersion' instead. (found in "airbnb-base")

@ljharb
Copy link
Collaborator

ljharb commented Aug 17, 2018

ahhh that looks like you've got those installed globally. Run npm uninstall -g eslint, and make sure you're running the local eslint.

@kmaitski
Copy link
Author

Awesome thank you so much! It is working as it should now. Thanks again!

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

2 participants