@taiga-ui/eslint-plugin-experience-next 0.557.0 → 0.558.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/README.md CHANGED
@@ -13,6 +13,7 @@ import taiga from '@taiga-ui/eslint-plugin-experience-next';
13
13
 
14
14
  export default [
15
15
  ...taiga.configs.recommended,
16
+ ...taiga.configs.jest,
16
17
  // custom rules
17
18
  {
18
19
  files: ['**/legacy/**/*.ts'],
@@ -26,7 +27,6 @@ export default [
26
27
  '@angular-eslint/template/button-has-type': 'off',
27
28
  '@angular-eslint/template/elements-content': 'off',
28
29
  '@typescript-eslint/max-params': 'off',
29
- 'jest/prefer-importing-jest-globals': 'off',
30
30
  'sonarjs/prefer-nullish-coalescing': 'off',
31
31
  },
32
32
  },
@@ -39,6 +39,9 @@ export default [
39
39
  from third-party plugins. The exact severities and file globs live in
40
40
  [`configs/recommended.ts`](https://github.com/taiga-family/toolkit/blob/main/projects/eslint-plugin-experience-next/configs/recommended.ts).
41
41
 
42
+ Jest rules are optional. Add `...taiga.configs.jest` after `...taiga.configs.recommended` when the project uses Jest;
43
+ omit it for Vitest projects.
44
+
42
45
  | Package | What is included in `recommended` |
43
46
  | -------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
44
47
  | [ESLint core](https://eslint.org/docs/latest/rules/) | `eslint.configs.recommended` and individual core rules for JS/TS files |
@@ -54,7 +57,6 @@ from third-party plugins. The exact severities and file globs live in
54
57
  | [eslint-plugin-decorator-position](https://github.com/NullVoxPopuli/eslint-plugin-decorator-position/blob/master/docs/rules/decorator-position.md) | Individual `decorator-position/*` rules for JS/TS files |
55
58
  | [eslint-plugin-file-progress](https://github.com/sibiraj-s/eslint-plugin-file-progress#readme) | `progress.configs['recommended-ci']` |
56
59
  | [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import#rules) | `flatConfigs.recommended`, `flatConfigs.typescript`, and individual `import/*` rules for JS/TS files |
57
- | [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest#rules) | `jest.configs['flat/recommended']` and individual `jest/*` rules for `**/*.spec.ts` |
58
60
  | [eslint-plugin-package-json](https://github.com/michaelfaith/eslint-plugin-package-json#supported-rules) | `packageJsonConfigs.recommended` and individual `package-json/*` rules for `**/package.json` |
59
61
  | [eslint-plugin-perfectionist](https://perfectionist.dev/rules) | Individual `perfectionist/*` sorting rules for JS/TS files |
60
62
  | [eslint-plugin-playwright](https://github.com/mskelton/eslint-plugin-playwright#rules) | `playwright.configs['flat/recommended']` and individual `playwright/*` rules for `**/*.pw.spec.ts` |
@@ -0,0 +1,2 @@
1
+ declare const _default: import("@eslint/config-helpers").Config[];
2
+ export default _default;
package/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { type ConfigArray } from 'typescript-eslint';
2
2
  declare const plugin: {
3
3
  configs: {
4
+ readonly jest: ConfigArray;
4
5
  readonly recommended: ConfigArray;
5
6
  readonly ["taiga-specific"]: ConfigArray;
6
7
  };
package/index.esm.js CHANGED
@@ -1,16 +1,16 @@
1
1
  import fs, { globSync, readFileSync } from 'node:fs';
2
+ import { defineConfig } from 'eslint/config';
3
+ import jest$1 from 'eslint-plugin-jest';
2
4
  import markdown from '@eslint/markdown';
3
5
  import rxjs from '@smarttools/eslint-plugin-rxjs';
4
6
  import stylistic from '@stylistic/eslint-plugin';
5
7
  import angular from 'angular-eslint';
6
- import { defineConfig } from 'eslint/config';
7
8
  import compat from 'eslint-plugin-compat';
8
9
  import cypress from 'eslint-plugin-cypress';
9
10
  import { configs } from 'eslint-plugin-de-morgan';
10
11
  import decoratorPosition from 'eslint-plugin-decorator-position';
11
12
  import progress from 'eslint-plugin-file-progress';
12
13
  import importPlugin from 'eslint-plugin-import';
13
- import jest from 'eslint-plugin-jest';
14
14
  import packageJson, { configs as configs$2 } from 'eslint-plugin-package-json';
15
15
  import perfectionist from 'eslint-plugin-perfectionist';
16
16
  import playwright from 'eslint-plugin-playwright';
@@ -29,6 +29,69 @@ import require$$1 from 'eslint/use-at-your-own-risk';
29
29
  import ts, { TypeFlags, ScriptTarget } from 'typescript';
30
30
  import path from 'node:path';
31
31
 
32
+ var jest = defineConfig([
33
+ {
34
+ files: ['**/*.spec.ts'],
35
+ extends: [jest$1.configs['flat/recommended']],
36
+ rules: {
37
+ 'jest/expect-expect': 'off',
38
+ 'jest/max-expects': 'off',
39
+ 'jest/max-nested-describe': 'off',
40
+ 'jest/no-conditional-in-test': 'off',
41
+ 'jest/no-deprecated-functions': 'off',
42
+ 'jest/no-disabled-tests': 'off',
43
+ 'jest/no-done-callback': 'off',
44
+ 'jest/no-hooks': 'off',
45
+ 'jest/no-test-prefixes': 'error',
46
+ 'jest/prefer-called-with': 'off',
47
+ 'jest/prefer-each': 'off',
48
+ 'jest/prefer-expect-assertions': 'off',
49
+ 'jest/prefer-expect-resolves': 'off',
50
+ 'jest/prefer-hooks-on-top': 'off',
51
+ /**
52
+ * If enabled we have
53
+ * Expected to be running in 'ProxyZone', but it was not found
54
+ */
55
+ 'jest/prefer-ending-with-an-expect': 'off',
56
+ 'jest/prefer-importing-jest-globals': 'off',
57
+ 'jest/prefer-lowercase-title': [
58
+ 'error',
59
+ {
60
+ allowedPrefixes: [
61
+ 'Tui',
62
+ 'NaN',
63
+ 'UTC',
64
+ 'January',
65
+ 'February',
66
+ 'March',
67
+ 'April',
68
+ 'May',
69
+ 'June',
70
+ 'July',
71
+ 'August',
72
+ 'September',
73
+ 'October',
74
+ 'November',
75
+ 'December',
76
+ ],
77
+ ignore: ['describe', 'test'],
78
+ },
79
+ ],
80
+ 'jest/prefer-strict-equal': 'off',
81
+ 'jest/prefer-to-be-null': 'off',
82
+ 'jest/prefer-to-have-length': 'off',
83
+ 'jest/require-hook': 'off',
84
+ 'jest/require-to-throw-message': 'off',
85
+ 'jest/require-top-level-describe': [
86
+ 'error',
87
+ { maxNumberOfTopLevelDescribes: 1 },
88
+ ],
89
+ 'jest/unbound-method': 'off',
90
+ 'jest/valid-title': 'off',
91
+ },
92
+ },
93
+ ]);
94
+
32
95
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
33
96
 
34
97
  function getDefaultExportFromCjs (x) {
@@ -593,9 +656,9 @@ function parseForESLint(text) {
593
656
  }
594
657
 
595
658
  var npmrcParser = /*#__PURE__*/Object.freeze({
596
- __proto__: null,
597
- parse: parse$1,
598
- parseForESLint: parseForESLint
659
+ __proto__: null,
660
+ parse: parse$1,
661
+ parseForESLint: parseForESLint
599
662
  });
600
663
 
601
664
  const require$2 = createRequire(import.meta.url);
@@ -1469,7 +1532,6 @@ var recommended = defineConfig([
1469
1532
  extends: [playwright.configs['flat/recommended']],
1470
1533
  rules: {
1471
1534
  '@taiga-ui/experience-next/no-playwright-empty-fill': 'error',
1472
- 'jest/prefer-importing-jest-globals': 'off',
1473
1535
  'playwright/consistent-spacing-between-blocks': 'error',
1474
1536
  'playwright/expect-expect': [
1475
1537
  'error',
@@ -1504,65 +1566,10 @@ var recommended = defineConfig([
1504
1566
  },
1505
1567
  {
1506
1568
  files: ['**/*.spec.ts'],
1507
- extends: [jest.configs['flat/recommended']],
1508
1569
  rules: {
1509
1570
  '@typescript-eslint/no-extraneous-class': 'off',
1510
- 'jest/expect-expect': 'off',
1511
- 'jest/max-expects': 'off',
1512
- 'jest/max-nested-describe': 'off',
1513
- 'jest/no-conditional-in-test': 'off',
1514
- 'jest/no-deprecated-functions': 'off',
1515
- 'jest/no-disabled-tests': 'off',
1516
- 'jest/no-done-callback': 'off',
1517
- 'jest/no-hooks': 'off',
1518
- 'jest/no-test-prefixes': 'error',
1519
- 'jest/prefer-called-with': 'off',
1520
- 'jest/prefer-each': 'off',
1521
- 'jest/prefer-expect-assertions': 'off',
1522
- 'jest/prefer-expect-resolves': 'off',
1523
- 'jest/prefer-hooks-on-top': 'off',
1524
1571
  'max-nested-callbacks': 'off',
1525
1572
  'sonarjs/no-clear-text-protocols': 'off',
1526
- /**
1527
- * If enabled we have
1528
- * Expected to be running in 'ProxyZone', but it was not found
1529
- */
1530
- 'jest/prefer-ending-with-an-expect': 'off',
1531
- 'jest/prefer-importing-jest-globals': 'off',
1532
- 'jest/prefer-lowercase-title': [
1533
- 'error',
1534
- {
1535
- allowedPrefixes: [
1536
- 'Tui',
1537
- 'NaN',
1538
- 'UTC',
1539
- 'January',
1540
- 'February',
1541
- 'March',
1542
- 'April',
1543
- 'May',
1544
- 'June',
1545
- 'July',
1546
- 'August',
1547
- 'September',
1548
- 'October',
1549
- 'November',
1550
- 'December',
1551
- ],
1552
- ignore: ['describe', 'test'],
1553
- },
1554
- ],
1555
- 'jest/prefer-strict-equal': 'off',
1556
- 'jest/prefer-to-be-null': 'off',
1557
- 'jest/prefer-to-have-length': 'off',
1558
- 'jest/require-hook': 'off',
1559
- 'jest/require-to-throw-message': 'off',
1560
- 'jest/require-top-level-describe': [
1561
- 'error',
1562
- { maxNumberOfTopLevelDescribes: 1 },
1563
- ],
1564
- 'jest/unbound-method': 'off',
1565
- 'jest/valid-title': 'off',
1566
1573
  },
1567
1574
  },
1568
1575
  {
@@ -59957,6 +59964,7 @@ const plugin = {
59957
59964
  // https://eslint.org/docs/latest/extend/plugins#configs-in-plugins
59958
59965
  // assign configs here so we can reference `plugin`
59959
59966
  Object.assign(plugin.configs, {
59967
+ jest,
59960
59968
  recommended: [
59961
59969
  { files: ALL_TS_JS_FILES, plugins: { '@taiga-ui/experience-next': plugin } },
59962
59970
  { files: ['**/*.html'], plugins: { '@taiga-ui/experience-next': plugin } },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taiga-ui/eslint-plugin-experience-next",
3
- "version": "0.557.0",
3
+ "version": "0.558.0",
4
4
  "description": "An ESLint plugin to enforce a consistent code styles across taiga-ui projects",
5
5
  "homepage": "https://github.com/taiga-family/toolkit#readme",
6
6
  "bugs": {