tz-clean 2.3.1 → 2.3.3

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-USER.md CHANGED
@@ -1,105 +1,105 @@
1
- # User Guide: tz-clean 📖
2
-
3
- This guide provides instructions on how to install and use the `tz-clean` CLI tool in your projects.
4
-
5
- ## Prerequisites
6
-
7
- - **Node.js** installed on your machine.
8
- - A `tsconfig.json` file must exist in the root of the project where you run this tool (required for the typechecking step).
9
-
10
- ## Installation
11
-
12
- Install globally using npm to use it across all your projects:
13
-
14
- ```bash
15
- npm install -g tz-clean
16
- ```
17
-
18
- To update to the latest version:
19
-
20
- ```bash
21
- npm install -g tz-clean@latest
22
- ```
23
-
24
- ## Usage
25
-
26
- Navigate to any project directory and run:
27
-
28
- ```bash
29
- tz-clean
30
- ```
31
-
32
- ### Skipping Specific Tools
33
-
34
- Disable any of the integrated tools with the corresponding flag:
35
-
36
- | Flag | Description |
37
- |---|---|
38
- | `--no-prettier` | Disables auto-formatting with Prettier |
39
- | `--no-eslint` | Disables linting and auto-fixing with ESLint |
40
- | `--no-typecheck` | Disables TypeScript validation |
41
-
42
- ```bash
43
- tz-clean --no-prettier --no-typecheck
44
- ```
45
-
46
- ### Including Specific Paths
47
-
48
- Use `--include` to run the tools only on specific files or directories (comma-separated):
49
-
50
- ```bash
51
- # Analyze only the src folder
52
- tz-clean --include src
53
-
54
- # Analyze multiple folders
55
- tz-clean --include src,app,lib
56
- ```
57
-
58
- ### Excluding Specific Paths
59
-
60
- Use `--exclude` to skip files or directories (comma-separated):
61
-
62
- ```bash
63
- # Exclude a single folder
64
- tz-clean --exclude js/libs
65
-
66
- # Exclude multiple folders
67
- tz-clean --exclude js/libs,dist,vendor
68
- ```
69
-
70
- ### Combining Options
71
-
72
- All flags can be combined freely:
73
-
74
- ```bash
75
- # Analyze only src, skip typecheck
76
- tz-clean --include src --no-typecheck
77
-
78
- # Exclude generated files, skip prettier
79
- tz-clean --exclude dist,vendor --no-prettier
80
-
81
- # Include specific folder and exclude a subfolder within it
82
- tz-clean --include src --exclude src/generated
83
- ```
84
-
85
- ### What It Does
86
-
87
- The tool runs the following tasks sequentially (unless disabled):
88
-
89
- 1. **Prettier** — Formats your code for consistent styling.
90
- 2. **ESLint** — Lints and auto-fixes fixable issues.
91
- 3. **TypeScript Validation** — Runs `tsc --noEmit` to check for type errors.
92
-
93
- Files in the following locations are always skipped automatically:
94
-
95
- - `node_modules/`
96
- - `dist/`, `build/`, `vendor/`, `libs/`
97
- - Any file matching `*.min.js` or `*.min.cjs`
98
-
99
- ### Viewing the Report
100
-
101
- After analysis, you will be prompted to choose how to view the results:
102
-
103
- 1. **Terminal Summary** — A quick overview printed in your terminal, including auto-fixed files and detailed error logs.
104
- 2. **UI Dashboard (Browser)** — Generates an HTML report and opens it automatically in your default browser.
105
- 3. **UI Dashboard (Hosted)** — Starts a local server on port `8080` and opens `http://localhost:8080` in your browser.
1
+ # User Guide: tz-clean 📖
2
+
3
+ This guide provides instructions on how to install and use the `tz-clean` CLI tool in your projects.
4
+
5
+ ## Prerequisites
6
+
7
+ - **Node.js** installed on your machine.
8
+ - A `tsconfig.json` file must exist in the root of the project where you run this tool (required for the typechecking step).
9
+
10
+ ## Installation
11
+
12
+ Install globally using npm to use it across all your projects:
13
+
14
+ ```bash
15
+ npm install -g tz-clean
16
+ ```
17
+
18
+ To update to the latest version:
19
+
20
+ ```bash
21
+ npm install -g tz-clean@latest
22
+ ```
23
+
24
+ ## Usage
25
+
26
+ Navigate to any project directory and run:
27
+
28
+ ```bash
29
+ tz-clean
30
+ ```
31
+
32
+ ### Skipping Specific Tools
33
+
34
+ Disable any of the integrated tools with the corresponding flag:
35
+
36
+ | Flag | Description |
37
+ | ---------------- | -------------------------------------------- |
38
+ | `--no-prettier` | Disables auto-formatting with Prettier |
39
+ | `--no-eslint` | Disables linting and auto-fixing with ESLint |
40
+ | `--no-typecheck` | Disables TypeScript validation |
41
+
42
+ ```bash
43
+ tz-clean --no-prettier --no-typecheck
44
+ ```
45
+
46
+ ### Including Specific Paths
47
+
48
+ Use `--include` to run the tools only on specific files or directories (comma-separated):
49
+
50
+ ```bash
51
+ # Analyze only the src folder
52
+ tz-clean --include src
53
+
54
+ # Analyze multiple folders
55
+ tz-clean --include src,app,lib
56
+ ```
57
+
58
+ ### Excluding Specific Paths
59
+
60
+ Use `--exclude` to skip files or directories (comma-separated):
61
+
62
+ ```bash
63
+ # Exclude a single folder
64
+ tz-clean --exclude js/libs
65
+
66
+ # Exclude multiple folders
67
+ tz-clean --exclude js/libs,dist,vendor
68
+ ```
69
+
70
+ ### Combining Options
71
+
72
+ All flags can be combined freely:
73
+
74
+ ```bash
75
+ # Analyze only src, skip typecheck
76
+ tz-clean --include src --no-typecheck
77
+
78
+ # Exclude generated files, skip prettier
79
+ tz-clean --exclude dist,vendor --no-prettier
80
+
81
+ # Include specific folder and exclude a subfolder within it
82
+ tz-clean --include src --exclude src/generated
83
+ ```
84
+
85
+ ### What It Does
86
+
87
+ The tool runs the following tasks sequentially (unless disabled):
88
+
89
+ 1. **Prettier** — Formats your code for consistent styling.
90
+ 2. **ESLint** — Lints and auto-fixes fixable issues.
91
+ 3. **TypeScript Validation** — Runs `tsc --noEmit` to check for type errors.
92
+
93
+ Files in the following locations are always skipped automatically:
94
+
95
+ - `node_modules/`
96
+ - `dist/`, `build/`, `vendor/`, `libs/`
97
+ - Any file matching `*.min.js` or `*.min.cjs`
98
+
99
+ ### Viewing the Report
100
+
101
+ After analysis, you will be prompted to choose how to view the results:
102
+
103
+ 1. **Terminal Summary** — A quick overview printed in your terminal, including auto-fixed files and detailed error logs.
104
+ 2. **UI Dashboard (Browser)** — Generates an HTML report and opens it automatically in your default browser.
105
+ 3. **UI Dashboard (Hosted)** — Starts a local server on port `8080` and opens `http://localhost:8080` in your browser.
package/README.md CHANGED
@@ -1,16 +1,16 @@
1
- # tz-clean 🧹
2
-
3
- A global command-line utility to enforce consistent code quality across your projects. It automatically formats your code with **Prettier**, lints and fixes it with **ESLint**, and performs typechecking with **TypeScript**.
4
-
5
- ## Features
6
-
7
- - **Prettier**: Formats all supported files in the target directory.
8
- - **ESLint**: Lints and automatically fixes errors using the bundled configuration.
9
- - **TypeScript**: Performs a type check (`tsc --noEmit`) to ensure type safety.
10
-
11
- ## Documentation
12
-
13
- For more detailed information, please refer to the specific guides:
14
-
15
- - 📖 **[User Guide](./README-USER.md)**: Installation, prerequisites, and usage instructions for end-users.
16
- - 🛠️ **[Developer Guide](./README-DEV.md)**: Instructions for contributing, local testing, and publishing.
1
+ # tz-clean 🧹
2
+
3
+ A global command-line utility to enforce consistent code quality across your projects. It automatically formats your code with **Prettier**, lints and fixes it with **ESLint**, and performs typechecking with **TypeScript**.
4
+
5
+ ## Features
6
+
7
+ - **Prettier**: Formats all supported files in the target directory.
8
+ - **ESLint**: Lints and automatically fixes errors using the bundled configuration.
9
+ - **TypeScript**: Performs a type check (`tsc --noEmit`) to ensure type safety.
10
+
11
+ ## Documentation
12
+
13
+ For more detailed information, please refer to the specific guides:
14
+
15
+ - 📖 **[User Guide](./README-USER.md)**: Installation, prerequisites, and usage instructions for end-users.
16
+ - 🛠️ **[Developer Guide](./README-DEV.md)**: Instructions for contributing, local testing, and publishing.
@@ -1,8 +1,8 @@
1
- import { describe, expect, it } from 'vitest';
2
-
3
- describe('tz-clean CLI environment', () => {
4
- it('should have Vitest configured correctly', () => {
5
- const tools = ['Prettier', 'ESLint'];
6
- expect(tools.includes('ESLint')).toBe(true);
7
- });
8
- });
1
+ import { describe, expect, it } from 'vitest';
2
+
3
+ describe('tz-clean CLI environment', () => {
4
+ it('should have Vitest configured correctly', () => {
5
+ const tools = ['Prettier', 'ESLint'];
6
+ expect(tools.includes('ESLint')).toBe(true);
7
+ });
8
+ });
@@ -1 +1 @@
1
- export default { extends: ['@commitlint/config-conventional'] };
1
+ export default { extends: ['@commitlint/config-conventional'] };
package/cspell.json CHANGED
@@ -1,33 +1,33 @@
1
- {
2
- "version": "0.2",
3
- "language": "en",
4
- "words": [
5
- "terzogenito",
6
- "vitest",
7
- "depcruise",
8
- "typecheck",
9
- "jsdoc",
10
- "eslint",
11
- "prettier",
12
- "husky",
13
- "sonarjs",
14
- "tseslint",
15
- "commitlint",
16
- "cjs",
17
- "mjs",
18
- "prompts",
19
- "ecma",
20
- "typeof",
21
- "argv"
22
- ],
23
- "ignorePaths": [
24
- "node_modules",
25
- ".git",
26
- "package-lock.json",
27
- "coverage",
28
- ".tz-clean-report.html",
29
- ".husky",
30
- "dist",
31
- "**/*.md"
32
- ]
33
- }
1
+ {
2
+ "version": "0.2",
3
+ "language": "en",
4
+ "words": [
5
+ "terzogenito",
6
+ "vitest",
7
+ "depcruise",
8
+ "typecheck",
9
+ "jsdoc",
10
+ "eslint",
11
+ "prettier",
12
+ "husky",
13
+ "sonarjs",
14
+ "tseslint",
15
+ "commitlint",
16
+ "cjs",
17
+ "mjs",
18
+ "prompts",
19
+ "ecma",
20
+ "typeof",
21
+ "argv"
22
+ ],
23
+ "ignorePaths": [
24
+ "node_modules",
25
+ ".git",
26
+ "package-lock.json",
27
+ "coverage",
28
+ ".tz-clean-report.html",
29
+ ".husky",
30
+ "dist",
31
+ "**/*.md"
32
+ ]
33
+ }
package/eslint.config.mjs CHANGED
@@ -1,71 +1,72 @@
1
- import js from '@eslint/js';
2
- import jsdoc from 'eslint-plugin-jsdoc';
3
- import noComments from 'eslint-plugin-no-comments';
4
- import perfectionist from 'eslint-plugin-perfectionist';
5
- import projectStructure from 'eslint-plugin-project-structure';
6
- import sonarjs from 'eslint-plugin-sonarjs';
7
- import globals from 'globals';
8
- import tseslint from 'typescript-eslint';
9
-
10
- export default [
11
- {
12
- ignores: [
13
- '**/node_modules/**',
14
- '**/*.min.js',
15
- '**/*.min.cjs',
16
- '**/*.bundle.js',
17
- '**/dist/**',
18
- '**/build/**',
19
- '**/vendor/**',
20
- '**/libs/**',
21
- ],
22
- },
23
- js.configs.recommended,
24
- ...tseslint.configs.recommended,
25
- sonarjs.configs.recommended,
26
- jsdoc.configs['flat/recommended'],
27
- perfectionist.configs['recommended-natural'],
28
- {
29
- linterOptions: {
30
- reportUnusedDisableDirectives: 'error',
31
- },
32
- languageOptions: {
33
- ecmaVersion: 2022,
34
- globals: {
35
- ...globals.browser,
36
- ...globals.node,
37
- ...globals.jquery,
38
- console: 'readonly',
39
- document: 'readonly',
40
- module: 'readonly',
41
- window: 'readonly',
42
- },
43
- sourceType: 'module',
44
- },
45
- plugins: {
46
- 'no-comments': noComments,
47
- 'project-structure': projectStructure,
48
- },
49
- rules: {
50
- '@typescript-eslint/naming-convention': [
51
- 'error',
52
- { format: ['camelCase'], selector: 'default' },
53
- { format: ['camelCase', 'UPPER_CASE'], leadingUnderscore: 'allow', selector: 'variable' },
54
- { format: ['camelCase'], leadingUnderscore: 'allow', selector: 'parameter' },
55
- { format: ['PascalCase'], selector: 'typeLike' },
56
- { format: null, selector: 'objectLiteralProperty' },
57
- ],
58
- complexity: ['warn', { max: 15 }],
59
- 'jsdoc/require-jsdoc': 'warn',
60
- 'jsdoc/require-param': 'warn',
61
- 'jsdoc/require-returns': 'warn',
62
- 'no-comments/disallowComments': 'warn',
63
- 'no-multiple-empty-lines': ['error', { max: 1, maxBOF: 0, maxEOF: 0 }],
64
- 'no-redeclare': 'off',
65
- 'no-undef': 'off',
66
- 'no-unused-vars': ['error', { args: 'none', vars: 'local' }],
67
- 'no-useless-assignment': 'off',
68
- 'no-useless-escape': 'off',
69
- },
70
- },
71
- ];
1
+ import js from '@eslint/js';
2
+ import noComments from 'eslint-plugin-no-comments';
3
+ import perfectionist from 'eslint-plugin-perfectionist';
4
+ import projectStructure from 'eslint-plugin-project-structure';
5
+ import sonarjs from 'eslint-plugin-sonarjs';
6
+ import globals from 'globals';
7
+ import tseslint from 'typescript-eslint';
8
+
9
+ export default [
10
+ {
11
+ ignores: [
12
+ '**/node_modules/**',
13
+ '**/*.min.js',
14
+ '**/*.min.cjs',
15
+ '**/*.bundle.js',
16
+ '**/dist/**',
17
+ '**/build/**',
18
+ '**/vendor/**',
19
+ '**/libs/**',
20
+ ],
21
+ },
22
+ js.configs.recommended,
23
+ ...tseslint.configs.recommended,
24
+ sonarjs.configs.recommended,
25
+ perfectionist.configs['recommended-natural'],
26
+ {
27
+ files: ['index.js'],
28
+ rules: {
29
+ 'no-comments/disallowComments': 'off',
30
+ },
31
+ },
32
+ {
33
+ languageOptions: {
34
+ ecmaVersion: 2022,
35
+ globals: {
36
+ ...globals.browser,
37
+ ...globals.node,
38
+ ...globals.jquery,
39
+ console: 'readonly',
40
+ document: 'readonly',
41
+ module: 'readonly',
42
+ window: 'readonly',
43
+ },
44
+ sourceType: 'module',
45
+ },
46
+ linterOptions: {
47
+ reportUnusedDisableDirectives: 'error',
48
+ },
49
+ plugins: {
50
+ 'no-comments': noComments,
51
+ 'project-structure': projectStructure,
52
+ },
53
+ rules: {
54
+ '@typescript-eslint/naming-convention': [
55
+ 'error',
56
+ { format: ['camelCase'], selector: 'default' },
57
+ { format: ['camelCase', 'UPPER_CASE'], leadingUnderscore: 'allow', selector: 'variable' },
58
+ { format: ['camelCase'], leadingUnderscore: 'allow', selector: 'parameter' },
59
+ { format: ['PascalCase'], selector: 'typeLike' },
60
+ { format: null, selector: 'objectLiteralProperty' },
61
+ ],
62
+ complexity: ['warn', { max: 15 }],
63
+ 'no-comments/disallowComments': 'warn',
64
+ 'no-multiple-empty-lines': ['warn', { max: 1, maxBOF: 0, maxEOF: 0 }],
65
+ 'no-redeclare': 'off',
66
+ 'no-undef': 'off',
67
+ 'no-unused-vars': ['error', { args: 'none', vars: 'local' }],
68
+ 'no-useless-assignment': 'off',
69
+ 'no-useless-escape': 'off',
70
+ },
71
+ },
72
+ ];