I just created a brand new Meteor project to setup eslint and see how it works - zero custom configurations or packages. Pretty much just running eslint on a ground zero Meteor app.
I’m using this: GitHub - airbnb/javascript: JavaScript Style Guide
npm install --save-dev eslint-config-airbnb eslint-plugin-react eslint
// in .eslintrc
{
"extends": "airbnb",
"rules": {
// disable requiring trailing commas because it might be nice to revert to
// being JSON at some point, and I don't want to make big changes now.
"comma-dangle": 0
}
}
I’m getting a lot of not defined
errors for the Meteor classes and objects, such as:
if (Meteor.isClient) {
// counter starts at 0
Session.setDefault('counter', 0);
Template.hello.helpers({
counter: function () {
return Session.get('counter');
}
});
Template.hello.events({
'click button': function () {
// increment the counter when button is clicked
Session.set('counter', Session.get('counter') + 1);
}
});
}
if (Meteor.isServer) {
Meteor.startup(function () {
// code to run on server at startup
});
}
Any ideas on how to fix this issue? I would prefer to start using a linter to keep my code similar and tidy.