@ovh-ux/manager-static-analysis-kit 0.2.0 → 0.3.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/CHANGELOG.md +11 -0
- package/bin/lint-cli.js +1 -1
- package/package.json +8 -5
- package/eslint.config.mjs +0 -53
- package/scripts/build.ts +0 -44
- package/src/adapters/code-health-meter/README.md +0 -1
- package/src/adapters/code-health-meter/config/.gitkeep +0 -0
- package/src/adapters/code-health-meter/rules/.gitkeep +0 -0
- package/src/adapters/eslint/README.md +0 -317
- package/src/adapters/eslint/config/eslint-shared-config.ts +0 -60
- package/src/adapters/eslint/rules/eslint-a11y.ts +0 -30
- package/src/adapters/eslint/rules/eslint-complexity.ts +0 -87
- package/src/adapters/eslint/rules/eslint-css.ts +0 -35
- package/src/adapters/eslint/rules/eslint-html.ts +0 -32
- package/src/adapters/eslint/rules/eslint-imports.ts +0 -84
- package/src/adapters/eslint/rules/eslint-javascript.ts +0 -27
- package/src/adapters/eslint/rules/eslint-naming-conventions.ts +0 -49
- package/src/adapters/eslint/rules/eslint-prettier.ts +0 -29
- package/src/adapters/eslint/rules/eslint-react.ts +0 -50
- package/src/adapters/eslint/rules/eslint-storybook.ts +0 -29
- package/src/adapters/eslint/rules/eslint-tailwind-jsx.ts +0 -21
- package/src/adapters/eslint/rules/eslint-tanstack.ts +0 -25
- package/src/adapters/eslint/rules/eslint-tests.ts +0 -35
- package/src/adapters/eslint/rules/eslint-typescript.ts +0 -33
- package/src/adapters/eslint/types/eslint-js.d.ts +0 -4
- package/src/adapters/eslint/types/eslint-plugin-jsx-a11y.d.ts +0 -16
- package/src/adapters/eslint/types/eslint-plugin-react-hooks.d.ts +0 -9
- package/src/adapters/eslint/types/eslint-plugin-react.d.ts +0 -9
- package/src/adapters/eslint/types/eslint-plugin-tailwindcss.d.ts +0 -6
- package/src/adapters/eslint/types/eslint-shared-config.d.ts +0 -3
- package/src/adapters/jscpd/README.md +0 -0
- package/src/adapters/jscpd/config/.gitkeep +0 -0
- package/src/adapters/jscpd/rules/.gitkeep +0 -0
- package/src/adapters/madge/README.md +0 -0
- package/src/adapters/madge/config/.gitkeep +0 -0
- package/src/adapters/madge/rules/.gitkeep +0 -0
- package/src/adapters/ts-config/README.md +0 -153
- package/src/adapters/ts-config/config/standard/tsconfig.node.ts +0 -13
- package/src/adapters/ts-config/config/standard/tsconfig.react.ts +0 -15
- package/src/adapters/ts-config/config/standard/tsconfig.test.ts +0 -13
- package/src/adapters/ts-config/config/strict/tsconfig.node.ts +0 -13
- package/src/adapters/ts-config/config/strict/tsconfig.react.ts +0 -15
- package/src/adapters/ts-config/config/strict/tsconfig.test.ts +0 -13
- package/src/adapters/ts-config/rules/tsconfig.base.strict.ts +0 -13
- package/src/adapters/ts-config/rules/tsconfig.base.ts +0 -17
- package/src/code-analysis.ts +0 -1
- package/src/configs/complexity-config.ts +0 -29
- package/src/configs/file-globs-config.ts +0 -22
- package/src/configs/import-order-config.ts +0 -12
- package/src/configs/jscpd-config.ts +0 -8
- package/src/configs/madge-config.ts +0 -8
- package/src/configs/naming-conventions-config.ts +0 -138
- package/src/configs/prettier-config.ts +0 -81
- package/src/configs/shared-exclusion-patterns.ts +0 -41
- package/tsconfig.json +0 -31
|
@@ -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
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { tsStrictBaseConfig } from '../../rules/tsconfig.base.strict';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
...tsStrictBaseConfig,
|
|
5
|
-
compilerOptions: {
|
|
6
|
-
...tsStrictBaseConfig.compilerOptions,
|
|
7
|
-
module: 'ESNext',
|
|
8
|
-
moduleResolution: 'bundler',
|
|
9
|
-
lib: ['DOM', 'DOM.Iterable', 'ES2020'],
|
|
10
|
-
jsx: 'react-jsx',
|
|
11
|
-
isolatedModules: true,
|
|
12
|
-
noEmit: true,
|
|
13
|
-
types: ['vite/client'],
|
|
14
|
-
},
|
|
15
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { tsStrictBaseConfig } from '../../rules/tsconfig.base.strict';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
...tsStrictBaseConfig,
|
|
5
|
-
compilerOptions: {
|
|
6
|
-
...tsStrictBaseConfig.compilerOptions,
|
|
7
|
-
module: 'ESNext',
|
|
8
|
-
moduleResolution: 'NodeNext',
|
|
9
|
-
jsx: 'react-jsx',
|
|
10
|
-
types: ['vitest/globals', 'vite/client', 'node'],
|
|
11
|
-
},
|
|
12
|
-
include: ['**/*.test.ts', '**/*.test.tsx', '**/*.spec.ts', '**/*.spec.tsx', 'vitest.setup.ts'],
|
|
13
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { tsBaseConfig } from './tsconfig.base';
|
|
2
|
-
|
|
3
|
-
export const tsStrictBaseConfig = {
|
|
4
|
-
...tsBaseConfig,
|
|
5
|
-
compilerOptions: {
|
|
6
|
-
...tsBaseConfig.compilerOptions,
|
|
7
|
-
strict: true,
|
|
8
|
-
noImplicitOverride: true,
|
|
9
|
-
noUncheckedIndexedAccess: true,
|
|
10
|
-
noFallthroughCasesInSwitch: true,
|
|
11
|
-
noUnusedParameters: true,
|
|
12
|
-
},
|
|
13
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export const tsBaseConfig = {
|
|
2
|
-
$schema: 'https://json.schemastore.org/tsconfig',
|
|
3
|
-
compilerOptions: {
|
|
4
|
-
target: 'ES2020',
|
|
5
|
-
module: 'ESNext',
|
|
6
|
-
skipLibCheck: true,
|
|
7
|
-
forceConsistentCasingInFileNames: true,
|
|
8
|
-
esModuleInterop: true,
|
|
9
|
-
allowSyntheticDefaultImports: true,
|
|
10
|
-
declaration: true,
|
|
11
|
-
declarationMap: true,
|
|
12
|
-
removeComments: true,
|
|
13
|
-
composite: true,
|
|
14
|
-
incremental: true,
|
|
15
|
-
baseUrl: '.',
|
|
16
|
-
},
|
|
17
|
-
};
|
package/src/code-analysis.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { eslintSharedConfig } from './adapters/eslint/config/eslint-shared-config';
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Code complexity thresholds for different file types.
|
|
3
|
-
* These values are used to enforce maintainable, readable code.
|
|
4
|
-
*/
|
|
5
|
-
export const complexityRules = {
|
|
6
|
-
/** Max nesting depth */
|
|
7
|
-
maxDepth: 4,
|
|
8
|
-
|
|
9
|
-
/** Max number of function parameters */
|
|
10
|
-
maxParams: 4,
|
|
11
|
-
|
|
12
|
-
/** Max nested callbacks */
|
|
13
|
-
maxCallbacks: 3,
|
|
14
|
-
|
|
15
|
-
/** Statement limits by file type */
|
|
16
|
-
statements: {
|
|
17
|
-
tsJs: 20,
|
|
18
|
-
tsxJsx: 50,
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
/** Lines per file (uniform for all) */
|
|
22
|
-
maxLines: 300,
|
|
23
|
-
|
|
24
|
-
/** Lines per function by file type */
|
|
25
|
-
linesPerFunction: {
|
|
26
|
-
tsJs: 50,
|
|
27
|
-
tsxJsx: 250,
|
|
28
|
-
},
|
|
29
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Common file glob patterns used in ESLint Flat Config.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
export const allModules = '**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx,mjsx,mtsx}';
|
|
6
|
-
|
|
7
|
-
export const jsFiles = '**/*.{js,mjs,cjs}';
|
|
8
|
-
export const tsFiles = '**/*.{ts,tsx}';
|
|
9
|
-
export const jsxTsxFiles = '**/*.{jsx,tsx}';
|
|
10
|
-
export const jsTsFiles = '**/*.{js,jsx,ts,tsx}';
|
|
11
|
-
export const jsFilesLoose = '**/*.{js,jsx}';
|
|
12
|
-
|
|
13
|
-
export const cssFiles = '**/*.{scss,css}';
|
|
14
|
-
export const htmlFiles = '**/*.html';
|
|
15
|
-
|
|
16
|
-
export const storyFiles = '**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)';
|
|
17
|
-
export const testFiles = ['**/*.{test,spec}.{ts,tsx,js,jsx}', '**/__tests__/**/*.{ts,tsx,js,jsx}'];
|
|
18
|
-
|
|
19
|
-
export const commonTextFiles = '**/*.{ts,tsx,js,jsx,json,yml,yaml,md}';
|
|
20
|
-
export const jsonFiles = '**/*.json';
|
|
21
|
-
export const yamlFiles = '**/*.{yml,yaml}';
|
|
22
|
-
export const markdownFiles = '**/*.md';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Configuration for the import order sorting rule.
|
|
3
|
-
*/
|
|
4
|
-
export const importOrderConfig = [
|
|
5
|
-
'^react$', // React always first
|
|
6
|
-
'^react(-dom|-router-dom)?$', // React-related packages
|
|
7
|
-
'<THIRD_PARTY_MODULES>', // External libraries
|
|
8
|
-
'^@ovhcloud/(.*)$', // OVH ODS design system
|
|
9
|
-
'^@ovh-ux/(.*)$', // OVH shared components
|
|
10
|
-
'^@/(.*)$', // Aliased internal modules
|
|
11
|
-
'^[./]', // Relative imports last
|
|
12
|
-
];
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { sharedExclusionPatterns } from './shared-exclusion-patterns';
|
|
2
|
-
|
|
3
|
-
export const madgeDefaultOptions = {
|
|
4
|
-
fileExtensions: ['ts', 'tsx', 'js', 'jsx'],
|
|
5
|
-
excludeRegExp: sharedExclusionPatterns.map((glob) =>
|
|
6
|
-
glob.replace(/\*\*/g, '.*').replace(/\*/g, '.*'),
|
|
7
|
-
),
|
|
8
|
-
};
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Disallowed filename patterns.
|
|
3
|
-
* Used by: `check-file/filename-blocklist`
|
|
4
|
-
*/
|
|
5
|
-
export const filenameBlocklist: Record<string, string> = {
|
|
6
|
-
// '**/*.model.ts': '*.models.ts',
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Enforces folder placement per file type.
|
|
11
|
-
* Used by: `check-file/folder-match-with-fex`
|
|
12
|
-
*/
|
|
13
|
-
export const folderMatchWithFex: Record<string, string> = {
|
|
14
|
-
// ─────────── TRANSLATIONS ───────────
|
|
15
|
-
'public/translations/*/Messages_*.json': 'public/translations/**/',
|
|
16
|
-
'src/components/**/translations/Messages_*.json': 'src/components/**/translations/',
|
|
17
|
-
|
|
18
|
-
// ─────────── COMPONENTS (allowed in components/ or pages/) ───────────
|
|
19
|
-
'src/components/**/*.component.{js,jsx,ts,tsx}': 'src/components/**/',
|
|
20
|
-
'src/pages/**/*.component.{js,jsx,ts,tsx}': 'src/pages/**/',
|
|
21
|
-
|
|
22
|
-
// ─────────── PAGES ───────────
|
|
23
|
-
'**/*.page.{js,jsx,ts,tsx}': 'src/pages/**/',
|
|
24
|
-
'**/*.layout.{js,jsx,ts,tsx}': 'src/pages/**/',
|
|
25
|
-
'**/*.modal.{js,jsx,ts,tsx}': 'src/pages/**/',
|
|
26
|
-
|
|
27
|
-
// ─────────── HOOKS ───────────
|
|
28
|
-
'src/hooks/**/use*.{ts}': 'src/hooks/**/',
|
|
29
|
-
'src/data/hooks/**/use*.{ts}': 'src/data/hooks/**/',
|
|
30
|
-
|
|
31
|
-
// ─────────── TESTS ───────────
|
|
32
|
-
'**/*.test.{ts,tsx}': '**/__tests__/',
|
|
33
|
-
'**/*.spec.{ts,tsx}': '**/__tests__/',
|
|
34
|
-
|
|
35
|
-
// ─────────── CONSTANTS ───────────
|
|
36
|
-
'**/*.constants.{ts,js}': 'src/**/',
|
|
37
|
-
|
|
38
|
-
// ─────────── TYPES & INTERFACES ───────────
|
|
39
|
-
'**/*.type.ts': 'src/**/',
|
|
40
|
-
'**/*.interface.ts': 'src/**/',
|
|
41
|
-
|
|
42
|
-
// ─────────── ROUTES ───────────
|
|
43
|
-
'src/routes/routes.{ts,tsx}': 'src/routes/**',
|
|
44
|
-
'**/routes.constants.ts': 'src/routes/**',
|
|
45
|
-
|
|
46
|
-
// ─────────── ASSETS ───────────
|
|
47
|
-
'public/assets/**/*.{png,jpg,jpeg,json,svg,webp,gif}': 'public/assets/**/',
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Naming conventions by file type.
|
|
52
|
-
*/
|
|
53
|
-
type CaseStyle =
|
|
54
|
-
| 'PASCAL_CASE'
|
|
55
|
-
| 'CAMEL_CASE'
|
|
56
|
-
| 'KEBAB_CASE'
|
|
57
|
-
| 'SCREAMING_SNAKE_CASE'
|
|
58
|
-
| 'FLAT_CASE'
|
|
59
|
-
| 'SNAKE_CASE';
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Enforces naming conventions for files.
|
|
63
|
-
* Used by: `check-file/filename-naming-convention`
|
|
64
|
-
*/
|
|
65
|
-
export const filenameNamingConvention: Record<string, CaseStyle> = {
|
|
66
|
-
// ───── COMPONENT STRUCTURE ─────
|
|
67
|
-
'**/*.component.{ts,tsx}': 'PASCAL_CASE',
|
|
68
|
-
'**/*.layout.{ts,tsx}': 'PASCAL_CASE',
|
|
69
|
-
'**/*.modal.{ts,tsx}': 'PASCAL_CASE',
|
|
70
|
-
'**/*.page.{ts,tsx}': 'PASCAL_CASE',
|
|
71
|
-
|
|
72
|
-
// ───── CORE FILES ─────
|
|
73
|
-
'**/App.tsx': 'PASCAL_CASE',
|
|
74
|
-
'**/ErrorBoundary.tsx': 'PASCAL_CASE',
|
|
75
|
-
'**/queryClient.ts': 'CAMEL_CASE',
|
|
76
|
-
|
|
77
|
-
// ───── GENERAL TESTS ─────
|
|
78
|
-
'**/*.test.{ts,tsx}': 'PASCAL_CASE',
|
|
79
|
-
'**/*.spec.{ts,tsx}': 'PASCAL_CASE',
|
|
80
|
-
|
|
81
|
-
// ───── HOOKS ─────
|
|
82
|
-
'src/hooks/**/use*.{ts}': 'PASCAL_CASE',
|
|
83
|
-
'src/data/hooks/**/use*.{ts}': 'PASCAL_CASE',
|
|
84
|
-
|
|
85
|
-
// ───── HOOKS TESTS ─────
|
|
86
|
-
'src/hooks/**/use*.spec.{ts,tsx}': 'PASCAL_CASE',
|
|
87
|
-
'src/hooks/**/use*.test.{ts,tsx}': 'PASCAL_CASE',
|
|
88
|
-
'src/data/hooks/**/use*.spec.{ts,tsx}': 'PASCAL_CASE',
|
|
89
|
-
'src/data/hooks/**/use*.test.{ts,tsx}': 'PASCAL_CASE',
|
|
90
|
-
|
|
91
|
-
// ───── STYLES ─────
|
|
92
|
-
'**/*.scss': 'KEBAB_CASE',
|
|
93
|
-
'**/*.css': 'KEBAB_CASE',
|
|
94
|
-
|
|
95
|
-
// ───── TRANSLATIONS ─────
|
|
96
|
-
'**/Messages_[a-z][a-z]_[A-Z][A-Z].json': 'SCREAMING_SNAKE_CASE',
|
|
97
|
-
|
|
98
|
-
// ───── TYPES & CONSTANTS ─────
|
|
99
|
-
'**/*.constants.{ts,js}': 'PASCAL_CASE',
|
|
100
|
-
'**/*.type.ts': 'PASCAL_CASE',
|
|
101
|
-
'**/*.interface.ts': 'PASCAL_CASE',
|
|
102
|
-
|
|
103
|
-
// ───── BOOTSTRAP & CONFIGS ─────
|
|
104
|
-
'**/routes.{ts,tsx}': 'KEBAB_CASE',
|
|
105
|
-
'**/routes.constants.ts': 'KEBAB_CASE',
|
|
106
|
-
'**/main.tsx': 'KEBAB_CASE',
|
|
107
|
-
'**/i18n.ts': 'KEBAB_CASE',
|
|
108
|
-
'**/index.{ts,tsx,js}': 'KEBAB_CASE',
|
|
109
|
-
'**/*.config.{js,ts,mjs,cjs}': 'KEBAB_CASE',
|
|
110
|
-
'**/*.setup.{js,ts}': 'KEBAB_CASE',
|
|
111
|
-
'**/*.env.{js,ts}': 'KEBAB_CASE',
|
|
112
|
-
|
|
113
|
-
// ───── PROPS ─────
|
|
114
|
-
'**/*.props.{ts,tsx}': 'PASCAL_CASE',
|
|
115
|
-
|
|
116
|
-
// ───── STORIES ─────
|
|
117
|
-
'**/*.stories.{ts,tsx}': 'PASCAL_CASE',
|
|
118
|
-
|
|
119
|
-
// ───── UTILS ─────
|
|
120
|
-
'**/*.utils.{ts,tsx}': 'PASCAL_CASE',
|
|
121
|
-
|
|
122
|
-
// ───── HELPERS ─────
|
|
123
|
-
'**/*.helper.ts': 'PASCAL_CASE',
|
|
124
|
-
|
|
125
|
-
// ───── PROVIDERS ─────
|
|
126
|
-
'**/*.provider.tsx': 'PASCAL_CASE',
|
|
127
|
-
|
|
128
|
-
// ───── API CLIENTS ─────
|
|
129
|
-
'**/*.api.ts': 'PASCAL_CASE',
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Global folder naming convention.
|
|
134
|
-
* Used by: `check-file/folder-naming-convention`
|
|
135
|
-
*/
|
|
136
|
-
export const folderNamingConvention: Record<string, 'KEBAB_CASE'> = {
|
|
137
|
-
'**/': 'KEBAB_CASE',
|
|
138
|
-
};
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { dirname, resolve } from 'path';
|
|
2
|
-
import { cwd } from 'process';
|
|
3
|
-
import { fileURLToPath } from 'url';
|
|
4
|
-
|
|
5
|
-
import { importOrderConfig } from './import-order-config';
|
|
6
|
-
|
|
7
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Dynamically resolve the Tailwind config from the current working directory.
|
|
11
|
-
* This allows Prettier plugins to align with the context of each app or package.
|
|
12
|
-
*/
|
|
13
|
-
const tailwindConfigPath = resolve(cwd(), 'tailwind.config.js');
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Absolute path to the Prettier plugin for sorting Tailwind CSS classes.
|
|
17
|
-
*/
|
|
18
|
-
const tailwindPrettierPluginPath = resolve(
|
|
19
|
-
__dirname,
|
|
20
|
-
'../../node_modules/prettier-plugin-tailwindcss/dist/index.mjs',
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Absolute path to the Prettier plugin for sorting imports using Trivago's strategy.
|
|
25
|
-
*/
|
|
26
|
-
const trivagoImportSortPluginPath = resolve(
|
|
27
|
-
__dirname,
|
|
28
|
-
'../../node_modules/@trivago/prettier-plugin-sort-imports/lib/src/index.js',
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Glob patterns for files and folders to exclude from Prettier formatting.
|
|
33
|
-
* Applied to both Prettier CLI and editor integrations.
|
|
34
|
-
*/
|
|
35
|
-
export const prettierIgnorePatterns = [
|
|
36
|
-
'**/dist/**',
|
|
37
|
-
'**/custom-elements*/**',
|
|
38
|
-
'**/loader/**',
|
|
39
|
-
'**/react/**',
|
|
40
|
-
'**/vue/**',
|
|
41
|
-
'**/apps/container/**',
|
|
42
|
-
'**/apps/pci-databases-analytics/src/components/ui/**',
|
|
43
|
-
'**/apps/pci-databases-analytics/src/lib/utils.ts',
|
|
44
|
-
];
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Shared Prettier configuration used by both CLI and eslint-plugin-prettier.
|
|
48
|
-
*
|
|
49
|
-
* @see https://prettier.io/docs/en/options.html
|
|
50
|
-
* @see https://github.com/prettier/prettier-plugin-tailwindcss
|
|
51
|
-
* @see https://github.com/trivago/prettier-plugin-sort-imports
|
|
52
|
-
*/
|
|
53
|
-
export const prettierConfig = {
|
|
54
|
-
semi: true,
|
|
55
|
-
singleQuote: true,
|
|
56
|
-
trailingComma: 'all',
|
|
57
|
-
printWidth: 100,
|
|
58
|
-
tabWidth: 2,
|
|
59
|
-
arrowParens: 'always',
|
|
60
|
-
endOfLine: 'lf',
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Prettier plugins must use absolute paths when executed via ESLint integration.
|
|
64
|
-
*/
|
|
65
|
-
plugins: [tailwindPrettierPluginPath, trivagoImportSortPluginPath],
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Tailwind-related options to sort classnames and recognize utility calls.
|
|
69
|
-
*/
|
|
70
|
-
tailwindConfig: tailwindConfigPath,
|
|
71
|
-
tailwindFunctions: ['clsx', 'tw'],
|
|
72
|
-
tailwindAttributes: ['classList'],
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Custom import sorting rules (used by trivago plugin).
|
|
76
|
-
* These control grouping and order of import blocks.
|
|
77
|
-
*/
|
|
78
|
-
importOrder: importOrderConfig,
|
|
79
|
-
importOrderSeparation: true,
|
|
80
|
-
importOrderSortSpecifiers: true,
|
|
81
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared glob/regex patterns used to exclude generated, test, or config files
|
|
3
|
-
* from static analysis (e.g., madge, duplication checks).
|
|
4
|
-
*/
|
|
5
|
-
export const sharedExclusionPatterns = [
|
|
6
|
-
'**/node_modules/**',
|
|
7
|
-
'**/target/**',
|
|
8
|
-
'**/dist/**',
|
|
9
|
-
'**/.next/**',
|
|
10
|
-
'**/next*/**',
|
|
11
|
-
'**/.husky/**',
|
|
12
|
-
'**/.vscode/**',
|
|
13
|
-
'**/.idea/**',
|
|
14
|
-
'**/.gitlab/**',
|
|
15
|
-
'**/.github/**',
|
|
16
|
-
'**/.eslintrc.*',
|
|
17
|
-
'**/eslint*.*',
|
|
18
|
-
'**/jest*.*',
|
|
19
|
-
'**/webpack*.*',
|
|
20
|
-
'**/babel*.*',
|
|
21
|
-
'**/tailwind*.*',
|
|
22
|
-
'**/tsconfig.json',
|
|
23
|
-
'**/turbo.json',
|
|
24
|
-
'**/__tests__/**',
|
|
25
|
-
'**/__test__/**',
|
|
26
|
-
'**/tests/**',
|
|
27
|
-
'**/test*/**',
|
|
28
|
-
'**/**test.*',
|
|
29
|
-
'**/**Test**',
|
|
30
|
-
'**/spec*.*',
|
|
31
|
-
'**/mock*/**',
|
|
32
|
-
'**/mocks/**',
|
|
33
|
-
'**/_mock_/**',
|
|
34
|
-
'**/**Mock**/**',
|
|
35
|
-
'**/*.types.*',
|
|
36
|
-
'**/*.d.ts.*',
|
|
37
|
-
'**/*.svg',
|
|
38
|
-
'**/**hmr**',
|
|
39
|
-
'**/**config**',
|
|
40
|
-
'**/**cucumber**',
|
|
41
|
-
];
|
package/tsconfig.json
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
/* Emit */
|
|
4
|
-
"outDir": "dist",
|
|
5
|
-
"declaration": true,
|
|
6
|
-
"emitDeclarationOnly": false,
|
|
7
|
-
"declarationMap": true,
|
|
8
|
-
"removeComments": true,
|
|
9
|
-
|
|
10
|
-
/* Language & Modules */
|
|
11
|
-
"target": "ESNext",
|
|
12
|
-
"module": "ESNext",
|
|
13
|
-
"moduleResolution": "node",
|
|
14
|
-
"esModuleInterop": true,
|
|
15
|
-
"forceConsistentCasingInFileNames": true,
|
|
16
|
-
"strict": true,
|
|
17
|
-
|
|
18
|
-
/* Interop & Module Output */
|
|
19
|
-
"allowSyntheticDefaultImports": true,
|
|
20
|
-
"incremental": true,
|
|
21
|
-
|
|
22
|
-
/* Type Declarations */
|
|
23
|
-
"skipLibCheck": true,
|
|
24
|
-
|
|
25
|
-
/* Custom Types */
|
|
26
|
-
"types": ["node"],
|
|
27
|
-
"typeRoots": ["./src/adapters/eslint/types", "./node_modules/@types"]
|
|
28
|
-
},
|
|
29
|
-
"include": ["src"],
|
|
30
|
-
"exclude": ["node_modules", "dist", "types"]
|
|
31
|
-
}
|