Commit Graph

59 Commits

Author SHA1 Message Date
Dominik Ferber
faefe6c5d1 refactor: rename rules
The previous names were confusing, long and partially redundant.
The new names are:
- blaze-consistent-eventmap-params -> eventmap-params
- no-blaze-lifecycle-assignment -> no-template-lifecycle-assignments
- template-naming-convention -> template-names

BREAKING CHANGE: Rule names have changed.
2016-03-09 18:38:23 +01:00
Dominik Ferber
0eff690446 fix: do not force jsx parser in recommended configuration
BREAKING CHANGE: ecmaFeatures (jsx) has been removed from the ESLint parser options.
2016-03-09 18:18:31 +01:00
Dominik Ferber
9ebb7a0ce7 refactor: use es6 modules consistently 2016-03-09 17:36:58 +01:00
Dominik Ferber
c4609546c7 test(rules): add more tests to achieve higher code coverage 2016-03-08 18:26:35 +01:00
Dominik Ferber
12036a2d71 feat(rule): add rule template-naming-convention
closes #22
2016-03-08 13:44:34 +01:00
Dominik Ferber
a06d2db784 feat(rules): add rule prefer-session-equals
closes #118
2016-03-07 17:56:26 +01:00
Dominik Ferber
20a04cb88d test: bring code coverage thersholds down
Temporarily bring code coverage thresholds down, until https://github.com/babel/babel-jest/issues/27
is resolved.
2016-03-02 16:21:22 +01:00
Dominik Ferber
a58304d203 style: adapt airbnb code style 2016-03-02 14:46:48 +01:00
Dominik Ferber
c818fb07d5 feat(rules): remove a ton of rules
This further gets rid of all environment checks, keeping it simple

no longer support environments
2016-03-02 13:52:20 +01:00
Dominik Ferber
d3c0cca004 fix(internal): Remove console statement 2015-10-29 18:34:23 +01:00
Dominik Ferber
24a5f2f66c feat(integration): Add support for SublimeLinter
SublimeLinter passes relative paths through context.getFilename(). Support that as well.

closes #49
2015-10-29 18:29:39 +01:00
Dominik Ferber
d191e97b6b refactor(internal): Use named function expressions 2015-10-29 17:37:28 +01:00
Dominik Ferber
be73ffa031 feat(blaze-consistent-eventmap-params): Add rule
closes #12, #33
2015-10-28 21:24:07 +01:00
Dominik Ferber
8d44769f06 feat(session): Add rule
#3
2015-10-25 15:10:58 +01:00
Dominik Ferber
cf3ae223e3 fix(rules): Do not access properties on unresolved vars 2015-10-23 12:17:20 +02:00
Dominik Ferber
659ec630bf fix(collections): Allow declaration of collection 2015-10-21 21:32:09 +02:00
Dominik Ferber
19cbbe6353 feat(collections): Add rule
#3
2015-10-21 21:26:57 +02:00
Dominik Ferber
06453dec49 Merge branch 'master' into collections 2015-10-21 19:53:35 +02:00
Dominik Ferber
0908b6c7b7 feat(globals): Enable setting collection globals through settings
Settings can now be used to tell the linter about collections. It marks them as globals for now. In
the future such variables will be linted in special ways by the rule collections, which does not
exist yet.
2015-10-21 17:46:03 +02:00
Dominik Ferber
addc889052 fix(methods): Restirct warnings on NewExpressions to Meteor.Error
Previously the rule would warn on all NewExpressions with no arguments.
2015-10-20 23:15:34 +02:00
Dominik Ferber
c263c74786 feat(connections): Add rule
Add rule for connections. Part of Meteor core API.

#3
2015-10-20 21:05:55 +02:00
Dominik Ferber
aab1a14483 feat(check): Add rule
Add rule for check and Match.

#3
2015-10-18 22:40:13 +02:00
Dominik Ferber
ff5af1f7ff fix(rules): Ignore locus checks with unkown expressions
Instead of aborting when finding an if-statement with unkown statements in the ancestors of any
node, ignore that if-statement. This way the linter will cover more code. Assumes the code never
mixes locus checks with other expressions.
2015-10-18 19:53:54 +02:00
Dominik Ferber
1a1f29e477 feat(methods): Add rules for methods
This also refactors common functionality with pubsub into utility files.

#3
2015-10-18 19:27:42 +02:00
Dominik Ferber
be1e298b87 fix(pubsub): New strategy for determining context
The previous approach was flawed when the publish handler object was accessed from within an
if-block. This commit adds a more sophisticated approach.
2015-10-18 16:50:38 +02:00
Dominik Ferber
7bcbeea82e fix(pubsub): Remove publish handler object from Arrow Functions
Arrow functions can not access the publish handler object. Do not warn in them.
2015-10-18 00:44:19 +02:00
Dominik Ferber
bbf9f22109 refactor(): Determine env only once per file
Also fixes a bug in audit-argument-checks where it would show errors in non-meteor blocks.

BREAKING CHANGE: Envs specified through comments are now restricted to client and server.
2015-10-17 23:28:42 +02:00
Dominik Ferber
e46a8131f4 refactor(internal): Remove isLintedEnv
Check through executors instead.
2015-10-17 18:44:12 +02:00
Dominik Ferber
82cdf24479 fix(globals): Set globals in envs other than client and server 2015-10-17 17:24:49 +02:00
Dominik Ferber
350d06933d fix(rules): Disable linting in Non-Meteor environments 2015-10-17 15:40:57 +02:00
Dominik Ferber
0cafe3b87c refactor(internal): Remove isobuild from executors
isobuild can be determined based on the env. No need to have it as an executor.
2015-10-17 15:22:57 +02:00
Dominik Ferber
e426e2cae3 feat(rules): Add inline configuration for Meteor environments
Environments can now be configured inline. Enables linting files in packages.

closes #36
2015-10-17 14:45:58 +02:00
Dominik Ferber
03e9c7c520 feat(pubsub): Lint Meteor API in publication context
The callback of a publication receives Meteor API through the context. This API is now linted.

#3
2015-10-16 08:34:35 +02:00
Dominik Ferber
a35e4a4d15 perf(rules): Use else-if cases
Also renames functions in pubsub
2015-10-15 21:09:58 +02:00
Dominik Ferber
4d3b6d3253 perf(internal): Add memoization for getMeta
closes #32
2015-10-14 21:04:34 +02:00
Dominik Ferber
cafe187e83 feat(rule): Add rule: globals
This rule defines Meteor globals. It works in conjunction with ESLints no-undef.

closes #16
2015-10-14 20:50:24 +02:00
Dominik Ferber
0b9622dedd fix(internal): Add locus resloving capabilities
Resolve all Meteor.isClient, Meteor.isServer and Meteor.isCordova LogicalExpressions
2015-10-13 18:42:31 +02:00
Dominik Ferber
0519621776 fix(internal): Correctly ignore files outside of Meteor projects
#31
2015-10-12 19:25:09 +02:00
Dominik Ferber
2b01583e7f refactor(): Use let and const instead of var
Add rule no-var to configuration of project
2015-10-10 09:54:14 +02:00
Dominik Ferber
6551c2567e fix(rule): support arrow function without BlockStatement in audit-argument-checks
Add support for a very raw case which would not make sense in any application.
2015-10-09 17:52:34 +02:00
Dominik Ferber
b14cbd82a4 feat(rule): Add core rule
Prevent misuse of the Meteor core API
2015-10-06 21:46:00 +02:00
Dominik Ferber
5032f13eab fix(rule): accept arrow functions in audit-argument-checks 2015-10-06 21:01:39 +02:00
Dominik Ferber
bb1f7222e1 refactor(internal): Export utility functions from a single module 2015-10-06 20:33:06 +02:00
Dominik Ferber
bec69bfb05 refactor(internal): Change meta properties
Introduce more environments instead of additional properties.
2015-10-06 19:36:53 +02:00
Dominik Ferber
47c0555823 refactor(rules): Use utility functions in rules 2015-10-06 16:53:46 +02:00
Dominik Ferber
4438a2b74d fix(rule): Add subscribe argument count validation
Also adds docs.
2015-10-04 23:32:06 +02:00
Dominik Ferber
6aa1b63429 feat(rules): Add pubsub rule
Prevent misuse of Meteor API related to Publications and Subscriptions.
2015-10-04 23:23:49 +02:00
Dominik Ferber
650d61efd7 refactor(internal): Detect project based on filename instead of process.cwd
Detection of the Meteor project through process.cwd() fails when used in Atom Editor. Use filename i
2015-10-04 19:41:47 +02:00
Dominik Ferber
5531375b3a fix(internal): Use lodash.find instead of Array.prototype.find
Not every environment will support Array.prototype.find. Use the lodash version.
2015-10-02 09:24:05 +02:00
Dominik Ferber
740f3cfc07 refactor(): Add isPackageConfig and isMobileConfig to environment information
Rules can now read whether the file is a package config or mobile config file from the fileInfo.
2015-10-02 00:23:10 +02:00