Permalink
Browse files

Added sample custom ruleset (dummy) for rulesets

  • Loading branch information...
1 parent 9dbbf4a commit ab6875464b6185d748dcdd4e4c89ef4de1ef62dc Marcel Duran committed Jun 22, 2012
Showing with 31 additions and 0 deletions.
  1. +31 −0 src/common/rulesets/sample.js
@@ -0,0 +1,31 @@
+/**
+ * Custom ruleset must be placed in this directory as rulseset_name.js
+ *
+ * Here is a very simplified snippet for registering a new rules and ruleset:
+ *
+ * YSLOW.registerRule({
+ * id: 'foo-rule1',
+ * name: 'Sample Test #1',
+ * info: 'How simple is that?',
+ *
+ * lint: function (doc, cset, config) {
+ * return {
+ * score: 90,
+ * message: 'close but no cigar',
+ * components: ['element1']
+ * };
+ * }
+ * });
+ *
+ * YSLOW.registerRuleset({
+ * id: 'foo',
+ * name: 'Foobar Ruleset',
+ * rules: {
+ * 'foo-rule1': {}
+ * },
+ * weights: {
+ * 'foo-rule1': 3
+ * }
+ * });
+ *
+ */

0 comments on commit ab68754

Please sign in to comment.