voss-node-configs 1.0.5 → 1.0.8
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/package.json +14 -14
- package/tsconfig/back-end.json +3 -0
- package/{typescript/back-end/config.json → tsconfig/tsconfig.back-end.json} +2 -2
- package/{typescript/base/common.json → tsconfig/tsconfig.common.json} +1 -1
- package/{typescript/front-end/front-end.base.json → tsconfig/tsconfig.front-end.base.json} +1 -1
- package/{typescript/front-end/front-end.build.json → tsconfig/tsconfig.front-end.build.json} +1 -1
- package/{typescript/front-end/front-end.dev.json → tsconfig/tsconfig.front-end.dev.json} +1 -1
- package/README.md +0 -119
- package/eslint/back-end.js +0 -13
- package/eslint/base.js +0 -35
- package/eslint/front-end.js +0 -13
- package/eslint/node.js +0 -15
- package/typescript/back-end/config/tsconfig.json +0 -3
- package/typescript/front-end/front-end.node.json +0 -17
- /package/{typescript/base/base.json → tsconfig/tsconfig.base.json} +0 -0
package/package.json
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "voss-node-configs",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "Shared TypeScript and ESLint configs for Node.js projects",
|
|
5
5
|
"exports": {
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"typescript/front-end-node": "./typescript/front-end/front-end.node.json",
|
|
13
|
-
"eslint/base": "./eslint/base.js",
|
|
14
|
-
"eslint/back-end": "./eslint/back-end.js",
|
|
15
|
-
"eslint/front-end": "./eslint/front-end.js",
|
|
16
|
-
"eslint/node": "./eslint/node.js"
|
|
6
|
+
"./base": "./tsconfig/tsconfig.base.json",
|
|
7
|
+
"./common": "./tsconfig/tsconfig.common.json",
|
|
8
|
+
"./back-end": "./tsconfig/back-end.json",
|
|
9
|
+
"./front-end-base": "./tsconfig/tsconfig.front-end.base.json",
|
|
10
|
+
"./front-end-dev": "./tsconfig/tsconfig.front-end.dev.json",
|
|
11
|
+
"./front-end-build": "./tsconfig/tsconfig.front-end.build.json"
|
|
17
12
|
},
|
|
18
13
|
"files": [
|
|
19
|
-
"
|
|
20
|
-
"
|
|
14
|
+
"tsconfig/tsconfig.base.json",
|
|
15
|
+
"tsconfig/tsconfig.common.json",
|
|
16
|
+
"tsconfig/tsconfig.back-end.json",
|
|
17
|
+
"tsconfig/tsconfig.front-end.base.json",
|
|
18
|
+
"tsconfig/tsconfig.front-end.build.json",
|
|
19
|
+
"tsconfig/tsconfig.front-end.dev.json",
|
|
20
|
+
"tsconfig/back-end.json"
|
|
21
21
|
],
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"private": false,
|
package/README.md
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
# Node Configs Voss
|
|
2
|
-
|
|
3
|
-
Shared TypeScript and ESLint configurations for Node.js projects.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install --save-dev node-configs-voss
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## TypeScript Configs
|
|
12
|
-
|
|
13
|
-
### Usage
|
|
14
|
-
|
|
15
|
-
```json
|
|
16
|
-
// tsconfig.json
|
|
17
|
-
{
|
|
18
|
-
"extends": "node-configs-voss/typescript/base"
|
|
19
|
-
}
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
### Available Configs
|
|
23
|
-
|
|
24
|
-
- `typescript/base` - Base TypeScript configuration
|
|
25
|
-
- `typescript/common` - Common TypeScript configuration
|
|
26
|
-
- `typescript/back-end` - Backend-specific TypeScript configuration
|
|
27
|
-
- `typescript/front-end-base` - Frontend base TypeScript configuration
|
|
28
|
-
- `typescript/front-end-dev` - Frontend development TypeScript configuration
|
|
29
|
-
- `typescript/front-end-build` - Frontend build TypeScript configuration
|
|
30
|
-
- `typescript/front-end-node` - Frontend Node.js TypeScript configuration
|
|
31
|
-
|
|
32
|
-
## ESLint Configs
|
|
33
|
-
|
|
34
|
-
### Installation
|
|
35
|
-
|
|
36
|
-
You'll also need to install the required ESLint dependencies:
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
npm install --save-dev eslint@^9.0.0 @typescript-eslint/eslint-plugin@^7.0.0 @typescript-eslint/parser@^7.0.0
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
### Usage
|
|
43
|
-
|
|
44
|
-
```javascript
|
|
45
|
-
// eslint.config.js
|
|
46
|
-
module.exports = {
|
|
47
|
-
extends: ['node-configs-voss/eslint/base'],
|
|
48
|
-
};
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### Available Configs
|
|
52
|
-
|
|
53
|
-
- `eslint/base` - Base ESLint configuration with TypeScript support
|
|
54
|
-
- `eslint/back-end` - Backend-specific ESLint configuration
|
|
55
|
-
- `eslint/front-end` - Frontend-specific ESLint configuration
|
|
56
|
-
- `eslint/node` - Node.js specific ESLint configuration
|
|
57
|
-
|
|
58
|
-
## Examples
|
|
59
|
-
|
|
60
|
-
### Backend Project
|
|
61
|
-
|
|
62
|
-
**tsconfig.json:**
|
|
63
|
-
```json
|
|
64
|
-
{
|
|
65
|
-
"extends": "node-configs-voss/typescript/back-end"
|
|
66
|
-
}
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
**eslint.config.js:**
|
|
70
|
-
```javascript
|
|
71
|
-
module.exports = {
|
|
72
|
-
extends: ['node-configs-voss/eslint/back-end'],
|
|
73
|
-
};
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
### Frontend Project
|
|
77
|
-
|
|
78
|
-
**tsconfig.json:**
|
|
79
|
-
```json
|
|
80
|
-
{
|
|
81
|
-
"extends": "node-configs-voss/typescript/front-end-base"
|
|
82
|
-
}
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
**eslint.config.js:**
|
|
86
|
-
```javascript
|
|
87
|
-
module.exports = {
|
|
88
|
-
extends: ['node-configs-voss/eslint/front-end'],
|
|
89
|
-
};
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
## Configuration Details
|
|
93
|
-
|
|
94
|
-
### TypeScript Configs
|
|
95
|
-
|
|
96
|
-
- **base**: Strict TypeScript configuration with modern ES features
|
|
97
|
-
- **common**: Common settings for shared libraries
|
|
98
|
-
- **back-end**: Optimized for Node.js backend development
|
|
99
|
-
- **front-end-***: Various frontend configurations for different build targets
|
|
100
|
-
|
|
101
|
-
### ESLint Configs
|
|
102
|
-
|
|
103
|
-
- **base**: Comprehensive TypeScript linting with modern JavaScript rules
|
|
104
|
-
- **back-end**: Allows console usage and CommonJS requires
|
|
105
|
-
- **front-end**: Warns about console usage and enforces ES modules
|
|
106
|
-
- **node**: Node.js specific rules with process.exit prevention
|
|
107
|
-
|
|
108
|
-
## Development
|
|
109
|
-
|
|
110
|
-
To contribute to this package:
|
|
111
|
-
|
|
112
|
-
1. Make changes to the config files
|
|
113
|
-
2. Test locally with a sample project
|
|
114
|
-
3. Update version in package.json
|
|
115
|
-
4. Publish to npm
|
|
116
|
-
|
|
117
|
-
## License
|
|
118
|
-
|
|
119
|
-
MIT
|
package/eslint/back-end.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: ['./base.js'],
|
|
3
|
-
env: {
|
|
4
|
-
node: true,
|
|
5
|
-
es2022: true,
|
|
6
|
-
},
|
|
7
|
-
rules: {
|
|
8
|
-
// Backend-specific rules
|
|
9
|
-
'no-console': 'off', // Allow console in backend
|
|
10
|
-
'@typescript-eslint/no-require-imports': 'off', // Allow require() in backend
|
|
11
|
-
'global-require': 'off', // Allow require() anywhere in backend
|
|
12
|
-
},
|
|
13
|
-
};
|
package/eslint/base.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: [
|
|
3
|
-
'eslint:recommended',
|
|
4
|
-
'@typescript-eslint/recommended',
|
|
5
|
-
'@typescript-eslint/recommended-requiring-type-checking',
|
|
6
|
-
],
|
|
7
|
-
parser: '@typescript-eslint/parser',
|
|
8
|
-
parserOptions: {
|
|
9
|
-
ecmaVersion: 'latest',
|
|
10
|
-
sourceType: 'module',
|
|
11
|
-
project: './tsconfig.json',
|
|
12
|
-
},
|
|
13
|
-
plugins: ['@typescript-eslint'],
|
|
14
|
-
rules: {
|
|
15
|
-
// Base rules for all projects
|
|
16
|
-
'@typescript-eslint/no-unused-vars': 'error',
|
|
17
|
-
'@typescript-eslint/no-explicit-any': 'warn',
|
|
18
|
-
'@typescript-eslint/prefer-const': 'error',
|
|
19
|
-
'@typescript-eslint/no-var-requires': 'error',
|
|
20
|
-
'prefer-const': 'error',
|
|
21
|
-
'no-var': 'error',
|
|
22
|
-
'no-console': 'off', // Allow console by default, can be overridden
|
|
23
|
-
'no-debugger': 'error',
|
|
24
|
-
'no-duplicate-imports': 'error',
|
|
25
|
-
'no-unreachable': 'error',
|
|
26
|
-
'prefer-arrow-callback': 'error',
|
|
27
|
-
'prefer-template': 'error',
|
|
28
|
-
'template-curly-spacing': 'error',
|
|
29
|
-
'object-curly-spacing': ['error', 'always'],
|
|
30
|
-
'array-bracket-spacing': ['error', 'never'],
|
|
31
|
-
'comma-dangle': ['error', 'always-multiline'],
|
|
32
|
-
'semi': ['error', 'always'],
|
|
33
|
-
'quotes': ['error', 'single', { 'avoidEscape': true }],
|
|
34
|
-
},
|
|
35
|
-
};
|
package/eslint/front-end.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: ['./base.js'],
|
|
3
|
-
env: {
|
|
4
|
-
browser: true,
|
|
5
|
-
es2022: true,
|
|
6
|
-
},
|
|
7
|
-
rules: {
|
|
8
|
-
// Frontend-specific rules
|
|
9
|
-
'no-console': 'warn', // Warn about console in frontend
|
|
10
|
-
'@typescript-eslint/no-require-imports': 'error', // Disallow require() in frontend
|
|
11
|
-
'global-require': 'error', // Disallow require() in frontend
|
|
12
|
-
},
|
|
13
|
-
};
|
package/eslint/node.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: ['./base.js'],
|
|
3
|
-
env: {
|
|
4
|
-
node: true,
|
|
5
|
-
es2022: true,
|
|
6
|
-
},
|
|
7
|
-
rules: {
|
|
8
|
-
// Node.js specific rules
|
|
9
|
-
'no-console': 'off', // Allow console in Node.js
|
|
10
|
-
'@typescript-eslint/no-require-imports': 'off', // Allow require() in Node.js
|
|
11
|
-
'global-require': 'off', // Allow require() anywhere in Node.js
|
|
12
|
-
'no-process-exit': 'error', // Prevent process.exit() usage
|
|
13
|
-
'no-sync': 'warn', // Warn about synchronous methods
|
|
14
|
-
},
|
|
15
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../base/base.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"target": "ES2022",
|
|
5
|
-
"module": "ESNext",
|
|
6
|
-
"moduleResolution": "node",
|
|
7
|
-
"skipLibCheck": true,
|
|
8
|
-
"esModuleInterop": true,
|
|
9
|
-
"allowSyntheticDefaultImports": true,
|
|
10
|
-
"resolveJsonModule": true,
|
|
11
|
-
"isolatedModules": true,
|
|
12
|
-
"preserveSymlinks": true,
|
|
13
|
-
"strict": true,
|
|
14
|
-
"noEmit": true,
|
|
15
|
-
"types": ["node"]
|
|
16
|
-
}
|
|
17
|
-
}
|
|
File without changes
|