@vfourny/node-toolkit 1.1.0 → 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.
@@ -1,10 +1,24 @@
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
+ */
2
6
  export declare const baseConfig: Linter.Config;
7
+ /**
8
+ * Common ignores for all project types
9
+ */
3
10
  export declare const commonIgnores: Linter.Config;
11
+ /**
12
+ * Allow default exports and relative imports in config files
13
+ */
4
14
  export declare const configFilesOverride: Linter.Config;
5
- export declare const typescriptConfigs: ({
6
- readonly rules: Readonly<Linter.RulesRecord>;
7
- } | import("node_modules/typescript-eslint/dist/compatibility-types").CompatibleConfig)[];
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
+ */
8
22
  export declare const prettierConfig: {
9
23
  rules: Record<string, 0 | "off">;
10
24
  };
@@ -3,6 +3,10 @@ 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
+ */
6
10
  export const baseConfig = {
7
11
  name: 'node-toolkit/base',
8
12
  plugins: {
@@ -17,6 +21,7 @@ export const baseConfig = {
17
21
  },
18
22
  },
19
23
  rules: {
24
+ // General JavaScript/TypeScript rules
20
25
  eqeqeq: ['error', 'always'],
21
26
  'prefer-const': ['error', { destructuring: 'all' }],
22
27
  'no-useless-rename': 'error',
@@ -28,6 +33,7 @@ export const baseConfig = {
28
33
  'no-var': 'error',
29
34
  'no-redeclare': 'error',
30
35
  'no-const-assign': 'error',
36
+ // Enforce absolute imports with @/ prefix
31
37
  'no-restricted-imports': [
32
38
  'error',
33
39
  {
@@ -39,7 +45,9 @@ export const baseConfig = {
39
45
  ],
40
46
  },
41
47
  ],
48
+ // Disable default sort-imports in favor of simple-import-sort
42
49
  'sort-imports': 'off',
50
+ // TypeScript-specific rules
43
51
  '@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
44
52
  '@typescript-eslint/no-explicit-any': ['error', { fixToUnknown: true }],
45
53
  '@typescript-eslint/consistent-type-imports': [
@@ -81,25 +89,42 @@ export const baseConfig = {
81
89
  },
82
90
  ],
83
91
  '@typescript-eslint/no-unsafe-declaration-merging': 'error',
92
+ // Import plugin rules
84
93
  'import/no-default-export': 'error',
85
94
  'import/no-named-as-default': 'error',
86
95
  'import/no-named-as-default-member': 'error',
87
96
  'import/no-namespace': 'error',
97
+ // Import sorting
88
98
  'simple-import-sort/imports': 'error',
89
99
  'simple-import-sort/exports': 'error',
90
100
  },
91
101
  };
102
+ /**
103
+ * Common ignores for all project types
104
+ */
92
105
  export const commonIgnores = {
93
106
  ignores: ['node_modules', 'dist', '.nuxt', 'coverage', '.output', 'build'],
94
107
  };
108
+ /**
109
+ * Allow default exports and relative imports in config files
110
+ */
95
111
  export const configFilesOverride = {
96
- files: ['*.config.{js,ts}'],
97
- rules: { 'import/no-default-export': 'off' },
112
+ files: ['**/*.config.{js,ts}'],
113
+ rules: {
114
+ 'import/no-default-export': 'off',
115
+ 'no-restricted-imports': 'off',
116
+ },
98
117
  };
118
+ /**
119
+ * Recommended TypeScript ESLint configs
120
+ */
99
121
  export const typescriptConfigs = [
100
122
  eslintJS.configs.recommended,
101
123
  ...typescriptEslint.configs.recommended,
102
124
  ...typescriptEslint.configs.strict,
103
125
  ...typescriptEslint.configs.stylistic,
104
126
  ];
127
+ /**
128
+ * Prettier config (should be last in the config array)
129
+ */
105
130
  export const prettierConfig = eslintConfigPrettier;
@@ -1,3 +1,7 @@
1
+ /**
2
+ * ESLint configurations for different project types
3
+ * @packageDocumentation
4
+ */
1
5
  export * from './base';
2
6
  export { default as nodeConfig } from './node';
3
7
  export { default as nuxtConfig } from './nuxt';
@@ -1,5 +1,12 @@
1
+ /**
2
+ * ESLint configurations for different project types
3
+ * @packageDocumentation
4
+ */
5
+ // Export base configuration components for advanced usage
1
6
  export * from './base';
7
+ // Export pre-configured setups for different project types
2
8
  export { default as nodeConfig } from './node';
3
9
  export { default as nuxtConfig } from './nuxt';
4
10
  export { default as vueConfig } from './vue';
11
+ // Default export is the Node.js config (most common use case)
5
12
  export { default } from './node';
@@ -1,4 +1,19 @@
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
+ */
2
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
+ */
3
18
  declare const _default: import("typescript-eslint").FlatConfig.ConfigArray;
4
19
  export default _default;
@@ -1,6 +1,10 @@
1
1
  import globals from 'globals';
2
2
  import typescriptEslint from 'typescript-eslint';
3
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
+ */
4
8
  export const nodeGlobalsConfig = {
5
9
  name: 'node-toolkit/node-globals',
6
10
  languageOptions: {
@@ -9,4 +13,15 @@ export const nodeGlobalsConfig = {
9
13
  },
10
14
  },
11
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
+ */
12
27
  export default typescriptEslint.config(...typescriptConfigs, nodeGlobalsConfig, baseConfig, prettierConfig, configFilesOverride, commonIgnores);
@@ -1,2 +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
+ */
1
22
  declare const _default: import("typescript-eslint").FlatConfig.ConfigArray;
2
23
  export default _default;
@@ -2,10 +2,15 @@ import typescriptEslint from 'typescript-eslint';
2
2
  import { baseConfig, commonIgnores, configFilesOverride, prettierConfig, typescriptConfigs, } from './base';
3
3
  import { nodeGlobalsConfig } from './node';
4
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
+ */
5
9
  const nuxtGlobals = {
6
10
  name: 'node-toolkit/nuxt-globals',
7
11
  languageOptions: {
8
12
  globals: {
13
+ // Vue auto-imports
9
14
  ref: 'readonly',
10
15
  computed: 'readonly',
11
16
  reactive: 'readonly',
@@ -27,6 +32,7 @@ const nuxtGlobals = {
27
32
  nextTick: 'readonly',
28
33
  provide: 'readonly',
29
34
  inject: 'readonly',
35
+ // Nuxt auto-imports
30
36
  useRouter: 'readonly',
31
37
  useRoute: 'readonly',
32
38
  useFetch: 'readonly',
@@ -59,10 +65,15 @@ const nuxtGlobals = {
59
65
  preloadComponents: 'readonly',
60
66
  preloadRouteComponents: 'readonly',
61
67
  addRouteMiddleware: 'readonly',
68
+ // Process (Nuxt provides this)
62
69
  $fetch: 'readonly',
63
70
  },
64
71
  },
65
72
  };
73
+ /**
74
+ * Nuxt-specific override for Vue files
75
+ * Disables multi-word component names rule (pages/index.vue is common in Nuxt)
76
+ */
66
77
  const nuxtVueOverride = {
67
78
  name: 'node-toolkit/nuxt-vue-override',
68
79
  files: ['**/*.vue'],
@@ -70,4 +81,25 @@ const nuxtVueOverride = {
70
81
  'vue/multi-word-component-names': 'off',
71
82
  },
72
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
+ */
73
105
  export default typescriptEslint.config(...typescriptConfigs, nodeGlobalsConfig, nuxtGlobals, baseConfig, vueFilesConfig, nuxtVueOverride, prettierConfig, configFilesOverride, commonIgnores);
@@ -1,4 +1,20 @@
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
+ */
2
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
+ */
3
19
  declare const _default: import("typescript-eslint").FlatConfig.ConfigArray;
4
20
  export default _default;
@@ -3,6 +3,11 @@ import globals from 'globals';
3
3
  import typescriptEslint from 'typescript-eslint';
4
4
  import { baseConfig, commonIgnores, configFilesOverride, prettierConfig, typescriptConfigs, } from './base';
5
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
+ */
6
11
  export const vueFilesConfig = {
7
12
  name: 'node-toolkit/vue',
8
13
  extends: [...eslintPluginVue.configs['flat/recommended']],
@@ -25,4 +30,15 @@ export const vueFilesConfig = {
25
30
  ],
26
31
  },
27
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
+ */
28
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.1.0",
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,7 +12,7 @@
12
12
  "lint:fix": "eslint --fix .",
13
13
  "format": "prettier --write .",
14
14
  "format:check": "prettier --check .",
15
- "type-check": "tsc --noEmit",
15
+ "ts:check": "tsc --noEmit",
16
16
  "test": "vitest run",
17
17
  "test:watch": "vitest",
18
18
  "test:ui": "vitest --ui",
@@ -20,7 +20,6 @@
20
20
  "prepare": "husky"
21
21
  },
22
22
  "files": [
23
- "tsconfig.base.json",
24
23
  "dist"
25
24
  ],
26
25
  "exports": {
@@ -45,18 +44,27 @@
45
44
  "default": "./dist/configs/eslint/nuxt.js"
46
45
  },
47
46
  "./prettier": {
48
- "types": "./dist/prettier.config.d.ts",
49
- "default": "./dist/prettier.config.js"
47
+ "types": "./dist/configs/prettier.config.d.ts",
48
+ "default": "./dist/configs/prettier.config.js"
50
49
  },
51
50
  "./commitlint": {
52
- "types": "./dist/commitlint.config.d.ts",
53
- "default": "./dist/commitlint.config.js"
51
+ "types": "./dist/configs/commitlint.config.d.ts",
52
+ "default": "./dist/configs/commitlint.config.js"
54
53
  },
55
54
  "./release": {
56
- "types": "./dist/release.config.d.ts",
57
- "default": "./dist/release.config.js"
55
+ "types": "./dist/configs/release.config.d.ts",
56
+ "default": "./dist/configs/release.config.js"
58
57
  },
59
- "./tsconfig": "./tsconfig.base.json"
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
+ }
60
68
  },
61
69
  "keywords": [
62
70
  "eslint",
@@ -112,7 +120,7 @@
112
120
  "registry": "https://registry.npmjs.org/"
113
121
  },
114
122
  "engines": {
115
- "node": ">=20.13 <25",
116
- "npm": ">= 10"
123
+ "node": ">= 22.22.1",
124
+ "npm": ">= 10.9.4"
117
125
  }
118
126
  }
@@ -1,2 +0,0 @@
1
- declare const _default: import("typescript-eslint").FlatConfig.ConfigArray;
2
- export default _default;
@@ -1,10 +0,0 @@
1
- import typescriptEslint from 'typescript-eslint';
2
- import nodeConfig from './configs/eslint/node';
3
- const configsOverride = {
4
- files: ['configs/**/*.ts', 'eslint.config.ts'],
5
- rules: {
6
- 'no-restricted-imports': 'off',
7
- 'import/no-default-export': 'off',
8
- },
9
- };
10
- export default typescriptEslint.config(...nodeConfig, configsOverride);
@@ -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;
@@ -1,11 +0,0 @@
1
- export default {
2
- singleQuote: true,
3
- trailingComma: 'all',
4
- semi: false,
5
- printWidth: 80,
6
- tabWidth: 2,
7
- bracketSpacing: true,
8
- bracketSameLine: false,
9
- arrowParens: 'always',
10
- endOfLine: 'lf',
11
- };
@@ -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;
@@ -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
- };
@@ -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
- }