Skip to content

Commit

Permalink
Merge pull request #6 from quavedev/5-issue-linting-meteor-collection…
Browse files Browse the repository at this point in the history
…-hooks

#5 issue linting meteor collection hooks
  • Loading branch information
filipenevola authored Feb 20, 2024
2 parents 4772df3 + ec288e6 commit 05667aa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions lib/rules/no-sync-mongo-methods-on-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,14 @@ module.exports = {
return;
}
}
if(node.object.type === 'MemberExpression'){
// we can ignore longer than 1 call chain
debug(
`Skipping ${invalidFunction} to be considered error because it was used in a longer than 1 call chain`,
{ object: node.object }
);
return;
}
createError({
context,
node,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@quave/eslint-plugin-meteor-quave",
"version": "1.4.0",
"version": "1.4.1",
"description": "Quave linting rules for ESLint",
"main": "lib/index.js",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions tests/lib/rules/no-sync-mongo-methods-on-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ ruleTester.run('no-sync-mongo-methods-on-server', rule, {
only: true,
valid: [
{ code: 'TestCollection.findOneAsync()' },
{ code: 'UserAccess.after.insert((userId, doc) => {})' },
{
code: `
var modulesCursor = ModulesCollection.find();
Expand Down

0 comments on commit 05667aa

Please sign in to comment.