Announcing eslint-plugin-meteor-error

Hey, one of our team members created an excellent package! eslint-meteor-error, from @vitorsouzaalmeida
It was made while we were updating our code base, and we wanted to be sure that we always called Meteor.Error instead of the default one(Error).

Stay tuned because he will be making a blog post about how to write an eslint plugin.

His announcement on X(Formerly Twitter) and the repo


Please give a try and let us know what you think about this!

11 Likes

I find it very difficult to create and maintain an eslint plugin without test cases.

4 Likes

@grubba does it support Error classes that extend Meteor.Error ?

Hi!
Yes, the lib support extends Meteor.Error.

You can do something like this:

class SomeError extends Meteor.Error {
    constructor(message) {
      super('validation-error', message);
    }
}

But your message gave me an idea that is not implemented yet, checking if the Error extends from the Error class

class SomeError extends Error{}

I’ll create an issue, work on tests (cc @rjdavid ), and improve the class scenarios.

7 Likes

@jkuester https://twitter.com/vitorsalmeida_/status/1768092246945988984

2 Likes

Hi!
I implemented new test cases

2 Likes

Great. It’s easier to check the tests to figure out the different cases handled by the plugin

3 Likes