⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.1
Server IP:
185.238.29.86
Server:
Linux server2 6.8.12-6-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-6 (2024-12-19T19:05Z) x86_64
Server Software:
nginx/1.18.0
PHP Version:
8.1.31
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
var
/
www
/
invoice
/
node_modules
/
eslint
/
lib
/
rules
/
View File Name :
no-tabs.js
/** * @fileoverview Rule to check for tabs inside a file * @author Gyandeep Singh */ "use strict"; //------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ const tabRegex = /\t+/gu; const anyNonWhitespaceRegex = /\S/u; //------------------------------------------------------------------------------ // Public Interface //------------------------------------------------------------------------------ module.exports = { meta: { type: "layout", docs: { description: "disallow all tabs", category: "Stylistic Issues", recommended: false, url: "https://eslint.org/docs/rules/no-tabs" }, schema: [{ type: "object", properties: { allowIndentationTabs: { type: "boolean", default: false } }, additionalProperties: false }], messages: { unexpectedTab: "Unexpected tab character." } }, create(context) { const sourceCode = context.getSourceCode(); const allowIndentationTabs = context.options && context.options[0] && context.options[0].allowIndentationTabs; return { Program(node) { sourceCode.getLines().forEach((line, index) => { let match; while ((match = tabRegex.exec(line)) !== null) { if (allowIndentationTabs && !anyNonWhitespaceRegex.test(line.slice(0, match.index))) { continue; } context.report({ node, loc: { start: { line: index + 1, column: match.index }, end: { line: index + 1, column: match.index + match[0].length } }, messageId: "unexpectedTab" }); } }); } }; } };