@vfourny/node-toolkit 1.0.22 → 1.1.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.
- package/README.md +116 -7
- package/dist/configs/eslint/base.d.ts +24 -0
- package/dist/{eslint.config.js → configs/eslint/base.js} +49 -43
- package/dist/configs/eslint/index.d.ts +9 -0
- package/dist/configs/eslint/index.js +12 -0
- package/dist/configs/eslint/node.d.ts +19 -0
- package/dist/configs/eslint/node.js +27 -0
- package/dist/configs/eslint/nuxt.d.ts +23 -0
- package/dist/configs/eslint/nuxt.js +105 -0
- package/dist/configs/eslint/vue.d.ts +20 -0
- package/dist/configs/eslint/vue.js +44 -0
- package/dist/configs/prettier.config.d.ts +30 -0
- package/dist/configs/prettier.config.js +39 -0
- package/dist/configs/tsconfig/base.json +34 -0
- package/dist/configs/tsconfig/node.json +26 -0
- package/dist/configs/tsconfig/nuxt.json +12 -0
- package/dist/configs/tsconfig/test.json +17 -0
- package/dist/configs/tsconfig/vue.json +29 -0
- package/dist/configs/vitest.config.d.ts +38 -0
- package/dist/configs/vitest.config.js +38 -0
- package/package.json +62 -31
- package/dist/eslint.config.d.ts +0 -2
- package/dist/prettier.config.d.ts +0 -12
- package/dist/prettier.config.js +0 -11
- package/dist/release.config.d.ts +0 -12
- package/dist/release.config.js +0 -27
- package/tsconfig.base.json +0 -120
- /package/dist/{commitlint.config.d.ts → configs/commitlint.config.d.ts} +0 -0
- /package/dist/{commitlint.config.js → configs/commitlint.config.js} +0 -0
package/README.md
CHANGED
|
@@ -23,6 +23,23 @@ To install **VFourny's Node Toolkit** via npm, make sure you have [Node.js](http
|
|
|
23
23
|
npm install -D @vfourny/node-toolkit
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
+
### Peer Dependencies
|
|
27
|
+
|
|
28
|
+
This package requires the following peer dependencies to be installed in your project:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm install -D eslint prettier typescript commitlint semantic-release
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**Minimum versions:**
|
|
35
|
+
|
|
36
|
+
- Node.js: `>=20.13 <25`
|
|
37
|
+
- ESLint: `^9.3.0`
|
|
38
|
+
- Prettier: `^3.2.5`
|
|
39
|
+
- TypeScript: `^5.5.2`
|
|
40
|
+
- Commitlint: `^19.8.0 || ^20.1.0`
|
|
41
|
+
- Semantic Release: `^24.0.0 || ^25.0.0`
|
|
42
|
+
|
|
26
43
|
## Environment Variables
|
|
27
44
|
|
|
28
45
|
For `semantic-release` to work properly, certain environment variables must be defined in your GitHub repository configuration.
|
|
@@ -42,17 +59,103 @@ For `semantic-release` to work properly, certain environment variables must be d
|
|
|
42
59
|
|
|
43
60
|
### ESLint
|
|
44
61
|
|
|
45
|
-
|
|
62
|
+
This package provides multiple ESLint configurations tailored for different project types. Choose the one that fits your project:
|
|
46
63
|
|
|
47
|
-
|
|
48
|
-
import nodeToolkitEslintConfig from '@vfourny/node-toolkit/eslint'
|
|
64
|
+
#### For Node.js Projects
|
|
49
65
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
66
|
+
```typescript
|
|
67
|
+
// eslint.config.ts
|
|
68
|
+
import nodeConfig from '@vfourny/node-toolkit/eslint/node'
|
|
69
|
+
|
|
70
|
+
export default nodeConfig
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
#### For Vue Projects
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
// eslint.config.ts
|
|
77
|
+
import vueConfig from '@vfourny/node-toolkit/eslint/vue'
|
|
78
|
+
|
|
79
|
+
export default vueConfig
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
#### For Nuxt Projects
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
// eslint.config.ts
|
|
86
|
+
import nuxtConfig from '@vfourny/node-toolkit/eslint/nuxt'
|
|
87
|
+
|
|
88
|
+
export default nuxtConfig
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
#### Default Import (Node.js)
|
|
92
|
+
|
|
93
|
+
```typescript
|
|
94
|
+
// eslint.config.ts
|
|
95
|
+
import config from '@vfourny/node-toolkit/eslint'
|
|
96
|
+
|
|
97
|
+
export default config
|
|
54
98
|
```
|
|
55
99
|
|
|
100
|
+
#### Advanced Usage
|
|
101
|
+
|
|
102
|
+
For advanced users who want to compose their own configuration:
|
|
103
|
+
|
|
104
|
+
```typescript
|
|
105
|
+
// eslint.config.ts
|
|
106
|
+
import {
|
|
107
|
+
baseConfig,
|
|
108
|
+
nodeGlobalsConfig,
|
|
109
|
+
typescriptConfigs,
|
|
110
|
+
prettierConfig,
|
|
111
|
+
} from '@vfourny/node-toolkit/eslint/base'
|
|
112
|
+
import typescriptEslint from 'typescript-eslint'
|
|
113
|
+
|
|
114
|
+
export default typescriptEslint.config(
|
|
115
|
+
...typescriptConfigs,
|
|
116
|
+
nodeGlobalsConfig,
|
|
117
|
+
baseConfig,
|
|
118
|
+
// Your custom configs here
|
|
119
|
+
prettierConfig, // Should be last
|
|
120
|
+
)
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
#### Configuration Rules Overview
|
|
124
|
+
|
|
125
|
+
All ESLint configurations include the following enforced rules:
|
|
126
|
+
|
|
127
|
+
**Code Quality:**
|
|
128
|
+
|
|
129
|
+
- `eqeqeq`: Require `===` and `!==` instead of `==` and `!=`
|
|
130
|
+
- `prefer-const`: Prefer `const` over `let` when variables are not reassigned
|
|
131
|
+
- `no-console`: Disallow `console.log` statements (prevents debug code in production)
|
|
132
|
+
- `no-debugger`: Disallow `debugger` statements
|
|
133
|
+
- `no-var`: Require `let` or `const` instead of `var`
|
|
134
|
+
|
|
135
|
+
**TypeScript:**
|
|
136
|
+
|
|
137
|
+
- `@typescript-eslint/consistent-type-definitions`: Enforce `interface` over `type`
|
|
138
|
+
- `@typescript-eslint/no-explicit-any`: Disallow `any` type (suggests `unknown` instead)
|
|
139
|
+
- `@typescript-eslint/consistent-type-imports`: Enforce `import type` for type-only imports
|
|
140
|
+
- `@typescript-eslint/no-unused-vars`: Disallow unused variables (except those prefixed with `_`)
|
|
141
|
+
- `@typescript-eslint/naming-convention`: Enforce naming conventions (PascalCase for classes, camelCase for variables, etc.)
|
|
142
|
+
|
|
143
|
+
**Import Rules:**
|
|
144
|
+
|
|
145
|
+
- `no-restricted-imports`: **Disallow relative imports** - must use absolute imports with `@/` prefix
|
|
146
|
+
- `import/no-default-export`: Disallow default exports (except in `*.config.{js,ts}` files)
|
|
147
|
+
- `simple-import-sort/imports`: Auto-sort imports alphabetically
|
|
148
|
+
- `simple-import-sort/exports`: Auto-sort exports alphabetically
|
|
149
|
+
|
|
150
|
+
**Project-Specific:**
|
|
151
|
+
|
|
152
|
+
- **Node.js**: Includes Node.js global variables (`process`, `__dirname`, etc.)
|
|
153
|
+
- **Vue**: Includes Vue ESLint plugin rules, enforces PascalCase for component names in templates
|
|
154
|
+
- **Nuxt**: Includes Vue rules + auto-import globals for Nuxt composables (`useRouter`, `useFetch`, etc.), allows single-word component names for pages
|
|
155
|
+
|
|
156
|
+
**Import Resolution:**
|
|
157
|
+
All configurations automatically resolve TypeScript path aliases (like `@/*`) using `eslint-import-resolver-typescript`.
|
|
158
|
+
|
|
56
159
|
### Prettier
|
|
57
160
|
|
|
58
161
|
To import the Prettier configuration into your project, add the following code to your [Prettier](https://prettier.io/docs/en/configuration.html) configuration file:
|
|
@@ -74,11 +177,17 @@ To import the TypeScript configuration into your project, add the following code
|
|
|
74
177
|
{
|
|
75
178
|
"extends": "@vfourny/node-toolkit/tsconfig",
|
|
76
179
|
"compilerOptions": {
|
|
180
|
+
"baseUrl": ".",
|
|
181
|
+
"paths": {
|
|
182
|
+
"@/*": ["./src/*"]
|
|
183
|
+
}
|
|
77
184
|
// Your custom configurations
|
|
78
185
|
}
|
|
79
186
|
}
|
|
80
187
|
```
|
|
81
188
|
|
|
189
|
+
**Important:** The `paths` configuration is required for the ESLint import resolver to work correctly with absolute imports using the `@/` prefix.
|
|
190
|
+
|
|
82
191
|
### Semantic Release
|
|
83
192
|
|
|
84
193
|
To import the Semantic Release configuration into your project, add the following code to your [Semantic Release](https://semantic-release.gitbook.io/semantic-release) configuration file:
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Linter } from 'eslint';
|
|
2
|
+
/**
|
|
3
|
+
* Base ESLint configuration with TypeScript, import rules, and formatting
|
|
4
|
+
* This config is meant to be extended by specific project type configurations
|
|
5
|
+
*/
|
|
6
|
+
export declare const baseConfig: Linter.Config;
|
|
7
|
+
/**
|
|
8
|
+
* Common ignores for all project types
|
|
9
|
+
*/
|
|
10
|
+
export declare const commonIgnores: Linter.Config;
|
|
11
|
+
/**
|
|
12
|
+
* Allow default exports and relative imports in config files
|
|
13
|
+
*/
|
|
14
|
+
export declare const configFilesOverride: Linter.Config;
|
|
15
|
+
/**
|
|
16
|
+
* Recommended TypeScript ESLint configs
|
|
17
|
+
*/
|
|
18
|
+
export declare const typescriptConfigs: Linter.Config[];
|
|
19
|
+
/**
|
|
20
|
+
* Prettier config (should be last in the config array)
|
|
21
|
+
*/
|
|
22
|
+
export declare const prettierConfig: {
|
|
23
|
+
rules: Record<string, 0 | "off">;
|
|
24
|
+
};
|
|
@@ -2,48 +2,26 @@ import eslintJS from '@eslint/js';
|
|
|
2
2
|
import eslintConfigPrettier from 'eslint-config-prettier';
|
|
3
3
|
import importPlugin from 'eslint-plugin-import';
|
|
4
4
|
import simpleImportSort from 'eslint-plugin-simple-import-sort';
|
|
5
|
-
import eslintPluginVue from 'eslint-plugin-vue';
|
|
6
|
-
import globals from 'globals';
|
|
7
|
-
import tsEslint from 'typescript-eslint';
|
|
8
5
|
import typescriptEslint from 'typescript-eslint';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
sourceType: 'module',
|
|
16
|
-
globals: globals.browser,
|
|
17
|
-
parserOptions: {
|
|
18
|
-
parser: typescriptEslint.parser,
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
rules: {
|
|
22
|
-
'vue/component-name-in-template-casing': [
|
|
23
|
-
'error',
|
|
24
|
-
'PascalCase',
|
|
25
|
-
{
|
|
26
|
-
registeredComponentsOnly: false,
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
const defaultConfig = {
|
|
32
|
-
name: 'eslint-config-node-tools/default',
|
|
33
|
-
languageOptions: {
|
|
34
|
-
globals: {
|
|
35
|
-
...globals.node,
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
rules: {},
|
|
39
|
-
};
|
|
40
|
-
const customConfig = {
|
|
41
|
-
name: 'eslint-config-node-tools/custom-config',
|
|
6
|
+
/**
|
|
7
|
+
* Base ESLint configuration with TypeScript, import rules, and formatting
|
|
8
|
+
* This config is meant to be extended by specific project type configurations
|
|
9
|
+
*/
|
|
10
|
+
export const baseConfig = {
|
|
11
|
+
name: 'node-toolkit/base',
|
|
42
12
|
plugins: {
|
|
43
13
|
import: importPlugin,
|
|
44
14
|
'simple-import-sort': simpleImportSort,
|
|
45
15
|
},
|
|
16
|
+
settings: {
|
|
17
|
+
'import/resolver': {
|
|
18
|
+
typescript: {
|
|
19
|
+
alwaysTryTypes: true,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
46
23
|
rules: {
|
|
24
|
+
// General JavaScript/TypeScript rules
|
|
47
25
|
eqeqeq: ['error', 'always'],
|
|
48
26
|
'prefer-const': ['error', { destructuring: 'all' }],
|
|
49
27
|
'no-useless-rename': 'error',
|
|
@@ -55,6 +33,7 @@ const customConfig = {
|
|
|
55
33
|
'no-var': 'error',
|
|
56
34
|
'no-redeclare': 'error',
|
|
57
35
|
'no-const-assign': 'error',
|
|
36
|
+
// Enforce absolute imports with @/ prefix
|
|
58
37
|
'no-restricted-imports': [
|
|
59
38
|
'error',
|
|
60
39
|
{
|
|
@@ -66,7 +45,9 @@ const customConfig = {
|
|
|
66
45
|
],
|
|
67
46
|
},
|
|
68
47
|
],
|
|
48
|
+
// Disable default sort-imports in favor of simple-import-sort
|
|
69
49
|
'sort-imports': 'off',
|
|
50
|
+
// TypeScript-specific rules
|
|
70
51
|
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
|
|
71
52
|
'@typescript-eslint/no-explicit-any': ['error', { fixToUnknown: true }],
|
|
72
53
|
'@typescript-eslint/consistent-type-imports': [
|
|
@@ -91,7 +72,7 @@ const customConfig = {
|
|
|
91
72
|
{
|
|
92
73
|
selector: 'variable',
|
|
93
74
|
modifiers: ['const'],
|
|
94
|
-
format: ['camelCase', 'UPPER_CASE'],
|
|
75
|
+
format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
|
|
95
76
|
},
|
|
96
77
|
{
|
|
97
78
|
selector: 'typeParameter',
|
|
@@ -108,17 +89,42 @@ const customConfig = {
|
|
|
108
89
|
},
|
|
109
90
|
],
|
|
110
91
|
'@typescript-eslint/no-unsafe-declaration-merging': 'error',
|
|
92
|
+
// Import plugin rules
|
|
111
93
|
'import/no-default-export': 'error',
|
|
112
94
|
'import/no-named-as-default': 'error',
|
|
113
95
|
'import/no-named-as-default-member': 'error',
|
|
114
96
|
'import/no-namespace': 'error',
|
|
97
|
+
// Import sorting
|
|
115
98
|
'simple-import-sort/imports': 'error',
|
|
116
99
|
'simple-import-sort/exports': 'error',
|
|
117
100
|
},
|
|
118
101
|
};
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
ignores: ['node_modules', 'dist', '.nuxt', 'coverage', '.output'],
|
|
124
|
-
}
|
|
102
|
+
/**
|
|
103
|
+
* Common ignores for all project types
|
|
104
|
+
*/
|
|
105
|
+
export const commonIgnores = {
|
|
106
|
+
ignores: ['node_modules', 'dist', '.nuxt', 'coverage', '.output', 'build'],
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Allow default exports and relative imports in config files
|
|
110
|
+
*/
|
|
111
|
+
export const configFilesOverride = {
|
|
112
|
+
files: ['**/*.config.{js,ts}'],
|
|
113
|
+
rules: {
|
|
114
|
+
'import/no-default-export': 'off',
|
|
115
|
+
'no-restricted-imports': 'off',
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* Recommended TypeScript ESLint configs
|
|
120
|
+
*/
|
|
121
|
+
export const typescriptConfigs = [
|
|
122
|
+
eslintJS.configs.recommended,
|
|
123
|
+
...typescriptEslint.configs.recommended,
|
|
124
|
+
...typescriptEslint.configs.strict,
|
|
125
|
+
...typescriptEslint.configs.stylistic,
|
|
126
|
+
];
|
|
127
|
+
/**
|
|
128
|
+
* Prettier config (should be last in the config array)
|
|
129
|
+
*/
|
|
130
|
+
export const prettierConfig = eslintConfigPrettier;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ESLint configurations for different project types
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
*/
|
|
5
|
+
export * from './base';
|
|
6
|
+
export { default as nodeConfig } from './node';
|
|
7
|
+
export { default as nuxtConfig } from './nuxt';
|
|
8
|
+
export { default as vueConfig } from './vue';
|
|
9
|
+
export { default } from './node';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ESLint configurations for different project types
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
*/
|
|
5
|
+
// Export base configuration components for advanced usage
|
|
6
|
+
export * from './base';
|
|
7
|
+
// Export pre-configured setups for different project types
|
|
8
|
+
export { default as nodeConfig } from './node';
|
|
9
|
+
export { default as nuxtConfig } from './nuxt';
|
|
10
|
+
export { default as vueConfig } from './vue';
|
|
11
|
+
// Default export is the Node.js config (most common use case)
|
|
12
|
+
export { default } from './node';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Linter } from 'eslint';
|
|
2
|
+
/**
|
|
3
|
+
* Node.js-specific configuration with Node.js globals
|
|
4
|
+
* Exported for reuse in other configs (Vue, Nuxt, etc.)
|
|
5
|
+
*/
|
|
6
|
+
export declare const nodeGlobalsConfig: Linter.Config;
|
|
7
|
+
/**
|
|
8
|
+
* Complete ESLint configuration for Node.js projects
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* // eslint.config.ts
|
|
13
|
+
* import nodeConfig from '@vfourny/node-toolkit/eslint/node'
|
|
14
|
+
*
|
|
15
|
+
* export default nodeConfig
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
declare const _default: import("typescript-eslint").FlatConfig.ConfigArray;
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import globals from 'globals';
|
|
2
|
+
import typescriptEslint from 'typescript-eslint';
|
|
3
|
+
import { baseConfig, commonIgnores, configFilesOverride, prettierConfig, typescriptConfigs, } from './base';
|
|
4
|
+
/**
|
|
5
|
+
* Node.js-specific configuration with Node.js globals
|
|
6
|
+
* Exported for reuse in other configs (Vue, Nuxt, etc.)
|
|
7
|
+
*/
|
|
8
|
+
export const nodeGlobalsConfig = {
|
|
9
|
+
name: 'node-toolkit/node-globals',
|
|
10
|
+
languageOptions: {
|
|
11
|
+
globals: {
|
|
12
|
+
...globals.node,
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Complete ESLint configuration for Node.js projects
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* // eslint.config.ts
|
|
22
|
+
* import nodeConfig from '@vfourny/node-toolkit/eslint/node'
|
|
23
|
+
*
|
|
24
|
+
* export default nodeConfig
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export default typescriptEslint.config(...typescriptConfigs, nodeGlobalsConfig, baseConfig, prettierConfig, configFilesOverride, commonIgnores);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Complete ESLint configuration for Nuxt projects
|
|
3
|
+
*
|
|
4
|
+
* This configuration includes globals for Nuxt's auto-imports (composables, components, etc.)
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* // eslint.config.ts
|
|
9
|
+
* import nuxtConfig from '@vfourny/node-toolkit/eslint/nuxt'
|
|
10
|
+
*
|
|
11
|
+
* export default nuxtConfig
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* For optimal type safety with Nuxt auto-imports, ensure your project:
|
|
16
|
+
* 1. Has a `.nuxt` directory generated (run `nuxt prepare` or `nuxt dev` once)
|
|
17
|
+
* 2. Includes `.nuxt/tsconfig.json` in your project's tsconfig extends
|
|
18
|
+
*
|
|
19
|
+
* The auto-imported globals defined here cover the most common Nuxt composables,
|
|
20
|
+
* but you may need to add project-specific auto-imports to your local ESLint config.
|
|
21
|
+
*/
|
|
22
|
+
declare const _default: import("typescript-eslint").FlatConfig.ConfigArray;
|
|
23
|
+
export default _default;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import typescriptEslint from 'typescript-eslint';
|
|
2
|
+
import { baseConfig, commonIgnores, configFilesOverride, prettierConfig, typescriptConfigs, } from './base';
|
|
3
|
+
import { nodeGlobalsConfig } from './node';
|
|
4
|
+
import { vueFilesConfig } from './vue';
|
|
5
|
+
/**
|
|
6
|
+
* Nuxt-specific globals for auto-imports
|
|
7
|
+
* These are commonly auto-imported by Nuxt and should not trigger no-undef errors
|
|
8
|
+
*/
|
|
9
|
+
const nuxtGlobals = {
|
|
10
|
+
name: 'node-toolkit/nuxt-globals',
|
|
11
|
+
languageOptions: {
|
|
12
|
+
globals: {
|
|
13
|
+
// Vue auto-imports
|
|
14
|
+
ref: 'readonly',
|
|
15
|
+
computed: 'readonly',
|
|
16
|
+
reactive: 'readonly',
|
|
17
|
+
readonly: 'readonly',
|
|
18
|
+
watch: 'readonly',
|
|
19
|
+
watchEffect: 'readonly',
|
|
20
|
+
toRef: 'readonly',
|
|
21
|
+
toRefs: 'readonly',
|
|
22
|
+
isRef: 'readonly',
|
|
23
|
+
unref: 'readonly',
|
|
24
|
+
shallowRef: 'readonly',
|
|
25
|
+
shallowReactive: 'readonly',
|
|
26
|
+
onMounted: 'readonly',
|
|
27
|
+
onBeforeMount: 'readonly',
|
|
28
|
+
onBeforeUnmount: 'readonly',
|
|
29
|
+
onUnmounted: 'readonly',
|
|
30
|
+
onUpdated: 'readonly',
|
|
31
|
+
onBeforeUpdate: 'readonly',
|
|
32
|
+
nextTick: 'readonly',
|
|
33
|
+
provide: 'readonly',
|
|
34
|
+
inject: 'readonly',
|
|
35
|
+
// Nuxt auto-imports
|
|
36
|
+
useRouter: 'readonly',
|
|
37
|
+
useRoute: 'readonly',
|
|
38
|
+
useFetch: 'readonly',
|
|
39
|
+
useAsyncData: 'readonly',
|
|
40
|
+
useLazyFetch: 'readonly',
|
|
41
|
+
useLazyAsyncData: 'readonly',
|
|
42
|
+
useState: 'readonly',
|
|
43
|
+
useCookie: 'readonly',
|
|
44
|
+
useRequestHeaders: 'readonly',
|
|
45
|
+
useRequestEvent: 'readonly',
|
|
46
|
+
useRuntimeConfig: 'readonly',
|
|
47
|
+
useAppConfig: 'readonly',
|
|
48
|
+
useHead: 'readonly',
|
|
49
|
+
useSeoMeta: 'readonly',
|
|
50
|
+
useNuxtApp: 'readonly',
|
|
51
|
+
useError: 'readonly',
|
|
52
|
+
navigateTo: 'readonly',
|
|
53
|
+
abortNavigation: 'readonly',
|
|
54
|
+
definePageMeta: 'readonly',
|
|
55
|
+
defineNuxtComponent: 'readonly',
|
|
56
|
+
defineNuxtPlugin: 'readonly',
|
|
57
|
+
defineNuxtRouteMiddleware: 'readonly',
|
|
58
|
+
createError: 'readonly',
|
|
59
|
+
showError: 'readonly',
|
|
60
|
+
clearError: 'readonly',
|
|
61
|
+
reloadNuxtApp: 'readonly',
|
|
62
|
+
refreshNuxtData: 'readonly',
|
|
63
|
+
callOnce: 'readonly',
|
|
64
|
+
prefetchComponents: 'readonly',
|
|
65
|
+
preloadComponents: 'readonly',
|
|
66
|
+
preloadRouteComponents: 'readonly',
|
|
67
|
+
addRouteMiddleware: 'readonly',
|
|
68
|
+
// Process (Nuxt provides this)
|
|
69
|
+
$fetch: 'readonly',
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Nuxt-specific override for Vue files
|
|
75
|
+
* Disables multi-word component names rule (pages/index.vue is common in Nuxt)
|
|
76
|
+
*/
|
|
77
|
+
const nuxtVueOverride = {
|
|
78
|
+
name: 'node-toolkit/nuxt-vue-override',
|
|
79
|
+
files: ['**/*.vue'],
|
|
80
|
+
rules: {
|
|
81
|
+
'vue/multi-word-component-names': 'off',
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Complete ESLint configuration for Nuxt projects
|
|
86
|
+
*
|
|
87
|
+
* This configuration includes globals for Nuxt's auto-imports (composables, components, etc.)
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```typescript
|
|
91
|
+
* // eslint.config.ts
|
|
92
|
+
* import nuxtConfig from '@vfourny/node-toolkit/eslint/nuxt'
|
|
93
|
+
*
|
|
94
|
+
* export default nuxtConfig
|
|
95
|
+
* ```
|
|
96
|
+
*
|
|
97
|
+
* @remarks
|
|
98
|
+
* For optimal type safety with Nuxt auto-imports, ensure your project:
|
|
99
|
+
* 1. Has a `.nuxt` directory generated (run `nuxt prepare` or `nuxt dev` once)
|
|
100
|
+
* 2. Includes `.nuxt/tsconfig.json` in your project's tsconfig extends
|
|
101
|
+
*
|
|
102
|
+
* The auto-imported globals defined here cover the most common Nuxt composables,
|
|
103
|
+
* but you may need to add project-specific auto-imports to your local ESLint config.
|
|
104
|
+
*/
|
|
105
|
+
export default typescriptEslint.config(...typescriptConfigs, nodeGlobalsConfig, nuxtGlobals, baseConfig, vueFilesConfig, nuxtVueOverride, prettierConfig, configFilesOverride, commonIgnores);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ConfigWithExtends } from 'typescript-eslint';
|
|
2
|
+
/**
|
|
3
|
+
* Vue-specific configuration
|
|
4
|
+
* Uses ConfigWithExtends to support the 'extends' property for Vue's recommended rules
|
|
5
|
+
* Exported for reuse in other configs (Nuxt, etc.)
|
|
6
|
+
*/
|
|
7
|
+
export declare const vueFilesConfig: ConfigWithExtends;
|
|
8
|
+
/**
|
|
9
|
+
* Complete ESLint configuration for Vue projects
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* // eslint.config.ts
|
|
14
|
+
* import vueConfig from '@vfourny/node-toolkit/eslint/vue'
|
|
15
|
+
*
|
|
16
|
+
* export default vueConfig
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
declare const _default: import("typescript-eslint").FlatConfig.ConfigArray;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import eslintPluginVue from 'eslint-plugin-vue';
|
|
2
|
+
import globals from 'globals';
|
|
3
|
+
import typescriptEslint from 'typescript-eslint';
|
|
4
|
+
import { baseConfig, commonIgnores, configFilesOverride, prettierConfig, typescriptConfigs, } from './base';
|
|
5
|
+
import { nodeGlobalsConfig } from './node';
|
|
6
|
+
/**
|
|
7
|
+
* Vue-specific configuration
|
|
8
|
+
* Uses ConfigWithExtends to support the 'extends' property for Vue's recommended rules
|
|
9
|
+
* Exported for reuse in other configs (Nuxt, etc.)
|
|
10
|
+
*/
|
|
11
|
+
export const vueFilesConfig = {
|
|
12
|
+
name: 'node-toolkit/vue',
|
|
13
|
+
extends: [...eslintPluginVue.configs['flat/recommended']],
|
|
14
|
+
files: ['**/*.vue'],
|
|
15
|
+
languageOptions: {
|
|
16
|
+
ecmaVersion: 'latest',
|
|
17
|
+
sourceType: 'module',
|
|
18
|
+
globals: globals.browser,
|
|
19
|
+
parserOptions: {
|
|
20
|
+
parser: typescriptEslint.parser,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
rules: {
|
|
24
|
+
'vue/component-name-in-template-casing': [
|
|
25
|
+
'error',
|
|
26
|
+
'PascalCase',
|
|
27
|
+
{
|
|
28
|
+
registeredComponentsOnly: false,
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Complete ESLint configuration for Vue projects
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```typescript
|
|
38
|
+
* // eslint.config.ts
|
|
39
|
+
* import vueConfig from '@vfourny/node-toolkit/eslint/vue'
|
|
40
|
+
*
|
|
41
|
+
* export default vueConfig
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export default typescriptEslint.config(...typescriptConfigs, nodeGlobalsConfig, baseConfig, vueFilesConfig, prettierConfig, configFilesOverride, commonIgnores);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Config } from 'prettier';
|
|
2
|
+
/**
|
|
3
|
+
* Base Prettier configuration
|
|
4
|
+
*
|
|
5
|
+
* Opinionated formatting rules for consistent code style:
|
|
6
|
+
* - Single quotes
|
|
7
|
+
* - No semicolons
|
|
8
|
+
* - Trailing commas
|
|
9
|
+
* - 80 character line width
|
|
10
|
+
* - LF line endings
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```javascript
|
|
14
|
+
* // prettier.config.js
|
|
15
|
+
* export { default } from '@vfourny/node-toolkit/prettier'
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* Or with customization:
|
|
19
|
+
* ```javascript
|
|
20
|
+
* // prettier.config.js
|
|
21
|
+
* import baseConfig from '@vfourny/node-toolkit/prettier'
|
|
22
|
+
*
|
|
23
|
+
* export default {
|
|
24
|
+
* ...baseConfig,
|
|
25
|
+
* printWidth: 100,
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
declare const config: Config;
|
|
30
|
+
export default config;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base Prettier configuration
|
|
3
|
+
*
|
|
4
|
+
* Opinionated formatting rules for consistent code style:
|
|
5
|
+
* - Single quotes
|
|
6
|
+
* - No semicolons
|
|
7
|
+
* - Trailing commas
|
|
8
|
+
* - 80 character line width
|
|
9
|
+
* - LF line endings
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```javascript
|
|
13
|
+
* // prettier.config.js
|
|
14
|
+
* export { default } from '@vfourny/node-toolkit/prettier'
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* Or with customization:
|
|
18
|
+
* ```javascript
|
|
19
|
+
* // prettier.config.js
|
|
20
|
+
* import baseConfig from '@vfourny/node-toolkit/prettier'
|
|
21
|
+
*
|
|
22
|
+
* export default {
|
|
23
|
+
* ...baseConfig,
|
|
24
|
+
* printWidth: 100,
|
|
25
|
+
* }
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
const config = {
|
|
29
|
+
singleQuote: true,
|
|
30
|
+
trailingComma: 'all',
|
|
31
|
+
semi: false,
|
|
32
|
+
printWidth: 80,
|
|
33
|
+
tabWidth: 2,
|
|
34
|
+
bracketSpacing: true,
|
|
35
|
+
bracketSameLine: false,
|
|
36
|
+
arrowParens: 'always',
|
|
37
|
+
endOfLine: 'lf',
|
|
38
|
+
};
|
|
39
|
+
export default config;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
/* Language and Environment */
|
|
5
|
+
"target": "ES2020",
|
|
6
|
+
/* Modules */
|
|
7
|
+
"module": "ESNext",
|
|
8
|
+
"moduleResolution": "bundler",
|
|
9
|
+
"resolveJsonModule": true,
|
|
10
|
+
/* JavaScript Support */
|
|
11
|
+
"allowJs": true,
|
|
12
|
+
"checkJs": false,
|
|
13
|
+
/* Interop Constraints */
|
|
14
|
+
"esModuleInterop": true,
|
|
15
|
+
"forceConsistentCasingInFileNames": true,
|
|
16
|
+
/* Type Checking - Strict mode */
|
|
17
|
+
"strict": true,
|
|
18
|
+
"noImplicitAny": true,
|
|
19
|
+
"strictNullChecks": true,
|
|
20
|
+
"strictFunctionTypes": true,
|
|
21
|
+
"strictBindCallApply": true,
|
|
22
|
+
"strictPropertyInitialization": true,
|
|
23
|
+
"noImplicitThis": true,
|
|
24
|
+
"useUnknownInCatchVariables": true,
|
|
25
|
+
"alwaysStrict": true,
|
|
26
|
+
"noUnusedLocals": true,
|
|
27
|
+
"noUnusedParameters": true,
|
|
28
|
+
"noImplicitReturns": true,
|
|
29
|
+
"noFallthroughCasesInSwitch": true,
|
|
30
|
+
"noUncheckedSideEffectImports": true,
|
|
31
|
+
/* Completeness */
|
|
32
|
+
"skipLibCheck": true
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"extends": "./base.json",
|
|
4
|
+
"exclude": [
|
|
5
|
+
"${configDir}/node_modules",
|
|
6
|
+
"${configDir}/dist",
|
|
7
|
+
"${configDir}/.nuxt",
|
|
8
|
+
"${configDir}/.output"
|
|
9
|
+
],
|
|
10
|
+
"include": ["${configDir}/src/**/*"],
|
|
11
|
+
"compilerOptions": {
|
|
12
|
+
/* Build Configuration */
|
|
13
|
+
"tsBuildInfoFile": "${configDir}/.cache/.tsbuildinfo",
|
|
14
|
+
/* Modules */
|
|
15
|
+
"rootDir": "${configDir}/src",
|
|
16
|
+
"baseUrl": "${configDir}",
|
|
17
|
+
"paths": {
|
|
18
|
+
"@/*": ["${configDir}/src/*"]
|
|
19
|
+
},
|
|
20
|
+
/* Emit */
|
|
21
|
+
"declaration": true,
|
|
22
|
+
"outDir": "${configDir}/dist",
|
|
23
|
+
"removeComments": true,
|
|
24
|
+
"noEmitOnError": true
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"extends": "./base.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
/* Language and Environment */
|
|
6
|
+
"jsx": "preserve",
|
|
7
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
8
|
+
/* Interop Constraints */
|
|
9
|
+
"isolatedModules": true,
|
|
10
|
+
"verbatimModuleSyntax": true
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"extends": "./base.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
/* Types */
|
|
6
|
+
"types": ["vitest/globals"],
|
|
7
|
+
/* Modules */
|
|
8
|
+
"baseUrl": "${configDir}",
|
|
9
|
+
"paths": {
|
|
10
|
+
"@/*": ["${configDir}/src/*"]
|
|
11
|
+
},
|
|
12
|
+
/* Emit */
|
|
13
|
+
"noEmit": true
|
|
14
|
+
},
|
|
15
|
+
"include": ["${configDir}/tests/**/*"],
|
|
16
|
+
"exclude": ["${configDir}/node_modules", "${configDir}/dist"]
|
|
17
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"extends": "./base.json",
|
|
4
|
+
"exclude": [
|
|
5
|
+
"${configDir}/node_modules",
|
|
6
|
+
"${configDir}/dist",
|
|
7
|
+
"${configDir}/coverage",
|
|
8
|
+
"${configDir}/build"
|
|
9
|
+
],
|
|
10
|
+
"include": ["${configDir}/src/**/*", "${configDir}/src/**/*.vue"],
|
|
11
|
+
"compilerOptions": {
|
|
12
|
+
/* Language and Environment */
|
|
13
|
+
"jsx": "preserve",
|
|
14
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
15
|
+
/* Modules */
|
|
16
|
+
"rootDir": "${configDir}/src",
|
|
17
|
+
"baseUrl": "${configDir}",
|
|
18
|
+
"paths": {
|
|
19
|
+
"@/*": ["${configDir}/src/*"]
|
|
20
|
+
},
|
|
21
|
+
/* Emit */
|
|
22
|
+
"declaration": true,
|
|
23
|
+
"outDir": "${configDir}/dist",
|
|
24
|
+
"removeComments": true,
|
|
25
|
+
"noEmitOnError": true,
|
|
26
|
+
/* Interop Constraints */
|
|
27
|
+
"isolatedModules": true
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base Vitest configuration for Node.js projects
|
|
3
|
+
*
|
|
4
|
+
* This configuration provides sensible defaults for testing Node.js applications:
|
|
5
|
+
* - Node environment
|
|
6
|
+
* - Global test APIs (describe, it, expect, etc.)
|
|
7
|
+
* - Coverage with V8 provider
|
|
8
|
+
* - Text, JSON, and HTML coverage reports
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* // vitest.config.ts
|
|
13
|
+
* import { defineConfig, mergeConfig } from 'vitest/config'
|
|
14
|
+
* import baseConfig from '@vfourny/node-toolkit/vitest'
|
|
15
|
+
*
|
|
16
|
+
* export default mergeConfig(
|
|
17
|
+
* baseConfig,
|
|
18
|
+
* defineConfig({
|
|
19
|
+
* test: {
|
|
20
|
+
* include: ['tests/**\/*.test.ts'],
|
|
21
|
+
* },
|
|
22
|
+
* })
|
|
23
|
+
* )
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
declare const config: {
|
|
27
|
+
test: {
|
|
28
|
+
reporters: string[];
|
|
29
|
+
globals: boolean;
|
|
30
|
+
environment: string;
|
|
31
|
+
coverage: {
|
|
32
|
+
provider: string;
|
|
33
|
+
reporter: string[];
|
|
34
|
+
clean: boolean;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export default config;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base Vitest configuration for Node.js projects
|
|
3
|
+
*
|
|
4
|
+
* This configuration provides sensible defaults for testing Node.js applications:
|
|
5
|
+
* - Node environment
|
|
6
|
+
* - Global test APIs (describe, it, expect, etc.)
|
|
7
|
+
* - Coverage with V8 provider
|
|
8
|
+
* - Text, JSON, and HTML coverage reports
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* // vitest.config.ts
|
|
13
|
+
* import { defineConfig, mergeConfig } from 'vitest/config'
|
|
14
|
+
* import baseConfig from '@vfourny/node-toolkit/vitest'
|
|
15
|
+
*
|
|
16
|
+
* export default mergeConfig(
|
|
17
|
+
* baseConfig,
|
|
18
|
+
* defineConfig({
|
|
19
|
+
* test: {
|
|
20
|
+
* include: ['tests/**\/*.test.ts'],
|
|
21
|
+
* },
|
|
22
|
+
* })
|
|
23
|
+
* )
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
const config = {
|
|
27
|
+
test: {
|
|
28
|
+
reporters: ['default'],
|
|
29
|
+
globals: true,
|
|
30
|
+
environment: 'node',
|
|
31
|
+
coverage: {
|
|
32
|
+
provider: 'v8',
|
|
33
|
+
reporter: ['text', 'json', 'html'],
|
|
34
|
+
clean: true,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
export default config;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vfourny/node-toolkit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Toolkit for Node.js projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/libs/index.js",
|
|
@@ -12,31 +12,59 @@
|
|
|
12
12
|
"lint:fix": "eslint --fix .",
|
|
13
13
|
"format": "prettier --write .",
|
|
14
14
|
"format:check": "prettier --check .",
|
|
15
|
-
"
|
|
15
|
+
"ts:check": "tsc --noEmit",
|
|
16
|
+
"test": "vitest run",
|
|
17
|
+
"test:watch": "vitest",
|
|
18
|
+
"test:ui": "vitest --ui",
|
|
19
|
+
"test:coverage": "vitest run --coverage",
|
|
16
20
|
"prepare": "husky"
|
|
17
21
|
},
|
|
18
22
|
"files": [
|
|
19
|
-
"tsconfig.base.json",
|
|
20
23
|
"dist"
|
|
21
24
|
],
|
|
22
25
|
"exports": {
|
|
23
26
|
"./eslint": {
|
|
24
|
-
"types": "./dist/eslint.
|
|
25
|
-
"default": "./dist/eslint.
|
|
27
|
+
"types": "./dist/configs/eslint/index.d.ts",
|
|
28
|
+
"default": "./dist/configs/eslint/index.js"
|
|
29
|
+
},
|
|
30
|
+
"./eslint/base": {
|
|
31
|
+
"types": "./dist/configs/eslint/base.d.ts",
|
|
32
|
+
"default": "./dist/configs/eslint/base.js"
|
|
33
|
+
},
|
|
34
|
+
"./eslint/node": {
|
|
35
|
+
"types": "./dist/configs/eslint/node.d.ts",
|
|
36
|
+
"default": "./dist/configs/eslint/node.js"
|
|
37
|
+
},
|
|
38
|
+
"./eslint/vue": {
|
|
39
|
+
"types": "./dist/configs/eslint/vue.d.ts",
|
|
40
|
+
"default": "./dist/configs/eslint/vue.js"
|
|
41
|
+
},
|
|
42
|
+
"./eslint/nuxt": {
|
|
43
|
+
"types": "./dist/configs/eslint/nuxt.d.ts",
|
|
44
|
+
"default": "./dist/configs/eslint/nuxt.js"
|
|
26
45
|
},
|
|
27
46
|
"./prettier": {
|
|
28
|
-
"types": "./dist/prettier.config.d.ts",
|
|
29
|
-
"default": "./dist/prettier.config.js"
|
|
47
|
+
"types": "./dist/configs/prettier.config.d.ts",
|
|
48
|
+
"default": "./dist/configs/prettier.config.js"
|
|
30
49
|
},
|
|
31
50
|
"./commitlint": {
|
|
32
|
-
"types": "./dist/commitlint.config.d.ts",
|
|
33
|
-
"default": "./dist/commitlint.config.js"
|
|
51
|
+
"types": "./dist/configs/commitlint.config.d.ts",
|
|
52
|
+
"default": "./dist/configs/commitlint.config.js"
|
|
34
53
|
},
|
|
35
54
|
"./release": {
|
|
36
|
-
"types": "./dist/release.config.d.ts",
|
|
37
|
-
"default": "./dist/release.config.js"
|
|
55
|
+
"types": "./dist/configs/release.config.d.ts",
|
|
56
|
+
"default": "./dist/configs/release.config.js"
|
|
38
57
|
},
|
|
39
|
-
"./tsconfig": "./tsconfig.
|
|
58
|
+
"./tsconfig": "./dist/configs/tsconfig/node.json",
|
|
59
|
+
"./tsconfig/base": "./dist/configs/tsconfig/base.json",
|
|
60
|
+
"./tsconfig/node": "./dist/configs/tsconfig/node.json",
|
|
61
|
+
"./tsconfig/vue": "./dist/configs/tsconfig/vue.json",
|
|
62
|
+
"./tsconfig/nuxt": "./dist/configs/tsconfig/nuxt.json",
|
|
63
|
+
"./tsconfig/test": "./dist/configs/tsconfig/test.json",
|
|
64
|
+
"./vitest": {
|
|
65
|
+
"types": "./dist/configs/vitest.config.d.ts",
|
|
66
|
+
"default": "./dist/configs/vitest.config.js"
|
|
67
|
+
}
|
|
40
68
|
},
|
|
41
69
|
"keywords": [
|
|
42
70
|
"eslint",
|
|
@@ -50,34 +78,37 @@
|
|
|
50
78
|
"author": "Valentin Fourny",
|
|
51
79
|
"license": "ISC",
|
|
52
80
|
"dependencies": {
|
|
53
|
-
"@commitlint/config-angular": "^
|
|
81
|
+
"@commitlint/config-angular": "^20.2.0",
|
|
54
82
|
"@semantic-release/changelog": "^6.0.3",
|
|
55
83
|
"@semantic-release/git": "^10.0.1",
|
|
56
|
-
"eslint-config-prettier": "^10.
|
|
84
|
+
"eslint-config-prettier": "^10.1.8",
|
|
85
|
+
"eslint-import-resolver-typescript": "^4.0.0",
|
|
57
86
|
"eslint-plugin-import": "^2.32.0",
|
|
58
87
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
59
|
-
"eslint-plugin-vue": "^
|
|
60
|
-
"globals": "^
|
|
61
|
-
"typescript-eslint": "^8.
|
|
88
|
+
"eslint-plugin-vue": "^10.6.2",
|
|
89
|
+
"globals": "^16.5.0",
|
|
90
|
+
"typescript-eslint": "^8.50.0"
|
|
62
91
|
},
|
|
63
92
|
"devDependencies": {
|
|
64
|
-
"@commitlint/types": "^
|
|
65
|
-
"@eslint/js": "^9.
|
|
66
|
-
"@types/eslint__js": "^8.42.3",
|
|
93
|
+
"@commitlint/types": "^20.2.0",
|
|
94
|
+
"@eslint/js": "^9.39.2",
|
|
67
95
|
"@types/eslint-config-prettier": "^6.11.3",
|
|
68
|
-
"@types/node": "^
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
96
|
+
"@types/node": "^25.0.3",
|
|
97
|
+
"@vitest/ui": "^4.0.16",
|
|
98
|
+
"commitlint": "^20.2.0",
|
|
99
|
+
"eslint": "^9.39.2",
|
|
100
|
+
"husky": "^9.1.7",
|
|
101
|
+
"prettier": "^3.7.4",
|
|
102
|
+
"semantic-release": "^25.0.0",
|
|
103
|
+
"typescript": "^5.9.3",
|
|
104
|
+
"vitest": "^4.0.16",
|
|
105
|
+
"vue-eslint-parser": "^10.2.0"
|
|
75
106
|
},
|
|
76
107
|
"peerDependencies": {
|
|
77
|
-
"commitlint": "^19.8.0",
|
|
108
|
+
"commitlint": "^19.8.0 || ^20.1.0",
|
|
78
109
|
"eslint": "^9.3.0",
|
|
79
110
|
"prettier": "^3.2.5",
|
|
80
|
-
"semantic-release": "^24.0.0",
|
|
111
|
+
"semantic-release": "^24.0.0 || ^25.0.0",
|
|
81
112
|
"typescript": "^5.5.2"
|
|
82
113
|
},
|
|
83
114
|
"repository": {
|
|
@@ -89,7 +120,7 @@
|
|
|
89
120
|
"registry": "https://registry.npmjs.org/"
|
|
90
121
|
},
|
|
91
122
|
"engines": {
|
|
92
|
-
"node": ">=
|
|
93
|
-
"npm": ">= 10"
|
|
123
|
+
"node": ">= 22.22.1",
|
|
124
|
+
"npm": ">= 10.9.4"
|
|
94
125
|
}
|
|
95
126
|
}
|
package/dist/eslint.config.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
declare namespace _default {
|
|
2
|
-
let singleQuote: boolean;
|
|
3
|
-
let trailingComma: string;
|
|
4
|
-
let semi: boolean;
|
|
5
|
-
let printWidth: number;
|
|
6
|
-
let tabWidth: number;
|
|
7
|
-
let bracketSpacing: boolean;
|
|
8
|
-
let bracketSameLine: boolean;
|
|
9
|
-
let arrowParens: string;
|
|
10
|
-
let endOfLine: string;
|
|
11
|
-
}
|
|
12
|
-
export default _default;
|
package/dist/prettier.config.js
DELETED
package/dist/release.config.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
declare namespace _default {
|
|
2
|
-
let branches: string[];
|
|
3
|
-
let plugins: (string | (string | {
|
|
4
|
-
changelogFile: string;
|
|
5
|
-
})[] | (string | {
|
|
6
|
-
npmPublish: boolean;
|
|
7
|
-
pkgRoot: string;
|
|
8
|
-
})[] | (string | {
|
|
9
|
-
assets: string[];
|
|
10
|
-
})[])[];
|
|
11
|
-
}
|
|
12
|
-
export default _default;
|
package/dist/release.config.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
branches: ['main'],
|
|
3
|
-
plugins: [
|
|
4
|
-
'@semantic-release/commit-analyzer',
|
|
5
|
-
'@semantic-release/release-notes-generator',
|
|
6
|
-
[
|
|
7
|
-
'@semantic-release/changelog',
|
|
8
|
-
{
|
|
9
|
-
changelogFile: 'docs/CHANGELOG.md',
|
|
10
|
-
},
|
|
11
|
-
],
|
|
12
|
-
'@semantic-release/github',
|
|
13
|
-
[
|
|
14
|
-
'@semantic-release/npm',
|
|
15
|
-
{
|
|
16
|
-
npmPublish: process.env.PUBLISH === 'true',
|
|
17
|
-
pkgRoot: '.',
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
[
|
|
21
|
-
'@semantic-release/git',
|
|
22
|
-
{
|
|
23
|
-
assets: ['docs/CHANGELOG.md', 'package.json', 'package-lock.json'],
|
|
24
|
-
},
|
|
25
|
-
],
|
|
26
|
-
],
|
|
27
|
-
};
|
package/tsconfig.base.json
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"exclude": [
|
|
3
|
-
"${configDir}/node_modules",
|
|
4
|
-
"${configDir}/dist",
|
|
5
|
-
"${configDir}/.nuxt",
|
|
6
|
-
"${configDir}/.output"
|
|
7
|
-
],
|
|
8
|
-
"include": ["${configDir}/src/**/*"],
|
|
9
|
-
"compilerOptions": {
|
|
10
|
-
/* Visit https://aka.ms/tsconfig to read more about this file */
|
|
11
|
-
|
|
12
|
-
/* Projects */
|
|
13
|
-
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
|
|
14
|
-
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
|
15
|
-
"tsBuildInfoFile": "${configDir}/.cache/.tsbuildinfo" /* Specify the path to .tsbuildinfo incremental compilation file. */,
|
|
16
|
-
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
|
|
17
|
-
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
|
18
|
-
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
|
19
|
-
|
|
20
|
-
/* Language and Environment */
|
|
21
|
-
"target": "ES2020" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
|
|
22
|
-
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
|
23
|
-
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
|
24
|
-
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
|
|
25
|
-
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
|
26
|
-
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
|
|
27
|
-
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
|
28
|
-
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
|
|
29
|
-
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
|
|
30
|
-
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
|
31
|
-
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
|
32
|
-
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
|
33
|
-
|
|
34
|
-
/* Modules */
|
|
35
|
-
"module": "ESNext" /* Specify what module code is generated. */,
|
|
36
|
-
"rootDir": "${configDir}/src" /* Specify the root folder within your source files. */,
|
|
37
|
-
"moduleResolution": "bundler" /* Specify how TypeScript looks up a file from a given module specifier. */,
|
|
38
|
-
"baseUrl": "${configDir}" /* Specify the base directory to resolve non-relative module names. */,
|
|
39
|
-
"paths": {
|
|
40
|
-
"@/*": ["${configDir}/src/*"]
|
|
41
|
-
} /* Specify a set of entries that re-map imports to additional lookup locations. */,
|
|
42
|
-
// "rootDirs": [] /* Allow multiple folders to be treated as one when resolving modules. */,
|
|
43
|
-
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
|
|
44
|
-
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
|
45
|
-
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
46
|
-
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
|
47
|
-
// "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
|
|
48
|
-
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
|
|
49
|
-
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
|
|
50
|
-
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
|
|
51
|
-
"resolveJsonModule": true /* Enable importing .json files. */,
|
|
52
|
-
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
|
|
53
|
-
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
|
|
54
|
-
|
|
55
|
-
/* JavaScript Support */
|
|
56
|
-
"allowJs": true /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */,
|
|
57
|
-
"checkJs": true /* Enable error reporting in type-checked JavaScript files. */,
|
|
58
|
-
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
|
|
59
|
-
|
|
60
|
-
/* Emit */
|
|
61
|
-
"declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */,
|
|
62
|
-
// "declarationMap": true /* Create sourcemaps for d.ts files. */,
|
|
63
|
-
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
|
64
|
-
// "sourceMap": true /* Create source map files for emitted JavaScript files. */,
|
|
65
|
-
// "inlineSourceMap": true /* Include sourcemap files inside the emitted JavaScript. */,
|
|
66
|
-
// "outFile": "./" /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */,
|
|
67
|
-
"outDir": "${configDir}/dist" /* Specify an output folder for all emitted files. */,
|
|
68
|
-
"removeComments": true /* Disable emitting comments. */,
|
|
69
|
-
// "noEmit": true, /* Disable emitting files from a compilation. */
|
|
70
|
-
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
|
71
|
-
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
|
|
72
|
-
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
|
73
|
-
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
|
74
|
-
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
75
|
-
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
|
76
|
-
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
|
77
|
-
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
|
78
|
-
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
|
|
79
|
-
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
|
|
80
|
-
"noEmitOnError": true /* Disable emitting files if any type checking errors are reported. */,
|
|
81
|
-
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
|
|
82
|
-
// "declarationDir": "./dist/types" /* Specify the output directory for generated declaration files. */,
|
|
83
|
-
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
|
|
84
|
-
|
|
85
|
-
/* Interop Constraints */
|
|
86
|
-
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
|
87
|
-
// "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
|
|
88
|
-
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
|
89
|
-
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
|
|
90
|
-
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
|
91
|
-
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
|
|
92
|
-
|
|
93
|
-
/* Type Checking */
|
|
94
|
-
"strict": true /* Enable all strict type-checking options. */,
|
|
95
|
-
"noImplicitAny": true /* Enable error reporting for expressions and declarations with an implied 'any' type. */,
|
|
96
|
-
"strictNullChecks": true /* When type checking, take into account 'null' and 'undefined'. */,
|
|
97
|
-
"strictFunctionTypes": true /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */,
|
|
98
|
-
"strictBindCallApply": true /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */,
|
|
99
|
-
"strictPropertyInitialization": true /* Check for class properties that are declared but not set in the constructor. */,
|
|
100
|
-
// "strictBuiltinIteratorReturn": false, /* Ensure that the return type of generators and async functions are correctly constrained. */
|
|
101
|
-
"noImplicitThis": true /* Enable error reporting when 'this' is given the type 'any'. */,
|
|
102
|
-
"useUnknownInCatchVariables": true /* Default catch clause variables as 'unknown' instead of 'any'. */,
|
|
103
|
-
"alwaysStrict": true /* Ensure 'use strict' is always emitted. */,
|
|
104
|
-
"noUnusedLocals": true /* Enable error reporting when local variables aren't read. */,
|
|
105
|
-
"noUnusedParameters": true /* Raise an error when a function parameter isn't read. */,
|
|
106
|
-
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
|
107
|
-
"noImplicitReturns": true /* Enable error reporting for codepaths that do not explicitly return in a function. */,
|
|
108
|
-
"noFallthroughCasesInSwitch": true /* Enable error reporting for fallthrough cases in switch statements. */,
|
|
109
|
-
"noUncheckedSideEffectImports": true /* Enable error reporting for imports that may be converted to a 'require' call. */,
|
|
110
|
-
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
|
|
111
|
-
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
|
112
|
-
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
|
|
113
|
-
"allowUnusedLabels": true /* Disable error reporting for unused labels. */,
|
|
114
|
-
"allowUnreachableCode": true /* Disable error reporting for unreachable code. */,
|
|
115
|
-
|
|
116
|
-
/* Completeness */
|
|
117
|
-
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
|
118
|
-
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
|
119
|
-
}
|
|
120
|
-
}
|
|
File without changes
|
|
File without changes
|