CARVIEW |
Select Language
HTTP/2 200
date: Sat, 11 Oct 2025 09:15:44 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=06395550c12fffacbaba41794c6327b4623dd80017c04378cc22a02e0c89fac9a%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22xo05Iyiqrc9K5wFZqWQzCky5kcDN9V7g%22%3B%7D; HttpOnly; Path=/
cf-ray: 98cd412f6c6fc143-BLR
import { runTests } from "@root/test-utils/eslint-rule-tester";import noString - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { runTests } from "@root/test-utils/eslint-rule-tester";
- import noStringLengthCheck from "@root/rules/no-string-length-check";
- const validCases = {
- valid: [
- {
- code: "const foo = bar ? bar : baz;",
- },
- {
- code: "const foo = bar ?? baz;",
- },
- {
- code: "if (str) { console.log('not empty'); }",
- },
- {
- code: "const result = str ? 'has value' : 'empty';",
- },
- {
- code: "const hasValue = !!str;",
- },
- {
- code: "const len = str.length;",
- },
- {
- code: "console.log(str.length);",
- },
- {
- code: "const result = str.length + 5;",
- },
- {
- code: "for (let i = 0; i < str.length; i++) { }",
- },
- {
- code: "const arr = [1, 2, 3]; if (arr.length) { console.log('has elements'); }",
- },
- {
- code: "const arr = new Array(3); if (arr.length) { console.log('has elements'); }",
- },
- ],
- };
- const invalidCases = {
- invalid: [
- {
- code: "if (str.length) { console.log('not empty'); }",
- errors: [{ messageId: "noStringLength" }],
- },
- {
- code: "if (str.length === 0) { console.log('empty'); }",
- errors: [{ messageId: "noStringLength" }],
- },
- {
- code: "if (str.length !== 0) { console.log('not empty'); }",
- errors: [{ messageId: "noStringLength" }],
- },
- {
- code: "if (str.length == 0) { console.log('empty'); }",
- errors: [{ messageId: "noStringLength" }],
- },
- {
- code: "if (str.length != 0) { console.log('not empty'); }",
- errors: [{ messageId: "noStringLength" }],
- },
- {
- code: "if (str.length > 0) { console.log('not empty'); }",
- errors: [{ messageId: "noStringLength" }],
- },
- {
- code: "if (str.length < 1) { console.log('empty'); }",
- errors: [{ messageId: "noStringLength" }],
- },
- {
- code: "if (str.length >= 1) { console.log('not empty'); }",
- errors: [{ messageId: "noStringLength" }],
- },
- {
- code: "const result = str.length ? 'has value' : 'empty';",
- errors: [{ messageId: "noStringLength" }],
- },
- {
- code: "const hasValue = !!str.length;",
- errors: [{ messageId: "noStringLength" }],
- },
- {
- code: "return str.length;",
- errors: [{ messageId: "noStringLength" }],
- },
- {
- code: "while (str.length) { break; }",
- errors: [{ messageId: "noStringLength" }],
- },
- {
- code: "do { break; } while (str.length);",
- errors: [{ messageId: "noStringLength" }],
- },
- ],
- };
- const testCases = [validCases, invalidCases];
- runTests("no-string-length-check", noStringLengthCheck, testCases);
Advertisement
Add Comment
Please, Sign In to add comment
-
⭐✅ Exploit 2500$ in 15 Minutes⭐⭐⭐ 1
JavaScript | 5 sec ago | 0.24 KB
-
⭐✅ Marketplace Glitch ✅ Working ✅ NEVER SEEN...
JavaScript | 6 sec ago | 0.24 KB
-
⭐⭐⭐Crypto Accounts⭐⭐
Java | 11 sec ago | 0.10 KB
-
✅⭐ Make $2500 in 15 minutes ✅ NEVER SEEN BEFO...
JavaScript | 15 sec ago | 0.24 KB
-
Free Crypto Method (NEVER SEEN BEFORE)⭐⭐ X
JavaScript | 16 sec ago | 0.24 KB
-
⭐⭐⭐Crypto Accounts⭐⭐
Java | 23 sec ago | 0.10 KB
-
⭐✅ Swapzone Glitch ✅ Working⭐⭐⭐ P
JavaScript | 27 sec ago | 0.24 KB
-
⭐⭐⭐ G2A Payment Exploit ✅ NEVER SEEN BEFORE ⭐...
JavaScript | 28 sec ago | 0.24 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand