mirror of
https://github.com/10h30/odin-javascript-exercises.git
synced 2026-07-17 05:33:21 +09:00
remove timer and simon
This commit is contained in:
+47
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* @fileoverview Rule to check for tabs inside a file
|
||||
* @author Gyandeep Singh
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Helpers
|
||||
//------------------------------------------------------------------------------
|
||||
const regex = /\t/;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Public Interface
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
module.exports = {
|
||||
meta: {
|
||||
docs: {
|
||||
description: "disallow all tabs",
|
||||
category: "Stylistic Issues",
|
||||
recommended: false
|
||||
},
|
||||
schema: []
|
||||
},
|
||||
|
||||
create(context) {
|
||||
return {
|
||||
Program(node) {
|
||||
context.getSourceCode().getLines().forEach((line, index) => {
|
||||
const match = regex.exec(line);
|
||||
|
||||
if (match) {
|
||||
context.report({
|
||||
node,
|
||||
loc: {
|
||||
line: index + 1,
|
||||
column: match.index + 1
|
||||
},
|
||||
message: "Unexpected tab character."
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user