Skip to content
This repository has been archived by the owner on Jan 19, 2019. It is now read-only.

Commit

Permalink
Fix: no-triple-slash-reference (fixes #75)
Browse files Browse the repository at this point in the history
  • Loading branch information
mightyiam authored and JamesHenry committed Nov 23, 2017
1 parent 485254b commit 45cd23e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rules/no-triple-slash-reference.js
Expand Up @@ -35,9 +35,9 @@ module.exports = {
* @private
*/
function checkTripleSlashReference(program) {
const leading = sourceCode.getComments(program).leading;
const commentsBefore = sourceCode.getCommentsBefore(program);

leading.forEach(comment => {
commentsBefore.forEach(comment => {
if (comment.type !== "Line") {
return;
}
Expand Down
14 changes: 14 additions & 0 deletions tests/lib/rules/no-triple-slash-reference.js
Expand Up @@ -39,6 +39,20 @@ ruleTester.run("no-triple-slash-reference", rule, {
column: 1
}
]
},
{
code: `
/// <reference path="Animal" />
let a
`,
parser: "typescript-eslint-parser",
errors: [
{
message: "Do not use a triple slash reference",
line: 2,
column: 1
}
]
}
]
});

0 comments on commit 45cd23e

Please sign in to comment.