@taiga-ui/eslint-plugin-experience-next 0.425.0 → 0.427.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 +41 -5
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -952,15 +952,36 @@ var recommended = defineConfig([
|
|
|
952
952
|
'@taiga-ui/experience-next/no-playwright-empty-fill': 'error',
|
|
953
953
|
'compat/compat': 'off',
|
|
954
954
|
'jest/prefer-importing-jest-globals': 'off',
|
|
955
|
+
'playwright/consistent-spacing-between-blocks': 'error',
|
|
955
956
|
'playwright/expect-expect': [
|
|
956
957
|
'error',
|
|
957
958
|
{ assertFunctionNames: ['expect', 'expect.soft'] },
|
|
958
959
|
],
|
|
960
|
+
'playwright/max-nested-describe': 'error',
|
|
961
|
+
'playwright/missing-playwright-await': 'error',
|
|
962
|
+
'playwright/no-conditional-expect': 'error',
|
|
963
|
+
'playwright/no-conditional-in-test': 'error',
|
|
964
|
+
'playwright/no-duplicate-hooks': 'error',
|
|
965
|
+
'playwright/no-duplicate-slow': 'error',
|
|
966
|
+
'playwright/no-element-handle': 'error',
|
|
967
|
+
'playwright/no-eval': 'error',
|
|
959
968
|
'playwright/no-force-option': 'error',
|
|
969
|
+
'playwright/no-nested-step': 'error',
|
|
960
970
|
'playwright/no-networkidle': 'off',
|
|
971
|
+
'playwright/no-page-pause': 'error',
|
|
961
972
|
'playwright/no-skipped-test': 'off',
|
|
973
|
+
'playwright/no-standalone-expect': 'error',
|
|
974
|
+
'playwright/no-unsafe-references': 'error',
|
|
975
|
+
'playwright/no-unused-locators': 'error',
|
|
976
|
+
'playwright/no-useless-await': 'error',
|
|
977
|
+
'playwright/no-useless-not': 'error',
|
|
962
978
|
'playwright/no-wait-for-selector': 'off',
|
|
963
979
|
'playwright/no-wait-for-timeout': 'off',
|
|
980
|
+
'playwright/prefer-hooks-in-order': 'error',
|
|
981
|
+
'playwright/prefer-hooks-on-top': 'error',
|
|
982
|
+
'playwright/prefer-locator': 'error',
|
|
983
|
+
'playwright/prefer-to-have-count': 'error',
|
|
984
|
+
'playwright/prefer-to-have-length': 'error',
|
|
964
985
|
},
|
|
965
986
|
},
|
|
966
987
|
{
|
|
@@ -1597,7 +1618,16 @@ const rule$6 = createRule$9({
|
|
|
1597
1618
|
|
|
1598
1619
|
const MESSAGE_ID$3 = 'no-deep-imports';
|
|
1599
1620
|
const ERROR_MESSAGE$2 = 'Deep imports of Taiga UI packages are prohibited';
|
|
1600
|
-
const
|
|
1621
|
+
const CODE_EXTENSIONS = new Set([
|
|
1622
|
+
'.cjs',
|
|
1623
|
+
'.cts',
|
|
1624
|
+
'.js',
|
|
1625
|
+
'.jsx',
|
|
1626
|
+
'.mjs',
|
|
1627
|
+
'.mts',
|
|
1628
|
+
'.ts',
|
|
1629
|
+
'.tsx',
|
|
1630
|
+
]);
|
|
1601
1631
|
const DEFAULT_OPTIONS = {
|
|
1602
1632
|
currentProject: '',
|
|
1603
1633
|
deepImport: String.raw `(?<=^@taiga-ui/[\w-]+)(/.+)$`,
|
|
@@ -1609,7 +1639,14 @@ const createRule$8 = ESLintUtils.RuleCreator((name) => name);
|
|
|
1609
1639
|
const rule$5 = createRule$8({
|
|
1610
1640
|
create(context) {
|
|
1611
1641
|
const { currentProject, deepImport, ignoreImports, importDeclaration, projectName, } = { ...DEFAULT_OPTIONS, ...context.options[0] };
|
|
1612
|
-
const
|
|
1642
|
+
const hasNonCodeExtension = (source) => {
|
|
1643
|
+
if (!source) {
|
|
1644
|
+
return false;
|
|
1645
|
+
}
|
|
1646
|
+
const cleanSource = source.split(/[?#]/, 1)[0] ?? '';
|
|
1647
|
+
const extension = path.posix.extname(cleanSource).toLowerCase();
|
|
1648
|
+
return !!extension && !CODE_EXTENSIONS.has(extension);
|
|
1649
|
+
};
|
|
1613
1650
|
const isDeepImport = (source) => !!source && new RegExp(deepImport, 'g').test(source);
|
|
1614
1651
|
const isSideEffectImport = (node) => node.specifiers.length === 0;
|
|
1615
1652
|
const isInsideTheSameEntryPoint = (source) => {
|
|
@@ -1633,14 +1670,13 @@ const rule$5 = createRule$8({
|
|
|
1633
1670
|
!isDeepImport(importSource) ||
|
|
1634
1671
|
isInsideTheSameEntryPoint(importSource) ||
|
|
1635
1672
|
shouldIgnore(importSource) ||
|
|
1636
|
-
|
|
1673
|
+
hasNonCodeExtension(importSource)) {
|
|
1637
1674
|
return;
|
|
1638
1675
|
}
|
|
1639
1676
|
context.report({
|
|
1640
1677
|
fix: (fixer) => {
|
|
1641
1678
|
const [start, end] = node.source.range;
|
|
1642
|
-
return fixer.replaceTextRange([start + 1, end - 1],
|
|
1643
|
-
importSource.replaceAll(new RegExp(deepImport, 'g'), ''));
|
|
1679
|
+
return fixer.replaceTextRange([start + 1, end - 1], importSource.replaceAll(new RegExp(deepImport, 'g'), ''));
|
|
1644
1680
|
},
|
|
1645
1681
|
messageId: MESSAGE_ID$3,
|
|
1646
1682
|
node: node.source,
|
package/package.json
CHANGED