]>
Commit | Line | Data |
---|---|---|
eb39fafa DC |
1 | /** |
2 | * @fileoverview Test rule to flag if the filename is missing; | |
3 | * @author Stefan Lau | |
4 | */ | |
5 | ||
8f9d1d4d DC |
6 | "use strict"; |
7 | ||
eb39fafa DC |
8 | //------------------------------------------------------------------------------ |
9 | // Rule Definition | |
10 | //------------------------------------------------------------------------------ | |
11 | ||
8f9d1d4d DC |
12 | module.exports = { |
13 | meta: { | |
14 | type: "problem", | |
15 | schema: [] | |
16 | }, | |
17 | create(context) { | |
18 | return { | |
19 | "Program": function(node) { | |
f2a92ac6 | 20 | if (context.filename === '<input>') { |
8f9d1d4d DC |
21 | context.report(node, "Filename test was not defined."); |
22 | } | |
eb39fafa | 23 | } |
8f9d1d4d DC |
24 | }; |
25 | } | |
eb39fafa | 26 | }; |