@taiga-ui/eslint-plugin-experience-next 0.484.0 → 0.485.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.
- package/index.esm.js +47 -20
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -1304,6 +1304,7 @@ var recommended = defineConfig([
|
|
|
1304
1304
|
extends: [playwright.configs['flat/recommended']],
|
|
1305
1305
|
rules: {
|
|
1306
1306
|
'@taiga-ui/experience-next/no-playwright-empty-fill': 'error',
|
|
1307
|
+
'@taiga-ui/experience-next/no-restricted-attr-values': 'off',
|
|
1307
1308
|
'compat/compat': 'off',
|
|
1308
1309
|
'jest/prefer-importing-jest-globals': 'off',
|
|
1309
1310
|
'playwright/consistent-spacing-between-blocks': 'error',
|
|
@@ -1342,6 +1343,7 @@ var recommended = defineConfig([
|
|
|
1342
1343
|
files: ['**/*.spec.ts'],
|
|
1343
1344
|
extends: [jest.configs['flat/recommended']],
|
|
1344
1345
|
rules: {
|
|
1346
|
+
'@taiga-ui/experience-next/no-restricted-attr-values': 'off',
|
|
1345
1347
|
'@typescript-eslint/no-extraneous-class': 'off',
|
|
1346
1348
|
'compat/compat': 'off',
|
|
1347
1349
|
'jest/expect-expect': 'off',
|
|
@@ -1429,6 +1431,7 @@ var recommended = defineConfig([
|
|
|
1429
1431
|
files: ['**/*.cy.ts'],
|
|
1430
1432
|
plugins: { cypress },
|
|
1431
1433
|
rules: {
|
|
1434
|
+
'@taiga-ui/experience-next/no-restricted-attr-values': 'off',
|
|
1432
1435
|
'compat/compat': 'off',
|
|
1433
1436
|
'cypress/no-unnecessary-waiting': 'off',
|
|
1434
1437
|
'cypress/unsafe-to-chain-command': 'off',
|
|
@@ -1509,7 +1512,7 @@ var taigaSpecific = defineConfig([
|
|
|
1509
1512
|
},
|
|
1510
1513
|
},
|
|
1511
1514
|
{
|
|
1512
|
-
files: ['**/demo/**/*.html'
|
|
1515
|
+
files: ['**/demo/**/*.html'],
|
|
1513
1516
|
rules: { '@taiga-ui/experience-next/no-restricted-attr-values': 'off' },
|
|
1514
1517
|
},
|
|
1515
1518
|
{
|
|
@@ -251894,25 +251897,42 @@ const rule$e = createRule({
|
|
|
251894
251897
|
if (!valueSpan) {
|
|
251895
251898
|
continue;
|
|
251896
251899
|
}
|
|
251897
|
-
|
|
251900
|
+
let openQuoteOffset = valueSpan.start.offset - 1;
|
|
251901
|
+
while (openQuoteOffset >= 0 &&
|
|
251902
|
+
(sourceText[openQuoteOffset] === ' ' ||
|
|
251903
|
+
sourceText[openQuoteOffset] === '\n' ||
|
|
251904
|
+
sourceText[openQuoteOffset] === '\r' ||
|
|
251905
|
+
sourceText[openQuoteOffset] === '\t')) {
|
|
251906
|
+
openQuoteOffset--;
|
|
251907
|
+
}
|
|
251908
|
+
const openingQuote = sourceText[openQuoteOffset];
|
|
251909
|
+
const isQuotedAttribute = openingQuote === SINGLE_QUOTE ||
|
|
251910
|
+
openingQuote === DOUBLE_QUOTE;
|
|
251911
|
+
let closeQuoteOffset = valueSpan.end.offset;
|
|
251912
|
+
if (isQuotedAttribute) {
|
|
251913
|
+
while (closeQuoteOffset < sourceText.length &&
|
|
251914
|
+
(sourceText[closeQuoteOffset] === ' ' ||
|
|
251915
|
+
sourceText[closeQuoteOffset] === '\n' ||
|
|
251916
|
+
sourceText[closeQuoteOffset] === '\r' ||
|
|
251917
|
+
sourceText[closeQuoteOffset] === '\t')) {
|
|
251918
|
+
closeQuoteOffset++;
|
|
251919
|
+
}
|
|
251920
|
+
}
|
|
251921
|
+
const closingQuote = sourceText[closeQuoteOffset];
|
|
251922
|
+
const hasMatchingQuotes = isQuotedAttribute && openingQuote === closingQuote;
|
|
251923
|
+
const rawValue = hasMatchingQuotes
|
|
251924
|
+
? sourceText.slice(openQuoteOffset + 1, closeQuoteOffset)
|
|
251925
|
+
: sourceText.slice(valueSpan.start.offset, valueSpan.end.offset);
|
|
251898
251926
|
if (rawValue.includes(EXPECTED_QUOTE)) {
|
|
251899
251927
|
continue;
|
|
251900
251928
|
}
|
|
251901
|
-
const openingQuote = sourceText[valueSpan.start.offset - 1];
|
|
251902
|
-
const closingQuote = sourceText[valueSpan.end.offset];
|
|
251903
|
-
const hasMatchingQuotes = (openingQuote === SINGLE_QUOTE ||
|
|
251904
|
-
openingQuote === DOUBLE_QUOTE) &&
|
|
251905
|
-
openingQuote === closingQuote;
|
|
251906
251929
|
if (hasMatchingQuotes && openingQuote !== EXPECTED_QUOTE) {
|
|
251907
251930
|
context.report({
|
|
251908
251931
|
data: {
|
|
251909
251932
|
actual: `single(${openingQuote})`,
|
|
251910
251933
|
expected: `double(${EXPECTED_QUOTE})`,
|
|
251911
251934
|
},
|
|
251912
|
-
fix: (fixer) => fixer.replaceTextRange([
|
|
251913
|
-
valueSpan.start.offset - 1,
|
|
251914
|
-
valueSpan.end.offset + 1,
|
|
251915
|
-
], `${EXPECTED_QUOTE}${rawValue}${EXPECTED_QUOTE}`),
|
|
251935
|
+
fix: (fixer) => fixer.replaceTextRange([openQuoteOffset, closeQuoteOffset + 1], `${EXPECTED_QUOTE}${rawValue}${EXPECTED_QUOTE}`),
|
|
251916
251936
|
loc: sourceSpanToLoc(attr.sourceSpan),
|
|
251917
251937
|
messageId: MESSAGE_IDS$2.UNEXPECTED,
|
|
251918
251938
|
});
|
|
@@ -252056,17 +252076,24 @@ const rule$b = createRule({
|
|
|
252056
252076
|
|
|
252057
252077
|
const MESSAGE_ID$4 = 'invalid';
|
|
252058
252078
|
const VALID_CONTAINERS = new Set(['menu', 'ol', 'ul']);
|
|
252079
|
+
/**
|
|
252080
|
+
* Duck-type check for TmplAstElement — avoids instanceof which breaks when
|
|
252081
|
+
* the plugin's bundled-angular-compiler differs from the one used by the
|
|
252082
|
+
* template parser (e.g. when the plugin is consumed from a different project).
|
|
252083
|
+
*/
|
|
252084
|
+
function isElement(node) {
|
|
252085
|
+
return (typeof node === 'object' &&
|
|
252086
|
+
node !== null &&
|
|
252087
|
+
typeof node['name'] === 'string' &&
|
|
252088
|
+
Array.isArray(node['children']));
|
|
252089
|
+
}
|
|
252059
252090
|
function getClosestParentElement(node) {
|
|
252060
|
-
let
|
|
252061
|
-
while (
|
|
252062
|
-
if (
|
|
252063
|
-
return
|
|
252064
|
-
}
|
|
252065
|
-
if (parent instanceof dist$4.TmplAstTemplate) {
|
|
252066
|
-
parent = parent.parent;
|
|
252067
|
-
continue;
|
|
252091
|
+
let current = node['parent'];
|
|
252092
|
+
while (current !== null && current !== undefined) {
|
|
252093
|
+
if (isElement(current)) {
|
|
252094
|
+
return current;
|
|
252068
252095
|
}
|
|
252069
|
-
|
|
252096
|
+
current = current['parent'];
|
|
252070
252097
|
}
|
|
252071
252098
|
return null;
|
|
252072
252099
|
}
|