@taiga-ui/eslint-plugin-experience-next 0.281.0 → 0.283.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.esm.js +221 -242
  2. package/package.json +11 -11
package/index.esm.js CHANGED
@@ -1060,6 +1060,7 @@ var recommended = tseslint.config(progress.configs['recommended-ci'], require('e
1060
1060
  * Expected to be running in 'ProxyZone', but it was not found
1061
1061
  */
1062
1062
  'jest/valid-title': 'error',
1063
+ 'jest/prefer-ending-with-an-expect': 'off',
1063
1064
  'jest/prefer-importing-jest-globals': 'off',
1064
1065
  'jest/prefer-lowercase-title': ['error', {
1065
1066
  allowedPrefixes: ['Tui', 'NaN', 'UTC', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
@@ -1269,273 +1270,251 @@ function projectJsonExist(filename) {
1269
1270
  }
1270
1271
  }
1271
1272
 
1272
- var balancedMatch = balanced$1;
1273
- function balanced$1(a, b, str) {
1274
- if (a instanceof RegExp) a = maybeMatch(a, str);
1275
- if (b instanceof RegExp) b = maybeMatch(b, str);
1276
-
1277
- var r = range(a, b, str);
1278
-
1279
- return r && {
1280
- start: r[0],
1281
- end: r[1],
1282
- pre: str.slice(0, r[0]),
1283
- body: str.slice(r[0] + a.length, r[1]),
1284
- post: str.slice(r[1] + b.length)
1285
- };
1286
- }
1287
-
1288
- function maybeMatch(reg, str) {
1289
- var m = str.match(reg);
1290
- return m ? m[0] : null;
1291
- }
1292
-
1293
- balanced$1.range = range;
1294
- function range(a, b, str) {
1295
- var begs, beg, left, right, result;
1296
- var ai = str.indexOf(a);
1297
- var bi = str.indexOf(b, ai + 1);
1298
- var i = ai;
1299
-
1300
- if (ai >= 0 && bi > 0) {
1301
- if(a===b) {
1302
- return [ai, bi];
1303
- }
1304
- begs = [];
1305
- left = str.length;
1306
-
1307
- while (i >= 0 && !result) {
1308
- if (i == ai) {
1309
- begs.push(i);
1310
- ai = str.indexOf(a, i + 1);
1311
- } else if (begs.length == 1) {
1312
- result = [ begs.pop(), bi ];
1313
- } else {
1314
- beg = begs.pop();
1315
- if (beg < left) {
1316
- left = beg;
1317
- right = bi;
1273
+ const balanced = (a, b, str) => {
1274
+ const ma = a instanceof RegExp ? maybeMatch(a, str) : a;
1275
+ const mb = b instanceof RegExp ? maybeMatch(b, str) : b;
1276
+ const r = ma !== null && mb != null && range(ma, mb, str);
1277
+ return (r && {
1278
+ start: r[0],
1279
+ end: r[1],
1280
+ pre: str.slice(0, r[0]),
1281
+ body: str.slice(r[0] + ma.length, r[1]),
1282
+ post: str.slice(r[1] + mb.length),
1283
+ });
1284
+ };
1285
+ const maybeMatch = (reg, str) => {
1286
+ const m = str.match(reg);
1287
+ return m ? m[0] : null;
1288
+ };
1289
+ const range = (a, b, str) => {
1290
+ let begs, beg, left, right = undefined, result;
1291
+ let ai = str.indexOf(a);
1292
+ let bi = str.indexOf(b, ai + 1);
1293
+ let i = ai;
1294
+ if (ai >= 0 && bi > 0) {
1295
+ if (a === b) {
1296
+ return [ai, bi];
1297
+ }
1298
+ begs = [];
1299
+ left = str.length;
1300
+ while (i >= 0 && !result) {
1301
+ if (i === ai) {
1302
+ begs.push(i);
1303
+ ai = str.indexOf(a, i + 1);
1304
+ }
1305
+ else if (begs.length === 1) {
1306
+ const r = begs.pop();
1307
+ if (r !== undefined)
1308
+ result = [r, bi];
1309
+ }
1310
+ else {
1311
+ beg = begs.pop();
1312
+ if (beg !== undefined && beg < left) {
1313
+ left = beg;
1314
+ right = bi;
1315
+ }
1316
+ bi = str.indexOf(b, i + 1);
1317
+ }
1318
+ i = ai < bi && ai >= 0 ? ai : bi;
1319
+ }
1320
+ if (begs.length && right !== undefined) {
1321
+ result = [left, right];
1318
1322
  }
1319
-
1320
- bi = str.indexOf(b, i + 1);
1321
- }
1322
-
1323
- i = ai < bi && ai >= 0 ? ai : bi;
1324
- }
1325
-
1326
- if (begs.length) {
1327
- result = [ left, right ];
1328
1323
  }
1329
- }
1330
-
1331
- return result;
1332
- }
1333
-
1334
- var balanced = balancedMatch;
1335
-
1336
- var braceExpansion = expandTop;
1337
-
1338
- var escSlash = '\0SLASH'+Math.random()+'\0';
1339
- var escOpen = '\0OPEN'+Math.random()+'\0';
1340
- var escClose = '\0CLOSE'+Math.random()+'\0';
1341
- var escComma = '\0COMMA'+Math.random()+'\0';
1342
- var escPeriod = '\0PERIOD'+Math.random()+'\0';
1324
+ return result;
1325
+ };
1343
1326
 
1327
+ const escSlash = '\0SLASH' + Math.random() + '\0';
1328
+ const escOpen = '\0OPEN' + Math.random() + '\0';
1329
+ const escClose = '\0CLOSE' + Math.random() + '\0';
1330
+ const escComma = '\0COMMA' + Math.random() + '\0';
1331
+ const escPeriod = '\0PERIOD' + Math.random() + '\0';
1332
+ const escSlashPattern = new RegExp(escSlash, 'g');
1333
+ const escOpenPattern = new RegExp(escOpen, 'g');
1334
+ const escClosePattern = new RegExp(escClose, 'g');
1335
+ const escCommaPattern = new RegExp(escComma, 'g');
1336
+ const escPeriodPattern = new RegExp(escPeriod, 'g');
1337
+ const slashPattern = /\\\\/g;
1338
+ const openPattern = /\\{/g;
1339
+ const closePattern = /\\}/g;
1340
+ const commaPattern = /\\,/g;
1341
+ const periodPattern = /\\./g;
1344
1342
  function numeric(str) {
1345
- return parseInt(str, 10) == str
1346
- ? parseInt(str, 10)
1347
- : str.charCodeAt(0);
1343
+ return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);
1348
1344
  }
1349
-
1350
1345
  function escapeBraces(str) {
1351
- return str.split('\\\\').join(escSlash)
1352
- .split('\\{').join(escOpen)
1353
- .split('\\}').join(escClose)
1354
- .split('\\,').join(escComma)
1355
- .split('\\.').join(escPeriod);
1346
+ return str
1347
+ .replace(slashPattern, escSlash)
1348
+ .replace(openPattern, escOpen)
1349
+ .replace(closePattern, escClose)
1350
+ .replace(commaPattern, escComma)
1351
+ .replace(periodPattern, escPeriod);
1356
1352
  }
1357
-
1358
1353
  function unescapeBraces(str) {
1359
- return str.split(escSlash).join('\\')
1360
- .split(escOpen).join('{')
1361
- .split(escClose).join('}')
1362
- .split(escComma).join(',')
1363
- .split(escPeriod).join('.');
1354
+ return str
1355
+ .replace(escSlashPattern, '\\')
1356
+ .replace(escOpenPattern, '{')
1357
+ .replace(escClosePattern, '}')
1358
+ .replace(escCommaPattern, ',')
1359
+ .replace(escPeriodPattern, '.');
1364
1360
  }
1365
-
1366
-
1367
- // Basically just str.split(","), but handling cases
1368
- // where we have nested braced sections, which should be
1369
- // treated as individual members, like {a,{b,c},d}
1361
+ /**
1362
+ * Basically just str.split(","), but handling cases
1363
+ * where we have nested braced sections, which should be
1364
+ * treated as individual members, like {a,{b,c},d}
1365
+ */
1370
1366
  function parseCommaParts(str) {
1371
- if (!str)
1372
- return [''];
1373
-
1374
- var parts = [];
1375
- var m = balanced('{', '}', str);
1376
-
1377
- if (!m)
1378
- return str.split(',');
1379
-
1380
- var pre = m.pre;
1381
- var body = m.body;
1382
- var post = m.post;
1383
- var p = pre.split(',');
1384
-
1385
- p[p.length-1] += '{' + body + '}';
1386
- var postParts = parseCommaParts(post);
1387
- if (post.length) {
1388
- p[p.length-1] += postParts.shift();
1389
- p.push.apply(p, postParts);
1390
- }
1391
-
1392
- parts.push.apply(parts, p);
1393
-
1394
- return parts;
1367
+ if (!str) {
1368
+ return [''];
1369
+ }
1370
+ const parts = [];
1371
+ const m = balanced('{', '}', str);
1372
+ if (!m) {
1373
+ return str.split(',');
1374
+ }
1375
+ const { pre, body, post } = m;
1376
+ const p = pre.split(',');
1377
+ p[p.length - 1] += '{' + body + '}';
1378
+ const postParts = parseCommaParts(post);
1379
+ if (post.length) {
1380
+ p[p.length - 1] += postParts.shift();
1381
+ p.push.apply(p, postParts);
1382
+ }
1383
+ parts.push.apply(parts, p);
1384
+ return parts;
1395
1385
  }
1396
-
1397
- function expandTop(str) {
1398
- if (!str)
1399
- return [];
1400
-
1401
- // I don't know why Bash 4.3 does this, but it does.
1402
- // Anything starting with {} will have the first two bytes preserved
1403
- // but *only* at the top level, so {},a}b will not expand to anything,
1404
- // but a{},b}c will be expanded to [a}c,abc].
1405
- // One could argue that this is a bug in Bash, but since the goal of
1406
- // this module is to match Bash's rules, we escape a leading {}
1407
- if (str.substr(0, 2) === '{}') {
1408
- str = '\\{\\}' + str.substr(2);
1409
- }
1410
-
1411
- return expand(escapeBraces(str), true).map(unescapeBraces);
1386
+ function expand(str) {
1387
+ if (!str) {
1388
+ return [];
1389
+ }
1390
+ // I don't know why Bash 4.3 does this, but it does.
1391
+ // Anything starting with {} will have the first two bytes preserved
1392
+ // but *only* at the top level, so {},a}b will not expand to anything,
1393
+ // but a{},b}c will be expanded to [a}c,abc].
1394
+ // One could argue that this is a bug in Bash, but since the goal of
1395
+ // this module is to match Bash's rules, we escape a leading {}
1396
+ if (str.slice(0, 2) === '{}') {
1397
+ str = '\\{\\}' + str.slice(2);
1398
+ }
1399
+ return expand_(escapeBraces(str), true).map(unescapeBraces);
1412
1400
  }
1413
-
1414
1401
  function embrace(str) {
1415
- return '{' + str + '}';
1402
+ return '{' + str + '}';
1416
1403
  }
1417
1404
  function isPadded(el) {
1418
- return /^-?0\d/.test(el);
1405
+ return /^-?0\d/.test(el);
1419
1406
  }
1420
-
1421
1407
  function lte(i, y) {
1422
- return i <= y;
1408
+ return i <= y;
1423
1409
  }
1424
1410
  function gte(i, y) {
1425
- return i >= y;
1411
+ return i >= y;
1426
1412
  }
1427
-
1428
- function expand(str, isTop) {
1429
- var expansions = [];
1430
-
1431
- var m = balanced('{', '}', str);
1432
- if (!m) return [str];
1433
-
1434
- // no need to expand pre, since it is guaranteed to be free of brace-sets
1435
- var pre = m.pre;
1436
- var post = m.post.length
1437
- ? expand(m.post, false)
1438
- : [''];
1439
-
1440
- if (/\$$/.test(m.pre)) {
1441
- for (var k = 0; k < post.length; k++) {
1442
- var expansion = pre+ '{' + m.body + '}' + post[k];
1443
- expansions.push(expansion);
1444
- }
1445
- } else {
1446
- var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
1447
- var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
1448
- var isSequence = isNumericSequence || isAlphaSequence;
1449
- var isOptions = m.body.indexOf(',') >= 0;
1450
- if (!isSequence && !isOptions) {
1451
- // {a},b}
1452
- if (m.post.match(/,.*\}/)) {
1453
- str = m.pre + '{' + m.body + escClose + m.post;
1454
- return expand(str);
1455
- }
1456
- return [str];
1457
- }
1458
-
1459
- var n;
1460
- if (isSequence) {
1461
- n = m.body.split(/\.\./);
1462
- } else {
1463
- n = parseCommaParts(m.body);
1464
- if (n.length === 1) {
1465
- // x{{a,b}}y ==> x{a}y x{b}y
1466
- n = expand(n[0], false).map(embrace);
1467
- if (n.length === 1) {
1468
- return post.map(function(p) {
1469
- return m.pre + n[0] + p;
1470
- });
1413
+ function expand_(str, isTop) {
1414
+ /** @type {string[]} */
1415
+ const expansions = [];
1416
+ const m = balanced('{', '}', str);
1417
+ if (!m)
1418
+ return [str];
1419
+ // no need to expand pre, since it is guaranteed to be free of brace-sets
1420
+ const pre = m.pre;
1421
+ const post = m.post.length ? expand_(m.post, false) : [''];
1422
+ if (/\$$/.test(m.pre)) {
1423
+ for (let k = 0; k < post.length; k++) {
1424
+ const expansion = pre + '{' + m.body + '}' + post[k];
1425
+ expansions.push(expansion);
1426
+ }
1427
+ }
1428
+ else {
1429
+ const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
1430
+ const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
1431
+ const isSequence = isNumericSequence || isAlphaSequence;
1432
+ const isOptions = m.body.indexOf(',') >= 0;
1433
+ if (!isSequence && !isOptions) {
1434
+ // {a},b}
1435
+ if (m.post.match(/,(?!,).*\}/)) {
1436
+ str = m.pre + '{' + m.body + escClose + m.post;
1437
+ return expand_(str);
1438
+ }
1439
+ return [str];
1471
1440
  }
1472
- }
1473
- }
1474
-
1475
- // at this point, n is the parts, and we know it's not a comma set
1476
- // with a single entry.
1477
- var N;
1478
-
1479
- if (isSequence) {
1480
- var x = numeric(n[0]);
1481
- var y = numeric(n[1]);
1482
- var width = Math.max(n[0].length, n[1].length);
1483
- var incr = n.length == 3
1484
- ? Math.abs(numeric(n[2]))
1485
- : 1;
1486
- var test = lte;
1487
- var reverse = y < x;
1488
- if (reverse) {
1489
- incr *= -1;
1490
- test = gte;
1491
- }
1492
- var pad = n.some(isPadded);
1493
-
1494
- N = [];
1495
-
1496
- for (var i = x; test(i, y); i += incr) {
1497
- var c;
1498
- if (isAlphaSequence) {
1499
- c = String.fromCharCode(i);
1500
- if (c === '\\')
1501
- c = '';
1502
- } else {
1503
- c = String(i);
1504
- if (pad) {
1505
- var need = width - c.length;
1506
- if (need > 0) {
1507
- var z = new Array(need + 1).join('0');
1508
- if (i < 0)
1509
- c = '-' + z + c.slice(1);
1510
- else
1511
- c = z + c;
1441
+ let n;
1442
+ if (isSequence) {
1443
+ n = m.body.split(/\.\./);
1444
+ }
1445
+ else {
1446
+ n = parseCommaParts(m.body);
1447
+ if (n.length === 1 && n[0] !== undefined) {
1448
+ // x{{a,b}}y ==> x{a}y x{b}y
1449
+ n = expand_(n[0], false).map(embrace);
1450
+ //XXX is this necessary? Can't seem to hit it in tests.
1451
+ /* c8 ignore start */
1452
+ if (n.length === 1) {
1453
+ return post.map(p => m.pre + n[0] + p);
1454
+ }
1455
+ /* c8 ignore stop */
1456
+ }
1457
+ }
1458
+ // at this point, n is the parts, and we know it's not a comma set
1459
+ // with a single entry.
1460
+ let N;
1461
+ if (isSequence && n[0] !== undefined && n[1] !== undefined) {
1462
+ const x = numeric(n[0]);
1463
+ const y = numeric(n[1]);
1464
+ const width = Math.max(n[0].length, n[1].length);
1465
+ let incr = n.length === 3 && n[2] !== undefined ? Math.abs(numeric(n[2])) : 1;
1466
+ let test = lte;
1467
+ const reverse = y < x;
1468
+ if (reverse) {
1469
+ incr *= -1;
1470
+ test = gte;
1471
+ }
1472
+ const pad = n.some(isPadded);
1473
+ N = [];
1474
+ for (let i = x; test(i, y); i += incr) {
1475
+ let c;
1476
+ if (isAlphaSequence) {
1477
+ c = String.fromCharCode(i);
1478
+ if (c === '\\') {
1479
+ c = '';
1480
+ }
1481
+ }
1482
+ else {
1483
+ c = String(i);
1484
+ if (pad) {
1485
+ const need = width - c.length;
1486
+ if (need > 0) {
1487
+ const z = new Array(need + 1).join('0');
1488
+ if (i < 0) {
1489
+ c = '-' + z + c.slice(1);
1490
+ }
1491
+ else {
1492
+ c = z + c;
1493
+ }
1494
+ }
1495
+ }
1496
+ }
1497
+ N.push(c);
1498
+ }
1499
+ }
1500
+ else {
1501
+ N = [];
1502
+ for (let j = 0; j < n.length; j++) {
1503
+ N.push.apply(N, expand_(n[j], false));
1504
+ }
1505
+ }
1506
+ for (let j = 0; j < N.length; j++) {
1507
+ for (let k = 0; k < post.length; k++) {
1508
+ const expansion = pre + N[j] + post[k];
1509
+ if (!isTop || isSequence || expansion) {
1510
+ expansions.push(expansion);
1511
+ }
1512
1512
  }
1513
- }
1514
1513
  }
1515
- N.push(c);
1516
- }
1517
- } else {
1518
- N = [];
1519
-
1520
- for (var j = 0; j < n.length; j++) {
1521
- N.push.apply(N, expand(n[j], false));
1522
- }
1523
- }
1524
-
1525
- for (var j = 0; j < N.length; j++) {
1526
- for (var k = 0; k < post.length; k++) {
1527
- var expansion = pre + N[j] + post[k];
1528
- if (!isTop || isSequence || expansion)
1529
- expansions.push(expansion);
1530
- }
1531
1514
  }
1532
- }
1533
-
1534
- return expansions;
1515
+ return expansions;
1535
1516
  }
1536
1517
 
1537
- var expand$1 = /*@__PURE__*/getDefaultExportFromCjs(braceExpansion);
1538
-
1539
1518
  const MAX_PATTERN_LENGTH = 1024 * 64;
1540
1519
  const assertValidPattern = (pattern) => {
1541
1520
  if (typeof pattern !== 'string') {
@@ -2463,7 +2442,7 @@ const braceExpand = (pattern, options = {}) => {
2463
2442
  // shortcut. no need to expand.
2464
2443
  return [pattern];
2465
2444
  }
2466
- return expand$1(pattern);
2445
+ return expand(pattern);
2467
2446
  };
2468
2447
  minimatch.braceExpand = braceExpand;
2469
2448
  // parse a component of the expanded set.
package/package.json CHANGED
@@ -1,24 +1,24 @@
1
1
  {
2
2
  "name": "@taiga-ui/eslint-plugin-experience-next",
3
- "version": "0.281.0",
3
+ "version": "0.283.0",
4
4
  "description": "An ESLint plugin to enforce a consistent code styles across taiga-ui projects",
5
5
  "license": "Apache-2.0",
6
6
  "main": "index.ts",
7
7
  "peerDependencies": {
8
- "@eslint/compat": ">=1.2.9",
9
- "@smarttools/eslint-plugin-rxjs": ">=1.0.19",
10
- "@stylistic/eslint-plugin": ">=4.4.0",
11
- "@stylistic/eslint-plugin-ts": ">=4.4.0",
12
- "@typescript-eslint/eslint-plugin": ">=8.33.0",
13
- "angular-eslint": ">=19.6.0",
8
+ "@eslint/compat": ">=1.3.0",
9
+ "@smarttools/eslint-plugin-rxjs": ">=1.0.20",
10
+ "@stylistic/eslint-plugin": ">=4.4.1",
11
+ "@stylistic/eslint-plugin-ts": ">=4.4.1",
12
+ "@typescript-eslint/eslint-plugin": ">=8.33.1",
13
+ "angular-eslint": ">=19.8.0",
14
14
  "eslint": ">=9.28.0",
15
15
  "eslint-config-prettier": ">=10.1.5",
16
- "eslint-plugin-de-morgan": ">=1.2.1",
16
+ "eslint-plugin-de-morgan": ">=1.3.0",
17
17
  "eslint-plugin-decorator-position": ">=6.0.0",
18
18
  "eslint-plugin-file-progress": ">=3.0.2",
19
19
  "eslint-plugin-import": ">=2.31.0",
20
- "eslint-plugin-jest": ">=28.12.0",
21
- "eslint-plugin-perfectionist": ">=4.13.0",
20
+ "eslint-plugin-jest": ">=28.13.5",
21
+ "eslint-plugin-perfectionist": ">=4.14.0",
22
22
  "eslint-plugin-playwright": ">=2.2.0",
23
23
  "eslint-plugin-prettier": ">=5.4.1",
24
24
  "eslint-plugin-promise": ">=7.2.1",
@@ -27,7 +27,7 @@
27
27
  "eslint-plugin-unicorn": ">=59.0.1",
28
28
  "eslint-plugin-unused-imports": ">=4.1.4",
29
29
  "globals": ">=16.2.0",
30
- "typescript-eslint": ">=8.33.0"
30
+ "typescript-eslint": ">=8.34.0"
31
31
  },
32
32
  "publishConfig": {
33
33
  "access": "public"