voss-node-configs 1.0.55 → 1.0.57
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/back-end.js +1 -1
- package/base.js +7 -10
- package/package.json +7 -3
- package/prettier.js +22 -0
package/back-end.js
CHANGED
|
@@ -4,7 +4,7 @@ import globals from 'globals';
|
|
|
4
4
|
export default [
|
|
5
5
|
...baseConfig,
|
|
6
6
|
{
|
|
7
|
-
ignores: ['build/**', 'knexfile.js', 'eslint.config.js'], // ⛔ exclude all build output
|
|
7
|
+
ignores: ['build/**', 'knexfile.js', 'eslint.config.js', 'vitest.config.ts'], // ⛔ exclude all build output
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
10
|
files: ['**/*.mjs'],
|
package/base.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import js from '@eslint/js';
|
|
2
2
|
import typescript from '@typescript-eslint/eslint-plugin';
|
|
3
3
|
import typescriptParser from '@typescript-eslint/parser';
|
|
4
|
+
import eslintConfigPrettier from 'eslint-config-prettier';
|
|
4
5
|
import prettierPlugin from 'eslint-plugin-prettier';
|
|
5
6
|
|
|
6
7
|
export default [
|
|
@@ -20,9 +21,9 @@ export default [
|
|
|
20
21
|
prettier: prettierPlugin,
|
|
21
22
|
},
|
|
22
23
|
rules: {
|
|
23
|
-
// Prettier
|
|
24
|
+
// Prettier is the formatting authority (quotes, semi, spacing, etc.)
|
|
24
25
|
'prettier/prettier': 'error',
|
|
25
|
-
|
|
26
|
+
|
|
26
27
|
// Base rules for all projects
|
|
27
28
|
'@typescript-eslint/no-explicit-any': 'error',
|
|
28
29
|
'@typescript-eslint/consistent-type-assertions': ['error', { assertionStyle: 'never' }],
|
|
@@ -52,13 +53,7 @@ export default [
|
|
|
52
53
|
'prefer-arrow-callback': 'error',
|
|
53
54
|
'prefer-const': 'error',
|
|
54
55
|
'prefer-template': 'error',
|
|
55
|
-
|
|
56
|
-
'object-curly-spacing': ['error', 'always'],
|
|
57
|
-
'array-bracket-spacing': ['error', 'never'],
|
|
58
|
-
'comma-dangle': ['error', 'always-multiline'],
|
|
59
|
-
'semi': ['error', 'always'],
|
|
60
|
-
'quotes': ['error', 'single', { 'avoidEscape': true }],
|
|
61
|
-
|
|
56
|
+
|
|
62
57
|
// General code quality
|
|
63
58
|
'consistent-return': 'off',
|
|
64
59
|
'no-empty': ['error', { allowEmptyCatch: true }],
|
|
@@ -71,4 +66,6 @@ export default [
|
|
|
71
66
|
'prefer-destructuring': 'off',
|
|
72
67
|
},
|
|
73
68
|
},
|
|
74
|
-
|
|
69
|
+
// Turn off ESLint rules that conflict with Prettier (must come after other configs)
|
|
70
|
+
eslintConfigPrettier,
|
|
71
|
+
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "voss-node-configs",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.57",
|
|
4
4
|
"description": "Shared TypeScript and ESLint configs for Node.js projects",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./tsconfig.base": "./tsconfig.base.json",
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"./eslint-base": "./base.js",
|
|
15
15
|
"./eslint-front-end": "./front-end.js",
|
|
16
16
|
"./eslint-back-end": "./back-end.js",
|
|
17
|
-
"./eslint-node": "./node.js"
|
|
17
|
+
"./eslint-node": "./node.js",
|
|
18
|
+
"./prettier": "./prettier.js"
|
|
18
19
|
},
|
|
19
20
|
"files": [
|
|
20
21
|
"tsconfig.base.json",
|
|
@@ -28,11 +29,14 @@
|
|
|
28
29
|
"base.js",
|
|
29
30
|
"front-end.js",
|
|
30
31
|
"back-end.js",
|
|
31
|
-
"node.js"
|
|
32
|
+
"node.js",
|
|
33
|
+
"prettier.js",
|
|
34
|
+
"README.md"
|
|
32
35
|
],
|
|
33
36
|
"dependencies": {
|
|
34
37
|
"@eslint/js": "~9.39.0",
|
|
35
38
|
"eslint": "~9.39.0",
|
|
39
|
+
"eslint-config-prettier": "^10.1.8",
|
|
36
40
|
"globals": "^15.0.0"
|
|
37
41
|
},
|
|
38
42
|
"devDependencies": {
|
package/prettier.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Prettier config for voss-node-configs consumers.
|
|
3
|
+
*
|
|
4
|
+
* Point Prettier at this package export so format and eslint-plugin-prettier
|
|
5
|
+
* agree (single quotes, etc.):
|
|
6
|
+
*
|
|
7
|
+
* // package.json
|
|
8
|
+
* "prettier": "voss-node-configs/prettier"
|
|
9
|
+
*
|
|
10
|
+
* // or root .prettierrc
|
|
11
|
+
* "voss-node-configs/prettier"
|
|
12
|
+
*/
|
|
13
|
+
module.exports = {
|
|
14
|
+
singleQuote: true,
|
|
15
|
+
semi: true,
|
|
16
|
+
trailingComma: 'all',
|
|
17
|
+
printWidth: 100,
|
|
18
|
+
tabWidth: 2,
|
|
19
|
+
arrowParens: 'always',
|
|
20
|
+
bracketSpacing: true,
|
|
21
|
+
proseWrap: 'never',
|
|
22
|
+
};
|