@vfourny/node-toolkit 1.1.3 → 1.1.5
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/dist/configs/eslint/base.d.ts +0 -16
- package/dist/configs/eslint/base.js +0 -22
- package/dist/configs/eslint/node.d.ts +0 -15
- package/dist/configs/eslint/node.js +1 -16
- package/dist/configs/eslint/nuxt.d.ts +0 -21
- package/dist/configs/eslint/nuxt.js +3 -35
- package/dist/configs/eslint/vue.d.ts +0 -16
- package/dist/configs/eslint/vue.js +2 -18
- package/dist/configs/prettier.config.d.ts +0 -27
- package/dist/configs/prettier.config.js +0 -27
- package/dist/configs/tsconfig/base.json +3 -7
- package/dist/configs/tsconfig/node.json +1 -6
- package/dist/configs/tsconfig/nuxt.json +0 -2
- package/dist/configs/tsconfig/test.json +0 -3
- package/dist/configs/tsconfig/vue.json +0 -6
- package/dist/configs/vitest.config.d.ts +0 -25
- package/dist/configs/vitest.config.js +0 -25
- package/package.json +1 -1
|
@@ -1,24 +1,8 @@
|
|
|
1
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
2
|
export declare const baseConfig: Linter.Config;
|
|
7
|
-
/**
|
|
8
|
-
* Common ignores for all project types
|
|
9
|
-
*/
|
|
10
3
|
export declare const commonIgnores: Linter.Config;
|
|
11
|
-
/**
|
|
12
|
-
* Allow default exports and relative imports in config files
|
|
13
|
-
*/
|
|
14
4
|
export declare const configFilesOverride: Linter.Config;
|
|
15
|
-
/**
|
|
16
|
-
* Recommended TypeScript ESLint configs
|
|
17
|
-
*/
|
|
18
5
|
export declare const typescriptConfigs: Linter.Config[];
|
|
19
|
-
/**
|
|
20
|
-
* Prettier config (should be last in the config array)
|
|
21
|
-
*/
|
|
22
6
|
export declare const prettierConfig: {
|
|
23
7
|
rules: Record<string, 0 | "off">;
|
|
24
8
|
};
|
|
@@ -3,10 +3,6 @@ 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
5
|
import typescriptEslint from 'typescript-eslint';
|
|
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
6
|
export const baseConfig = {
|
|
11
7
|
name: 'node-toolkit/base',
|
|
12
8
|
plugins: {
|
|
@@ -21,7 +17,6 @@ export const baseConfig = {
|
|
|
21
17
|
},
|
|
22
18
|
},
|
|
23
19
|
rules: {
|
|
24
|
-
// General JavaScript/TypeScript rules
|
|
25
20
|
eqeqeq: ['error', 'always'],
|
|
26
21
|
'prefer-const': ['error', { destructuring: 'all' }],
|
|
27
22
|
'no-useless-rename': 'error',
|
|
@@ -33,7 +28,6 @@ export const baseConfig = {
|
|
|
33
28
|
'no-var': 'error',
|
|
34
29
|
'no-redeclare': 'error',
|
|
35
30
|
'no-const-assign': 'error',
|
|
36
|
-
// Enforce absolute imports with @/ prefix
|
|
37
31
|
'no-restricted-imports': [
|
|
38
32
|
'error',
|
|
39
33
|
{
|
|
@@ -45,9 +39,7 @@ export const baseConfig = {
|
|
|
45
39
|
],
|
|
46
40
|
},
|
|
47
41
|
],
|
|
48
|
-
// Disable default sort-imports in favor of simple-import-sort
|
|
49
42
|
'sort-imports': 'off',
|
|
50
|
-
// TypeScript-specific rules
|
|
51
43
|
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
|
|
52
44
|
'@typescript-eslint/no-explicit-any': ['error', { fixToUnknown: true }],
|
|
53
45
|
'@typescript-eslint/consistent-type-imports': [
|
|
@@ -89,25 +81,17 @@ export const baseConfig = {
|
|
|
89
81
|
},
|
|
90
82
|
],
|
|
91
83
|
'@typescript-eslint/no-unsafe-declaration-merging': 'error',
|
|
92
|
-
// Import plugin rules
|
|
93
84
|
'import/no-default-export': 'error',
|
|
94
85
|
'import/no-named-as-default': 'error',
|
|
95
86
|
'import/no-named-as-default-member': 'error',
|
|
96
87
|
'import/no-namespace': 'error',
|
|
97
|
-
// Import sorting
|
|
98
88
|
'simple-import-sort/imports': 'error',
|
|
99
89
|
'simple-import-sort/exports': 'error',
|
|
100
90
|
},
|
|
101
91
|
};
|
|
102
|
-
/**
|
|
103
|
-
* Common ignores for all project types
|
|
104
|
-
*/
|
|
105
92
|
export const commonIgnores = {
|
|
106
93
|
ignores: ['node_modules', 'dist', '.nuxt', 'coverage', '.output', 'build'],
|
|
107
94
|
};
|
|
108
|
-
/**
|
|
109
|
-
* Allow default exports and relative imports in config files
|
|
110
|
-
*/
|
|
111
95
|
export const configFilesOverride = {
|
|
112
96
|
files: ['**/*.config.{js,ts}'],
|
|
113
97
|
rules: {
|
|
@@ -115,16 +99,10 @@ export const configFilesOverride = {
|
|
|
115
99
|
'no-restricted-imports': 'off',
|
|
116
100
|
},
|
|
117
101
|
};
|
|
118
|
-
/**
|
|
119
|
-
* Recommended TypeScript ESLint configs
|
|
120
|
-
*/
|
|
121
102
|
export const typescriptConfigs = [
|
|
122
103
|
eslintJS.configs.recommended,
|
|
123
104
|
...typescriptEslint.configs.recommended,
|
|
124
105
|
...typescriptEslint.configs.strict,
|
|
125
106
|
...typescriptEslint.configs.stylistic,
|
|
126
107
|
];
|
|
127
|
-
/**
|
|
128
|
-
* Prettier config (should be last in the config array)
|
|
129
|
-
*/
|
|
130
108
|
export const prettierConfig = eslintConfigPrettier;
|
|
@@ -1,19 +1,4 @@
|
|
|
1
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
2
|
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
3
|
declare const _default: import("typescript-eslint").FlatConfig.ConfigArray;
|
|
19
4
|
export default _default;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import globals from 'globals';
|
|
2
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
|
-
*/
|
|
3
|
+
import { baseConfig, commonIgnores, configFilesOverride, prettierConfig, typescriptConfigs, } from './base.js';
|
|
8
4
|
export const nodeGlobalsConfig = {
|
|
9
5
|
name: 'node-toolkit/node-globals',
|
|
10
6
|
languageOptions: {
|
|
@@ -13,15 +9,4 @@ export const nodeGlobalsConfig = {
|
|
|
13
9
|
},
|
|
14
10
|
},
|
|
15
11
|
};
|
|
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
12
|
export default typescriptEslint.config(...typescriptConfigs, nodeGlobalsConfig, baseConfig, prettierConfig, configFilesOverride, commonIgnores);
|
|
@@ -1,23 +1,2 @@
|
|
|
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
1
|
declare const _default: import("typescript-eslint").FlatConfig.ConfigArray;
|
|
23
2
|
export default _default;
|
|
@@ -1,16 +1,11 @@
|
|
|
1
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
|
-
*/
|
|
2
|
+
import { baseConfig, commonIgnores, configFilesOverride, prettierConfig, typescriptConfigs, } from './base.js';
|
|
3
|
+
import { nodeGlobalsConfig } from './node.js';
|
|
4
|
+
import { vueFilesConfig } from './vue.js';
|
|
9
5
|
const nuxtGlobals = {
|
|
10
6
|
name: 'node-toolkit/nuxt-globals',
|
|
11
7
|
languageOptions: {
|
|
12
8
|
globals: {
|
|
13
|
-
// Vue auto-imports
|
|
14
9
|
ref: 'readonly',
|
|
15
10
|
computed: 'readonly',
|
|
16
11
|
reactive: 'readonly',
|
|
@@ -32,7 +27,6 @@ const nuxtGlobals = {
|
|
|
32
27
|
nextTick: 'readonly',
|
|
33
28
|
provide: 'readonly',
|
|
34
29
|
inject: 'readonly',
|
|
35
|
-
// Nuxt auto-imports
|
|
36
30
|
useRouter: 'readonly',
|
|
37
31
|
useRoute: 'readonly',
|
|
38
32
|
useFetch: 'readonly',
|
|
@@ -65,15 +59,10 @@ const nuxtGlobals = {
|
|
|
65
59
|
preloadComponents: 'readonly',
|
|
66
60
|
preloadRouteComponents: 'readonly',
|
|
67
61
|
addRouteMiddleware: 'readonly',
|
|
68
|
-
// Process (Nuxt provides this)
|
|
69
62
|
$fetch: 'readonly',
|
|
70
63
|
},
|
|
71
64
|
},
|
|
72
65
|
};
|
|
73
|
-
/**
|
|
74
|
-
* Nuxt-specific override for Vue files
|
|
75
|
-
* Disables multi-word component names rule (pages/index.vue is common in Nuxt)
|
|
76
|
-
*/
|
|
77
66
|
const nuxtVueOverride = {
|
|
78
67
|
name: 'node-toolkit/nuxt-vue-override',
|
|
79
68
|
files: ['**/*.vue'],
|
|
@@ -81,25 +70,4 @@ const nuxtVueOverride = {
|
|
|
81
70
|
'vue/multi-word-component-names': 'off',
|
|
82
71
|
},
|
|
83
72
|
};
|
|
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
73
|
export default typescriptEslint.config(...typescriptConfigs, nodeGlobalsConfig, nuxtGlobals, baseConfig, vueFilesConfig, nuxtVueOverride, prettierConfig, configFilesOverride, commonIgnores);
|
|
@@ -1,20 +1,4 @@
|
|
|
1
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
2
|
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
3
|
declare const _default: import("typescript-eslint").FlatConfig.ConfigArray;
|
|
20
4
|
export default _default;
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import eslintPluginVue from 'eslint-plugin-vue';
|
|
2
2
|
import globals from 'globals';
|
|
3
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
|
-
*/
|
|
4
|
+
import { baseConfig, commonIgnores, configFilesOverride, prettierConfig, typescriptConfigs, } from './base.js';
|
|
5
|
+
import { nodeGlobalsConfig } from './node.js';
|
|
11
6
|
export const vueFilesConfig = {
|
|
12
7
|
name: 'node-toolkit/vue',
|
|
13
8
|
extends: [...eslintPluginVue.configs['flat/recommended']],
|
|
@@ -30,15 +25,4 @@ export const vueFilesConfig = {
|
|
|
30
25
|
],
|
|
31
26
|
},
|
|
32
27
|
};
|
|
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
28
|
export default typescriptEslint.config(...typescriptConfigs, nodeGlobalsConfig, baseConfig, vueFilesConfig, prettierConfig, configFilesOverride, commonIgnores);
|
|
@@ -1,30 +1,3 @@
|
|
|
1
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
2
|
declare const config: Config;
|
|
30
3
|
export default config;
|
|
@@ -1,30 +1,3 @@
|
|
|
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
1
|
const config = {
|
|
29
2
|
singleQuote: true,
|
|
30
3
|
trailingComma: 'all',
|
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
3
|
"compilerOptions": {
|
|
4
|
-
/* Language and Environment */
|
|
5
4
|
"target": "ES2020",
|
|
6
|
-
/* Modules */
|
|
7
5
|
"module": "ESNext",
|
|
8
6
|
"moduleResolution": "bundler",
|
|
9
7
|
"resolveJsonModule": true,
|
|
10
|
-
/* JavaScript Support */
|
|
11
8
|
"allowJs": true,
|
|
12
9
|
"checkJs": false,
|
|
13
|
-
/* Interop Constraints */
|
|
14
10
|
"esModuleInterop": true,
|
|
15
11
|
"forceConsistentCasingInFileNames": true,
|
|
16
|
-
/* Type Checking - Strict mode */
|
|
17
12
|
"strict": true,
|
|
18
13
|
"noImplicitAny": true,
|
|
19
14
|
"strictNullChecks": true,
|
|
@@ -28,7 +23,8 @@
|
|
|
28
23
|
"noImplicitReturns": true,
|
|
29
24
|
"noFallthroughCasesInSwitch": true,
|
|
30
25
|
"noUncheckedSideEffectImports": true,
|
|
31
|
-
|
|
32
|
-
"
|
|
26
|
+
"skipLibCheck": true,
|
|
27
|
+
"removeComments": true,
|
|
28
|
+
"noEmitOnError": true
|
|
33
29
|
}
|
|
34
30
|
}
|
|
@@ -9,18 +9,13 @@
|
|
|
9
9
|
],
|
|
10
10
|
"include": ["${configDir}/src/**/*"],
|
|
11
11
|
"compilerOptions": {
|
|
12
|
-
/* Build Configuration */
|
|
13
12
|
"tsBuildInfoFile": "${configDir}/.cache/.tsbuildinfo",
|
|
14
|
-
/* Modules */
|
|
15
13
|
"rootDir": "${configDir}/src",
|
|
16
14
|
"baseUrl": "${configDir}",
|
|
17
15
|
"paths": {
|
|
18
16
|
"@/*": ["${configDir}/src/*"]
|
|
19
17
|
},
|
|
20
|
-
/* Emit */
|
|
21
18
|
"declaration": true,
|
|
22
|
-
"outDir": "${configDir}/dist"
|
|
23
|
-
"removeComments": true,
|
|
24
|
-
"noEmitOnError": true
|
|
19
|
+
"outDir": "${configDir}/dist"
|
|
25
20
|
}
|
|
26
21
|
}
|
|
@@ -2,10 +2,8 @@
|
|
|
2
2
|
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
3
|
"extends": "./base.json",
|
|
4
4
|
"compilerOptions": {
|
|
5
|
-
/* Language and Environment */
|
|
6
5
|
"jsx": "preserve",
|
|
7
6
|
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
8
|
-
/* Interop Constraints */
|
|
9
7
|
"isolatedModules": true,
|
|
10
8
|
"verbatimModuleSyntax": true
|
|
11
9
|
}
|
|
@@ -2,14 +2,11 @@
|
|
|
2
2
|
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
3
|
"extends": "./base.json",
|
|
4
4
|
"compilerOptions": {
|
|
5
|
-
/* Types */
|
|
6
5
|
"types": ["vitest/globals"],
|
|
7
|
-
/* Modules */
|
|
8
6
|
"baseUrl": "${configDir}",
|
|
9
7
|
"paths": {
|
|
10
8
|
"@/*": ["${configDir}/src/*"]
|
|
11
9
|
},
|
|
12
|
-
/* Emit */
|
|
13
10
|
"noEmit": true
|
|
14
11
|
},
|
|
15
12
|
"include": ["${configDir}/tests/**/*"],
|
|
@@ -9,21 +9,15 @@
|
|
|
9
9
|
],
|
|
10
10
|
"include": ["${configDir}/src/**/*", "${configDir}/src/**/*.vue"],
|
|
11
11
|
"compilerOptions": {
|
|
12
|
-
/* Language and Environment */
|
|
13
12
|
"jsx": "preserve",
|
|
14
13
|
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
15
|
-
/* Modules */
|
|
16
14
|
"rootDir": "${configDir}/src",
|
|
17
15
|
"baseUrl": "${configDir}",
|
|
18
16
|
"paths": {
|
|
19
17
|
"@/*": ["${configDir}/src/*"]
|
|
20
18
|
},
|
|
21
|
-
/* Emit */
|
|
22
19
|
"declaration": true,
|
|
23
20
|
"outDir": "${configDir}/dist",
|
|
24
|
-
"removeComments": true,
|
|
25
|
-
"noEmitOnError": true,
|
|
26
|
-
/* Interop Constraints */
|
|
27
21
|
"isolatedModules": true
|
|
28
22
|
}
|
|
29
23
|
}
|
|
@@ -1,28 +1,3 @@
|
|
|
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
1
|
declare const config: {
|
|
27
2
|
test: {
|
|
28
3
|
reporters: string[];
|
|
@@ -1,28 +1,3 @@
|
|
|
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
1
|
const config = {
|
|
27
2
|
test: {
|
|
28
3
|
reporters: ['default'],
|