@ovh-ux/manager-static-analysis-kit 0.2.0 โ†’ 0.3.1

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 (156) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/bin/lint-cli.js +1 -1
  3. package/dist/adapters/eslint/config/eslint-shared-config.d.ts +3 -0
  4. package/dist/adapters/eslint/config/eslint-shared-config.d.ts.map +1 -0
  5. package/dist/adapters/eslint/config/eslint-shared-config.js +29 -0
  6. package/dist/adapters/eslint/rules/eslint-a11y.d.ts +3 -0
  7. package/dist/adapters/eslint/rules/eslint-a11y.d.ts.map +1 -0
  8. package/dist/adapters/eslint/rules/eslint-a11y.js +18 -0
  9. package/dist/adapters/eslint/rules/eslint-complexity.d.ts +4 -0
  10. package/dist/adapters/eslint/rules/eslint-complexity.d.ts.map +1 -0
  11. package/dist/adapters/eslint/rules/eslint-complexity.js +56 -0
  12. package/dist/adapters/eslint/rules/eslint-css.d.ts +8 -0
  13. package/dist/adapters/eslint/rules/eslint-css.d.ts.map +1 -0
  14. package/dist/adapters/eslint/rules/eslint-css.js +16 -0
  15. package/dist/adapters/eslint/rules/eslint-html.d.ts +3 -0
  16. package/dist/adapters/eslint/rules/eslint-html.d.ts.map +1 -0
  17. package/dist/adapters/eslint/rules/eslint-html.js +16 -0
  18. package/dist/adapters/eslint/rules/eslint-imports.d.ts +3 -0
  19. package/dist/adapters/eslint/rules/eslint-imports.d.ts.map +1 -0
  20. package/dist/adapters/eslint/rules/eslint-imports.js +52 -0
  21. package/dist/adapters/eslint/rules/eslint-javascript.d.ts +3 -0
  22. package/dist/adapters/eslint/rules/eslint-javascript.d.ts.map +1 -0
  23. package/dist/adapters/eslint/rules/eslint-javascript.js +14 -0
  24. package/dist/adapters/eslint/rules/eslint-naming-conventions.d.ts +3 -0
  25. package/dist/adapters/eslint/rules/eslint-naming-conventions.d.ts.map +1 -0
  26. package/dist/adapters/eslint/rules/eslint-naming-conventions.js +35 -0
  27. package/dist/adapters/eslint/rules/eslint-prettier.d.ts +3 -0
  28. package/dist/adapters/eslint/rules/eslint-prettier.d.ts.map +1 -0
  29. package/dist/adapters/eslint/rules/eslint-prettier.js +13 -0
  30. package/dist/adapters/eslint/rules/eslint-react.d.ts +3 -0
  31. package/dist/adapters/eslint/rules/eslint-react.d.ts.map +1 -0
  32. package/dist/adapters/eslint/rules/eslint-react.js +31 -0
  33. package/dist/adapters/eslint/rules/eslint-storybook.d.ts +3 -0
  34. package/dist/adapters/eslint/rules/eslint-storybook.d.ts.map +1 -0
  35. package/dist/adapters/eslint/rules/eslint-storybook.js +12 -0
  36. package/dist/adapters/eslint/rules/eslint-tailwind-jsx.d.ts +3 -0
  37. package/dist/adapters/eslint/rules/eslint-tailwind-jsx.d.ts.map +1 -0
  38. package/dist/adapters/eslint/rules/eslint-tailwind-jsx.js +11 -0
  39. package/dist/adapters/eslint/rules/eslint-tanstack.d.ts +3 -0
  40. package/dist/adapters/eslint/rules/eslint-tanstack.d.ts.map +1 -0
  41. package/dist/adapters/eslint/rules/eslint-tanstack.js +11 -0
  42. package/dist/adapters/eslint/rules/eslint-tests.d.ts +3 -0
  43. package/dist/adapters/eslint/rules/eslint-tests.d.ts.map +1 -0
  44. package/dist/adapters/eslint/rules/eslint-tests.js +21 -0
  45. package/dist/adapters/eslint/rules/eslint-typescript.d.ts +3 -0
  46. package/dist/adapters/eslint/rules/eslint-typescript.d.ts.map +1 -0
  47. package/dist/adapters/eslint/rules/eslint-typescript.js +20 -0
  48. package/dist/adapters/ts-config/config/standard/tsconfig.node.d.ts +22 -0
  49. package/dist/adapters/ts-config/config/standard/tsconfig.node.d.ts.map +1 -0
  50. package/dist/adapters/ts-config/config/standard/tsconfig.node.js +12 -0
  51. package/dist/adapters/ts-config/config/standard/tsconfig.react.d.ts +25 -0
  52. package/dist/adapters/ts-config/config/standard/tsconfig.react.d.ts.map +1 -0
  53. package/dist/adapters/ts-config/config/standard/tsconfig.react.js +14 -0
  54. package/dist/adapters/ts-config/config/standard/tsconfig.test.d.ts +23 -0
  55. package/dist/adapters/ts-config/config/standard/tsconfig.test.d.ts.map +1 -0
  56. package/dist/adapters/ts-config/config/standard/tsconfig.test.js +12 -0
  57. package/dist/adapters/ts-config/config/strict/tsconfig.node.d.ts +27 -0
  58. package/dist/adapters/ts-config/config/strict/tsconfig.node.d.ts.map +1 -0
  59. package/dist/adapters/ts-config/config/strict/tsconfig.node.js +12 -0
  60. package/dist/adapters/ts-config/config/strict/tsconfig.react.d.ts +30 -0
  61. package/dist/adapters/ts-config/config/strict/tsconfig.react.d.ts.map +1 -0
  62. package/dist/adapters/ts-config/config/strict/tsconfig.react.js +14 -0
  63. package/dist/adapters/ts-config/config/strict/tsconfig.test.d.ts +28 -0
  64. package/dist/adapters/ts-config/config/strict/tsconfig.test.d.ts.map +1 -0
  65. package/dist/adapters/ts-config/config/strict/tsconfig.test.js +12 -0
  66. package/dist/adapters/ts-config/rules/tsconfig.base.d.ts +18 -0
  67. package/dist/adapters/ts-config/rules/tsconfig.base.d.ts.map +1 -0
  68. package/dist/adapters/ts-config/rules/tsconfig.base.js +17 -0
  69. package/dist/adapters/ts-config/rules/tsconfig.base.strict.d.ts +23 -0
  70. package/dist/adapters/ts-config/rules/tsconfig.base.strict.d.ts.map +1 -0
  71. package/dist/adapters/ts-config/rules/tsconfig.base.strict.js +12 -0
  72. package/dist/code-analysis.d.ts +2 -0
  73. package/dist/code-analysis.d.ts.map +1 -0
  74. package/dist/configs/complexity-config.d.ts +15 -0
  75. package/dist/configs/complexity-config.d.ts.map +1 -0
  76. package/dist/configs/complexity-config.js +14 -0
  77. package/dist/configs/file-globs-config.d.ts +15 -0
  78. package/dist/configs/file-globs-config.d.ts.map +1 -0
  79. package/{src/configs/file-globs-config.ts โ†’ dist/configs/file-globs-config.js} +0 -8
  80. package/dist/configs/import-order-config.d.ts +2 -0
  81. package/dist/configs/import-order-config.d.ts.map +1 -0
  82. package/dist/configs/import-order-config.js +9 -0
  83. package/dist/configs/jscpd-config.d.ts +7 -0
  84. package/dist/configs/jscpd-config.d.ts.map +1 -0
  85. package/dist/configs/jscpd-config.js +7 -0
  86. package/dist/configs/madge-config.d.ts +5 -0
  87. package/dist/configs/madge-config.d.ts.map +1 -0
  88. package/dist/configs/madge-config.js +5 -0
  89. package/dist/configs/naming-conventions-config.d.ts +7 -0
  90. package/dist/configs/naming-conventions-config.d.ts.map +1 -0
  91. package/dist/configs/naming-conventions-config.js +60 -0
  92. package/dist/configs/prettier-config.d.ts +18 -0
  93. package/dist/configs/prettier-config.d.ts.map +1 -0
  94. package/dist/configs/prettier-config.js +34 -0
  95. package/dist/configs/shared-exclusion-patterns.d.ts +2 -0
  96. package/dist/configs/shared-exclusion-patterns.d.ts.map +1 -0
  97. package/dist/configs/shared-exclusion-patterns.js +37 -0
  98. package/dist/tsconfig/node-strict.json +29 -0
  99. package/dist/tsconfig/node.json +24 -0
  100. package/dist/tsconfig/react-strict.json +34 -0
  101. package/dist/tsconfig/react.json +29 -0
  102. package/dist/tsconfig/test-strict.json +36 -0
  103. package/dist/tsconfig/test.json +32 -0
  104. package/dist/tsconfig.tsbuildinfo +1 -0
  105. package/package.json +11 -7
  106. package/eslint.config.mjs +0 -53
  107. package/scripts/build.ts +0 -44
  108. package/src/adapters/code-health-meter/README.md +0 -1
  109. package/src/adapters/code-health-meter/config/.gitkeep +0 -0
  110. package/src/adapters/code-health-meter/rules/.gitkeep +0 -0
  111. package/src/adapters/eslint/README.md +0 -317
  112. package/src/adapters/eslint/config/eslint-shared-config.ts +0 -60
  113. package/src/adapters/eslint/rules/eslint-a11y.ts +0 -30
  114. package/src/adapters/eslint/rules/eslint-complexity.ts +0 -87
  115. package/src/adapters/eslint/rules/eslint-css.ts +0 -35
  116. package/src/adapters/eslint/rules/eslint-html.ts +0 -32
  117. package/src/adapters/eslint/rules/eslint-imports.ts +0 -84
  118. package/src/adapters/eslint/rules/eslint-javascript.ts +0 -27
  119. package/src/adapters/eslint/rules/eslint-naming-conventions.ts +0 -49
  120. package/src/adapters/eslint/rules/eslint-prettier.ts +0 -29
  121. package/src/adapters/eslint/rules/eslint-react.ts +0 -50
  122. package/src/adapters/eslint/rules/eslint-storybook.ts +0 -29
  123. package/src/adapters/eslint/rules/eslint-tailwind-jsx.ts +0 -21
  124. package/src/adapters/eslint/rules/eslint-tanstack.ts +0 -25
  125. package/src/adapters/eslint/rules/eslint-tests.ts +0 -35
  126. package/src/adapters/eslint/rules/eslint-typescript.ts +0 -33
  127. package/src/adapters/eslint/types/eslint-js.d.ts +0 -4
  128. package/src/adapters/eslint/types/eslint-plugin-jsx-a11y.d.ts +0 -16
  129. package/src/adapters/eslint/types/eslint-plugin-react-hooks.d.ts +0 -9
  130. package/src/adapters/eslint/types/eslint-plugin-react.d.ts +0 -9
  131. package/src/adapters/eslint/types/eslint-plugin-tailwindcss.d.ts +0 -6
  132. package/src/adapters/eslint/types/eslint-shared-config.d.ts +0 -3
  133. package/src/adapters/jscpd/README.md +0 -0
  134. package/src/adapters/jscpd/config/.gitkeep +0 -0
  135. package/src/adapters/jscpd/rules/.gitkeep +0 -0
  136. package/src/adapters/madge/README.md +0 -0
  137. package/src/adapters/madge/config/.gitkeep +0 -0
  138. package/src/adapters/madge/rules/.gitkeep +0 -0
  139. package/src/adapters/ts-config/README.md +0 -153
  140. package/src/adapters/ts-config/config/standard/tsconfig.node.ts +0 -13
  141. package/src/adapters/ts-config/config/standard/tsconfig.react.ts +0 -15
  142. package/src/adapters/ts-config/config/standard/tsconfig.test.ts +0 -13
  143. package/src/adapters/ts-config/config/strict/tsconfig.node.ts +0 -13
  144. package/src/adapters/ts-config/config/strict/tsconfig.react.ts +0 -15
  145. package/src/adapters/ts-config/config/strict/tsconfig.test.ts +0 -13
  146. package/src/adapters/ts-config/rules/tsconfig.base.strict.ts +0 -13
  147. package/src/adapters/ts-config/rules/tsconfig.base.ts +0 -17
  148. package/src/configs/complexity-config.ts +0 -29
  149. package/src/configs/import-order-config.ts +0 -12
  150. package/src/configs/jscpd-config.ts +0 -8
  151. package/src/configs/madge-config.ts +0 -8
  152. package/src/configs/naming-conventions-config.ts +0 -138
  153. package/src/configs/prettier-config.ts +0 -81
  154. package/src/configs/shared-exclusion-patterns.ts +0 -41
  155. package/tsconfig.json +0 -31
  156. /package/{src/code-analysis.ts โ†’ dist/code-analysis.js} +0 -0
@@ -1,84 +0,0 @@
1
- import js from '@eslint/js';
2
- import { Linter } from 'eslint';
3
- import importPlugin from 'eslint-plugin-import';
4
- import tsEslint from 'typescript-eslint';
5
-
6
- import { jsFiles, tsFiles } from '../../../configs/file-globs-config';
7
-
8
- /**
9
- * Shared import-related ESLint rules applied across both JavaScript and TypeScript.
10
- *
11
- * Includes cycle detection, discourages dynamic `require`, and disallows usage of core Node.js modules directly.
12
- */
13
- const sharedImportRules: Record<string, Linter.RuleEntry | undefined> = {
14
- ...importPlugin.flatConfigs.recommended.rules,
15
- 'import/no-cycle': [
16
- 'error',
17
- {
18
- maxDepth: Infinity,
19
- ignoreExternal: false,
20
- allowUnsafeDynamicCyclicDependency: false,
21
- disableScc: false,
22
- },
23
- ],
24
- 'import/no-dynamic-require': 'warn',
25
- 'import/no-nodejs-modules': 'warn',
26
- };
27
-
28
- /**
29
- * JavaScript-specific import rules.
30
- * Enables base `no-unused-vars` since TypeScript version is not in use.
31
- */
32
- const jsImportRules: Record<string, Linter.RuleEntry | undefined> = {
33
- ...sharedImportRules,
34
- 'no-unused-vars': 'warn',
35
- };
36
-
37
- /**
38
- * TypeScript-specific import rules.
39
- * Disables base `no-unused-vars` in favor of the TypeScript-aware variant from `@typescript-eslint`.
40
- */
41
- const tsImportRules: Record<string, Linter.RuleEntry | undefined> = {
42
- ...sharedImportRules,
43
- 'no-unused-vars': 'off',
44
- '@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
45
- };
46
-
47
- /**
48
- * ESLint Flat Config for managing import conventions, cycles, and unused rules
49
- * for both JavaScript and TypeScript environments.
50
- *
51
- * - Uses `eslint-plugin-import` for best practices
52
- * - Applies proper rules per language
53
- * - Configures import resolver for TS files
54
- *
55
- * @see https://github.com/import-js/eslint-plugin-import
56
- */
57
- export const importEslintConfig: Linter.FlatConfig[] = [
58
- // JavaScript configuration block
59
- js.configs.recommended,
60
- importPlugin.flatConfigs.recommended,
61
- {
62
- files: [jsFiles],
63
- languageOptions: {
64
- ecmaVersion: 'latest',
65
- sourceType: 'module',
66
- },
67
- rules: jsImportRules,
68
- },
69
-
70
- // TypeScript configuration block
71
- ...tsEslint.config({
72
- files: [tsFiles],
73
- extends: [importPlugin.flatConfigs.recommended, importPlugin.flatConfigs.typescript],
74
- rules: tsImportRules,
75
- settings: {
76
- 'import/resolver': {
77
- typescript: {
78
- alwaysTryTypes: true,
79
- },
80
- node: true,
81
- },
82
- },
83
- }),
84
- ];
@@ -1,27 +0,0 @@
1
- import js from '@eslint/js';
2
- import { Linter } from 'eslint';
3
-
4
- import { jsFilesLoose } from '../../../configs/file-globs-config';
5
-
6
- /**
7
- * ESLint Flat Config for standard JavaScript files.
8
- *
9
- * Applies:
10
- * - ESLint's built-in recommended rules via `@eslint/js`
11
- * - Supports both `.js` and `.jsx` files (loose JS pattern)
12
- * - Configured for ECMAScript Modules (`sourceType: 'module'`)
13
- *
14
- * @see https://eslint.org/docs/latest/rules/
15
- */
16
- export const javascriptEslintConfig: Linter.FlatConfig = {
17
- files: [jsFilesLoose],
18
- ignores: [],
19
- languageOptions: {
20
- ...js.languageOptions,
21
- sourceType: 'module',
22
- },
23
- plugins: js.plugins,
24
- rules: {
25
- ...js.configs.recommended.rules,
26
- },
27
- };
@@ -1,49 +0,0 @@
1
- import { Linter } from 'eslint';
2
- import checkFile from 'eslint-plugin-check-file';
3
-
4
- import {
5
- filenameBlocklist,
6
- filenameNamingConvention,
7
- folderMatchWithFex,
8
- folderNamingConvention,
9
- } from '../../../configs/naming-conventions-config';
10
-
11
- export const checkFileEslintConfig: Linter.FlatConfig[] = [
12
- {
13
- plugins: {
14
- 'check-file': checkFile,
15
- },
16
- rules: {
17
- 'check-file/no-index': 'error',
18
- 'check-file/filename-blocklist': ['error', filenameBlocklist],
19
-
20
- 'check-file/folder-match-with-fex': [
21
- 'error',
22
- folderMatchWithFex,
23
- {
24
- errorMessage:
25
- 'The folder of the file "{{ target }}" does not match the expected pattern "{{ pattern }}". See ยต-app structure guidelines.',
26
- },
27
- ],
28
-
29
- 'check-file/filename-naming-convention': [
30
- 'error',
31
- filenameNamingConvention,
32
- {
33
- ignoreMiddleExtensions: true,
34
- errorMessage:
35
- 'The filename "{{ target }}" does not match the naming convention "{{ pattern }}". Please check contribute.md.',
36
- },
37
- ],
38
-
39
- 'check-file/folder-naming-convention': [
40
- 'error',
41
- folderNamingConvention,
42
- {
43
- errorMessage:
44
- 'Folder "{{ target }}" must follow the "{{ pattern }}" naming convention. See ยต-app guidelines.',
45
- },
46
- ],
47
- },
48
- },
49
- ];
@@ -1,29 +0,0 @@
1
- import { Linter } from 'eslint';
2
- import prettier from 'eslint-plugin-prettier';
3
-
4
- import { commonTextFiles } from '../../../configs/file-globs-config';
5
- import { prettierConfig, prettierIgnorePatterns } from '../../../configs/prettier-config';
6
-
7
- /**
8
- * ESLint Flat Config for Prettier integration.
9
- *
10
- * This configuration applies Prettier formatting rules via `eslint-plugin-prettier`
11
- * and ensures formatting violations are reported as ESLint errors.
12
- *
13
- * - Uses custom Prettier options from `prettierConfig`
14
- * - Ignores defined file patterns (e.g., build output, loaders, etc.)
15
- * - Applies to common text-based files such as JS/TS, JSON, YAML, Markdown
16
- *
17
- * @see https://github.com/prettier/eslint-plugin-prettier
18
- */
19
- export const prettierEslintConfig: Linter.FlatConfig = {
20
- files: [commonTextFiles],
21
- ignores: prettierIgnorePatterns,
22
- plugins: {
23
- prettier,
24
- },
25
- rules: {
26
- /** Ensures Prettier formatting is enforced via ESLint */
27
- 'prettier/prettier': ['error', prettierConfig, { usePrettierrc: false }],
28
- },
29
- };
@@ -1,50 +0,0 @@
1
- import { ESLint, Linter } from 'eslint';
2
- import reactPlugin from 'eslint-plugin-react';
3
- import reactHooksPlugin from 'eslint-plugin-react-hooks';
4
- import globals from 'globals';
5
-
6
- import { jsTsFiles } from '../../../configs/file-globs-config';
7
-
8
- /**
9
- * ESLint Flat Config for React and React Hooks.
10
- *
11
- * This configuration applies:
12
- * - Recommended React rules from `eslint-plugin-react`
13
- * - Recommended rules for hooks from `eslint-plugin-react-hooks`
14
- * - JSX support via `parserOptions.ecmaFeatures.jsx`
15
- * - Browser global variables (e.g., `window`, `document`)
16
- * - Auto-detect React version for compatibility
17
- *
18
- * @see https://www.npmjs.com/package/eslint-plugin-react
19
- * @see https://www.npmjs.com/package/eslint-plugin-react-hooks
20
- */
21
- export const reactEslintConfig: Linter.FlatConfig = {
22
- files: [jsTsFiles],
23
- plugins: {
24
- react: reactPlugin as unknown as ESLint.Plugin,
25
- 'react-hooks': reactHooksPlugin as unknown as ESLint.Plugin,
26
- },
27
- languageOptions: {
28
- parserOptions: {
29
- ecmaFeatures: {
30
- jsx: true,
31
- },
32
- },
33
- globals: {
34
- ...globals.browser,
35
- },
36
- },
37
- settings: {
38
- react: {
39
- version: 'detect',
40
- },
41
- },
42
- rules: {
43
- ...reactPlugin.configs.recommended.rules,
44
- ...reactHooksPlugin.configs.recommended.rules,
45
-
46
- // Enforce only one component per file (stateless included)
47
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-multi-comp.md
48
- 'react/no-multi-comp': ['error', { ignoreStateless: false }],
49
- },
50
- };
@@ -1,29 +0,0 @@
1
- import { Linter } from 'eslint';
2
- import storybook from 'eslint-plugin-storybook';
3
-
4
- import { storyFiles } from '../../../configs/file-globs-config';
5
-
6
- /**
7
- * Additional Storybook-specific rule overrides.
8
- *
9
- * Applies only to `.stories` files to enforce consistency in Storybook metadata.
10
- *
11
- * @see https://github.com/storybookjs/eslint-plugin-storybook
12
- */
13
- const overrides: Linter.FlatConfig = {
14
- files: [storyFiles],
15
- rules: {
16
- 'storybook/hierarchy-separator': 'error',
17
- },
18
- };
19
-
20
- /**
21
- * ESLint Flat Config for Storybook.
22
- *
23
- * Combines the official `flat/recommended` config from `eslint-plugin-storybook`
24
- * with additional overrides for enforcing hierarchy separator style.
25
- */
26
- export const storybookEslintConfig: Linter.FlatConfig[] = [
27
- ...(storybook.configs['flat/recommended'] as Linter.FlatConfig[]),
28
- overrides,
29
- ];
@@ -1,21 +0,0 @@
1
- import { Linter } from 'eslint';
2
- import tailwindcss from 'eslint-plugin-tailwindcss';
3
-
4
- import { jsxTsxFiles } from '../../../configs/file-globs-config';
5
-
6
- /**
7
- * ESLint Flat Config for Tailwind CSS in JSX/TSX files.
8
- *
9
- * Applies `eslint-plugin-tailwindcss` recommended rules to React components using Tailwind.
10
- *
11
- * @see https://www.npmjs.com/package/eslint-plugin-tailwindcss
12
- */
13
- export const tailwindJsxConfig: Linter.FlatConfig = {
14
- files: [jsxTsxFiles],
15
- plugins: {
16
- tailwindcss,
17
- },
18
- rules: {
19
- ...tailwindcss.configs['flat/recommended'].rules,
20
- },
21
- };
@@ -1,25 +0,0 @@
1
- import pluginQuery from '@tanstack/eslint-plugin-query';
2
- import { Linter } from 'eslint';
3
-
4
- import { jsTsFiles } from '../../../configs/file-globs-config';
5
-
6
- /**
7
- * ESLint Flat Config for TanStack Query (React Query).
8
- *
9
- * Provides structure for applying TanStack's ruleset to JS/TS files using TanStack Query.
10
- * Extend this config by explicitly enabling the desired rules.
11
- *
12
- * @see https://github.com/TanStack/query/blob/main/docs/eslint/eslint-plugin-query.md
13
- */
14
- export const tanStackQueryEslintConfig: Linter.FlatConfig = {
15
- files: [jsTsFiles],
16
- plugins: {
17
- '@tanstack/query': pluginQuery,
18
- },
19
- rules: {
20
- ...pluginQuery.configs.recommended.rules,
21
- // Add rules here as needed, e.g.:
22
- // '@tanstack/query/exhaustive-deps': 'warn',
23
- // '@tanstack/query/prefer-query-object-syntax': 'error',
24
- },
25
- };
@@ -1,35 +0,0 @@
1
- import vitest from '@vitest/eslint-plugin';
2
- import { ESLint, Linter } from 'eslint';
3
-
4
- import { testFiles } from '../../../configs/file-globs-config';
5
-
6
- /**
7
- * ESLint Flat Config for Vitest testing files.
8
- *
9
- * Applies recommended linting rules for Vitest test environments. This includes:
10
- * - Type-aware linting (when enabled),
11
- * - Test environment globals (e.g., `describe`, `it`, `expect`),
12
- * - Best practices and anti-patterns specific to testing.
13
- *
14
- * @see https://github.com/vitest-dev/eslint-plugin-vitest#rules
15
- */
16
- export const vitestEslintConfig: Linter.FlatConfig = {
17
- files: testFiles,
18
- plugins: {
19
- vitest: vitest as unknown as ESLint.Plugin,
20
- },
21
- settings: {
22
- vitest: {
23
- typecheck: true, // enable type-aware test linting if applicable
24
- },
25
- },
26
- languageOptions: {
27
- globals: {
28
- ...vitest.environments.env.globals,
29
- },
30
- },
31
- rules: {
32
- ...vitest.configs.recommended.rules,
33
- // You can add specific overrides here as needed
34
- },
35
- };
@@ -1,33 +0,0 @@
1
- import tsPlugin from '@typescript-eslint/eslint-plugin';
2
- import tsParser from '@typescript-eslint/parser';
3
- import { Linter } from 'eslint';
4
-
5
- import { tsFiles } from '../../../configs/file-globs-config';
6
-
7
- /**
8
- * ESLint Flat Config for TypeScript source files.
9
- *
10
- * This configuration enables type-aware linting using the `@typescript-eslint` plugin.
11
- * It loads `recommended-type-checked` rules and uses the project's `tsconfig.json`
12
- * for type resolution, allowing deeper semantic analysis.
13
- *
14
- * @see https://typescript-eslint.io/rules/
15
- */
16
- export const typescriptEslintConfig: Linter.FlatConfig = {
17
- files: [tsFiles],
18
- ignores: [],
19
- languageOptions: {
20
- parser: tsParser,
21
- parserOptions: {
22
- project: './tsconfig.json',
23
- sourceType: 'module',
24
- },
25
- },
26
- plugins: {
27
- '@typescript-eslint': tsPlugin,
28
- },
29
- rules: {
30
- ...tsPlugin.configs['recommended-type-checked'].rules,
31
- // Add custom or stricter rules below if needed
32
- },
33
- };
@@ -1,4 +0,0 @@
1
- declare module '@eslint/js' {
2
- const value: any;
3
- export = value;
4
- }
@@ -1,16 +0,0 @@
1
- declare module 'eslint-plugin-jsx-a11y' {
2
- import type { Linter } from 'eslint';
3
- const plugin: Linter.Plugin & {
4
- flatConfigs?: {
5
- recommended?: {
6
- rules: Linter.RulesRecord;
7
- languageOptions?: Linter.FlatConfig['languageOptions'];
8
- };
9
- strict?: {
10
- rules: Linter.RulesRecord;
11
- languageOptions?: Linter.FlatConfig['languageOptions'];
12
- };
13
- };
14
- };
15
- export default plugin;
16
- }
@@ -1,9 +0,0 @@
1
- declare module 'eslint-plugin-react-hooks' {
2
- import { ESLint } from 'eslint';
3
-
4
- const plugin: ESLint.Plugin & {
5
- configs: Record<string, any>;
6
- };
7
-
8
- export default plugin;
9
- }
@@ -1,9 +0,0 @@
1
- declare module 'eslint-plugin-react' {
2
- import { ESLint } from 'eslint';
3
-
4
- const plugin: ESLint.Plugin & {
5
- configs: Record<string, any>;
6
- };
7
-
8
- export default plugin;
9
- }
@@ -1,6 +0,0 @@
1
- declare module 'eslint-plugin-tailwindcss' {
2
- const plugin: import('eslint').Linter.Plugin & {
3
- configs: Record<string, { rules: import('eslint').Linter.RulesRecord }>;
4
- };
5
- export = plugin;
6
- }
@@ -1,3 +0,0 @@
1
- declare module 'eslint/config' {
2
- export function defineConfig(config: any): any;
3
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,153 +0,0 @@
1
- # TypeScript Config โ€” `@ovh-ux/manager-static-analysis-kit`
2
-
3
- This guide describes the TypeScript configuration layers provided by the `@ovh-ux/manager-static-analysis-kit`, supporting both standard and strict type safety modes for Node, React, and Testing environments.
4
-
5
- ---
6
-
7
- ## ๐Ÿ“ฆ Package Structure
8
-
9
- ```
10
- ts-config/
11
- โ”œโ”€โ”€ config/
12
- โ”‚ โ”œโ”€โ”€ standard/
13
- โ”‚ โ”‚ โ”œโ”€โ”€ tsconfig.node.ts
14
- โ”‚ โ”‚ โ”œโ”€โ”€ tsconfig.react.ts
15
- โ”‚ โ”‚ โ””โ”€โ”€ tsconfig.test.ts
16
- โ”‚ โ””โ”€โ”€ strict/
17
- โ”‚ โ”œโ”€โ”€ tsconfig.node.ts
18
- โ”‚ โ”œโ”€โ”€ tsconfig.react.ts
19
- โ”‚ โ””โ”€โ”€ tsconfig.test.ts
20
- โ”œโ”€โ”€ rules/
21
- โ”‚ โ”œโ”€โ”€ tsconfig.base.ts
22
- โ”‚ โ””โ”€โ”€ tsconfig.base.strict.ts
23
- โ””โ”€โ”€ README.md
24
- ```
25
-
26
- ---
27
-
28
- ## ๐Ÿงฉ Base Rule Sets
29
-
30
- ### `tsconfig.base.ts`
31
-
32
- A relaxed, default TypeScript ruleset including:
33
-
34
- - `strict: false`
35
- - `skipLibCheck: true`
36
- - `esModuleInterop: true`
37
- - `resolveJsonModule: true`
38
- - `jsx: preserve`
39
- - Includes DOM/ESNext lib targets
40
-
41
- ### `tsconfig.base.strict.ts`
42
-
43
- A stricter variant enabling full type-safety:
44
-
45
- - `strict: true`
46
- - `noUncheckedIndexedAccess: true`
47
- - `noImplicitOverride: true`
48
- - `exactOptionalPropertyTypes: true`
49
-
50
- ---
51
-
52
- ## ๐Ÿ”ง Config Variants
53
-
54
- Each environment has two variants: `standard` (base rules) and `strict` (stricter rules).
55
-
56
- | Purpose | Standard Config | Strict Config |
57
- |-------------|-------------------------------------------|-----------------------------------------|
58
- | React App | `tsconfig/react` | `tsconfig/react-strict` |
59
- | Node Scripts| `tsconfig/node` | `tsconfig/node-strict` |
60
- | Unit Tests | `tsconfig/test` | `tsconfig/test-strict` |
61
-
62
- These extend the appropriate base config and add contextual settings (e.g. `dom` lib for React, `node` lib for backend).
63
-
64
- ---
65
-
66
- ## ๐Ÿš€ Usage in ยต-Applications
67
-
68
- ### Example: Zimbra App
69
-
70
- ```jsonc
71
- {
72
- "extends": "@ovh-ux/manager-static-analysis-kit/tsconfig/react-strict",
73
- "compilerOptions": {
74
- "baseUrl": ".",
75
- "paths": {
76
- "@/public/*": ["./public/*"],
77
- "@/*": ["./src/*"]
78
- },
79
- "outDir": "dist",
80
- "allowJs": true
81
- },
82
- "include": [
83
- "src",
84
- "public/**/*.json"
85
- ],
86
- "exclude": [
87
- "node_modules",
88
- "dist",
89
- "types"
90
- ]
91
- }
92
- ```
93
-
94
- ---
95
-
96
- ## โœ๏ธ Extend & Compose Configs
97
-
98
- Each base or strict config can be used as-is or composed via `extends` in your app-level `tsconfig.json`.
99
-
100
- For example:
101
-
102
- ```json
103
- {
104
- "extends": "@ovh-ux/manager-static-analysis-kit/tsconfig/node-strict"
105
- }
106
- ```
107
-
108
- ---
109
-
110
- ## ๐Ÿ›  Compiler Features in Use
111
-
112
- All configurations benefit from:
113
-
114
- - Native ES Module support (`module: nodenext`)
115
- - JSX + TSX support (for React configs)
116
- - JSON module resolution
117
- - Local path mapping (`@/*`, `@/public/*`)
118
- - Out-of-the-box support for Vite
119
-
120
-
121
- ---
122
-
123
- ## โš™๏ธ Per-App Customization
124
-
125
- To ensure consistency while enabling per-app customization, applications may override the following:
126
-
127
- - `compilerOptions.paths`
128
- - `compilerOptions.outDir`
129
- - `compilerOptions.allowImportingTsExtensions` (only if required)
130
- - `compilerOptions.allowJs` (only if required)
131
- - `compilerOptions.resolveJsonModule` (only if required)
132
- - `compilerOptions.noImplicitAny` (only if required)
133
- - `include`
134
- - `exclude`
135
-
136
- ---
137
-
138
- ## โœ… Allowed Overrides for ยต-Apps
139
-
140
- To ensure consistency while enabling per-app customization, applications may override the following:
141
-
142
- - `compilerOptions.paths`
143
- - `compilerOptions.outDir`
144
- - `compilerOptions.allowImportingTsExtensions` (only if required)
145
- - `include`
146
- - `exclude`
147
-
148
- Apps **must not** redefine:
149
-
150
- - `target`, `module`, `jsx`, `strict`, `lib`, etc.
151
- - Any `strict`-level rules overridden by the base config
152
-
153
- This policy ensures a reliable shared base while supporting edge-case requirements per project.
@@ -1,13 +0,0 @@
1
- import { tsBaseConfig } from '../../rules/tsconfig.base';
2
-
3
- export default {
4
- ...tsBaseConfig,
5
- compilerOptions: {
6
- ...tsBaseConfig.compilerOptions,
7
- target: 'ES2022',
8
- module: 'NodeNext',
9
- moduleResolution: 'NodeNext',
10
- lib: ['ES2022'],
11
- types: ['node'],
12
- },
13
- };
@@ -1,15 +0,0 @@
1
- import { tsBaseConfig } from '../../rules/tsconfig.base';
2
-
3
- export default {
4
- ...tsBaseConfig,
5
- compilerOptions: {
6
- ...tsBaseConfig.compilerOptions,
7
- module: 'ESNext',
8
- moduleResolution: 'bundler',
9
- lib: ['DOM', 'DOM.Iterable', 'ES2021'],
10
- jsx: 'react-jsx',
11
- isolatedModules: true,
12
- noEmit: true,
13
- types: ['vite/client'],
14
- },
15
- };
@@ -1,13 +0,0 @@
1
- import { tsBaseConfig } from '../../rules/tsconfig.base';
2
-
3
- export default {
4
- ...tsBaseConfig,
5
- compilerOptions: {
6
- ...tsBaseConfig.compilerOptions,
7
- module: 'ESNext',
8
- moduleResolution: 'NodeNext',
9
- types: ['vitest/globals', 'vite/client', 'node', '@testing-library/jest-dom'],
10
- jsx: 'react-jsx',
11
- },
12
- include: ['**/*.test.ts', '**/*.test.tsx', '**/*.spec.ts', '**/*.spec.tsx', 'vitest.setup.ts'],
13
- };
@@ -1,13 +0,0 @@
1
- import { tsStrictBaseConfig } from '../../rules/tsconfig.base.strict';
2
-
3
- export default {
4
- ...tsStrictBaseConfig,
5
- compilerOptions: {
6
- ...tsStrictBaseConfig.compilerOptions,
7
- target: 'ES2022',
8
- module: 'NodeNext',
9
- moduleResolution: 'NodeNext',
10
- lib: ['ES2022'],
11
- types: ['node'],
12
- },
13
- };