Giter Site home page Giter Site logo

Comments (10)

tillig avatar tillig commented on June 3, 2024 2

Yup, also verified. Thanks!

from eslint-plugin-mocha.

MikeMcC399 avatar MikeMcC399 commented on June 3, 2024 2

@mcat95

  • It's good that you spotted this issue and reported it! I've submitted it as a new open issue #354.

from eslint-plugin-mocha.

lo1tuma avatar lo1tuma commented on June 3, 2024 1

I’ve cherry-picked the changes from #347 and made a patch release v10.4.2. Unfortunately I forgot to make a release after merging #347 to main and now main contains a few breaking changes which are planned for v11.

Please let me know if v10.4.2 fixes the issues with ESLint v9.

from eslint-plugin-mocha.

MikeMcC399 avatar MikeMcC399 commented on June 3, 2024 1

@lo1tuma

Please let me know if v10.4.2 fixes the issues with ESLint v9.

I tested with [email protected] and my errors were gone. I also checked for backwards compatibility with [email protected] and I saw no issue.

Many thanks!

from eslint-plugin-mocha.

lo1tuma avatar lo1tuma commented on June 3, 2024 1

@MikeMcC399 thanks for confirming... in this case I will close this issue.

from eslint-plugin-mocha.

MikeMcC399 avatar MikeMcC399 commented on June 3, 2024

This issue relates to the blog Preparing your custom rules for ESLint v9.0.0 published on Sep 26, 2023

Good to see that there is already a merged PR for this as Eslint v9 was announced released on Apr 5, 2024.

from eslint-plugin-mocha.

lo1tuma avatar lo1tuma commented on June 3, 2024

Thanks for reporting. I will take a look into it and try to make a patch release ASAP.

from eslint-plugin-mocha.

mcat95 avatar mcat95 commented on June 3, 2024

Hello,

I believe the 10.4.2 patch broke compatibility with eslint versions prior to 8 (We get the error on 7.32.0):
TypeError: Cannot read properties of undefined (reading 'getScope')

from eslint-plugin-mocha.

MikeMcC399 avatar MikeMcC399 commented on June 3, 2024

@mcat95

I believe the 10.4.2 patch broke compatibility with eslint versions prior to 8 (We get the error on 7.32.0): TypeError: Cannot read properties of undefined (reading 'getScope')

Ouch!

It sounds like this needs to be a new issue leading to a new fix release.

The example in https://eslint.org/blog/2023/09/preparing-custom-rules-eslint-v9/#context.getscope() shows supporting both the deprecated API and the new API. If only the new API has been implemented, then it would break compatibility with anything below ESLint v8.37.0 🤭

module.exports = {
    create(context) {

        const { sourceCode } = context;

        return {
            Program(node) {
                const scope = sourceCode.getScope
                    ? sourceCode.getScope(node)
                    : context.getScope();

                // do something with scope
            }
        }
    }
};

from eslint-plugin-mocha.

MikeMcC399 avatar MikeMcC399 commented on June 3, 2024

@mcat95

This was fixed in 10.4.3.

from eslint-plugin-mocha.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.