voss-node-configs 1.0.13 → 1.0.16

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,109 +1,51 @@
1
- import js from "@eslint/js";
2
- import tseslint from "typescript-eslint";
3
- import prettierPlugin from "eslint-plugin-prettier";
4
- import globals from "globals";
1
+ import baseConfig from './base.js';
2
+ import globals from 'globals';
5
3
 
6
4
  export default [
7
- js.configs.recommended,
8
- ...tseslint.configs.recommended,
5
+ ...baseConfig,
9
6
  {
10
- ignores: ["build/**", "knexfile.js"], // ⛔ exclude all build output
7
+ ignores: ['build/**', 'knexfile.js'], // ⛔ exclude all build output
11
8
  },
12
9
  {
13
- files: ["**/*.mjs"],
10
+ files: ['**/*.mjs'],
14
11
  languageOptions: {
15
12
  globals: {
16
13
  ...globals.node,
17
14
  },
18
- ecmaVersion: "latest",
19
- sourceType: "module",
15
+ ecmaVersion: 'latest',
16
+ sourceType: 'module',
20
17
  },
21
18
  },
22
19
  {
23
- files: ["**/*.js"],
20
+ files: ['**/*.js'],
24
21
  languageOptions: {
25
22
  globals: {
26
23
  ...globals.node,
27
24
  },
28
- ecmaVersion: "latest",
29
- sourceType: "script", // or "module" if you're using ESM
25
+ ecmaVersion: 'latest',
26
+ sourceType: 'script', // or "module" if you're using ESM
30
27
  },
31
28
  },
32
29
  {
33
- files: ["**/*.ts"],
30
+ files: ['**/*.ts'],
34
31
  languageOptions: {
35
32
  globals: {
36
- console: "readonly",
37
- exports: "readonly",
38
- module: "readonly",
39
- require: "readonly",
33
+ console: 'readonly',
34
+ exports: 'readonly',
35
+ module: 'readonly',
36
+ require: 'readonly',
37
+ process: 'readonly',
38
+ Buffer: 'readonly',
39
+ __dirname: 'readonly',
40
+ __filename: 'readonly',
41
+ global: 'readonly',
40
42
  },
41
- parser: tseslint.parser,
42
- parserOptions: {
43
- project: "./tsconfig.json",
44
- },
45
- },
46
- plugins: {
47
- prettier: prettierPlugin,
48
- "@typescript-eslint": tseslint.plugin,
49
43
  },
50
44
  rules: {
51
- "@typescript-eslint/no-explicit-any": "off",
52
- "@typescript-eslint/no-unnecessary-condition": "error",
53
- "@typescript-eslint/no-unused-vars": [
54
- "error",
55
- {
56
- vars: "all",
57
- varsIgnorePattern: "^_",
58
- args: "after-used",
59
- ignoreRestSiblings: false,
60
- },
61
- ],
62
- "@typescript-eslint/no-var-requires": "off",
63
-
64
- // ✅ Prettier integration
65
- "prettier/prettier": "error",
66
-
67
- // ✅ General stylistic preferences
68
- // 'arrow-parens': ['error', 'as-needed'],
69
- // 'brace-style': ['error', '1tbs', { allowSingleLine: false }],
70
- "consistent-return": "off",
71
- // 'curly': ['error', 'multi', 'consistent'],
72
- // 'func-names': ['error', 'never'],
73
- // 'keyword-spacing': ['error', {
74
- // overrides: {
75
- // catch: { after: false, before: false },
76
- // else: { after: false, before: false },
77
- // for: { after: false },
78
- // function: { after: false },
79
- // if: { after: false, before: false },
80
- // throw: { after: true },
81
- // try: { after: false }
82
- // }
83
- // }],
84
- // indent: ['error', 4],
85
- // 'max-len': ['error', {
86
- // code: 100,
87
- // ignoreComments: true,
88
- // ignoreUrls: true
89
- // }],
90
- "no-continue": "off",
91
- "no-empty": ["error", { allowEmptyCatch: true }],
92
- "no-plusplus": "off",
93
- // 'nonblock-statement-body-position': ['error', 'below'],
94
- "no-await-in-loop": "off",
95
- "no-multi-assign": "off",
96
- "no-underscore-dangle": "off",
97
- "no-use-before-define": ["error", { functions: false, classes: true }],
98
- "object-shorthand": ["error", "properties"],
99
- "prefer-destructuring": "off",
100
- // 'space-before-blocks': ['error', 'never'],
101
- // 'space-before-function-paren': ['error', 'never'],
102
- // 'space-unary-ops': ['error', {
103
- // overrides: {
104
- // typeof: false
105
- // }
106
- // }]
45
+ // Backend-specific overrides
46
+ '@typescript-eslint/no-var-requires': 'off', // Allow require() in backend
47
+ 'no-process-exit': 'error', // Prevent process.exit() usage
48
+ 'no-sync': 'error', // Warn about synchronous methods
107
49
  },
108
50
  },
109
51
  ];
@@ -7,15 +7,21 @@ export default [
7
7
  languageOptions: {
8
8
  globals: {
9
9
  browser: 'readonly',
10
+ window: 'readonly',
11
+ document: 'readonly',
12
+ console: 'readonly',
10
13
  },
11
14
  ecmaVersion: 2022,
12
15
  sourceType: 'module',
13
- },
14
- rules: {
15
- // Frontend-specific rules
16
- 'no-console': 'warn', // Warn about console in frontend
17
- '@typescript-eslint/no-require-imports': 'error', // Disallow require() in frontend
18
- 'global-require': 'error', // Disallow require() in frontend
19
- },
16
+ },
17
+ rules: {
18
+ // Frontend-specific rules
19
+ 'no-console': 'warn', // Warn about console in frontend
20
+ '@typescript-eslint/no-require-imports': 'error', // Disallow require() in frontend
21
+ 'global-require': 'error', // Disallow require() in frontend
22
+ 'no-alert': 'error', // Disallow alert() in frontend
23
+ 'no-confirm': 'error', // Disallow confirm() in frontend
24
+ 'no-prompt': 'error', // Disallow prompt() in frontend
25
+ },
20
26
  },
21
27
  ];
package/package.json CHANGED
@@ -1,25 +1,26 @@
1
1
  {
2
2
  "name": "voss-node-configs",
3
- "version": "1.0.13",
3
+ "version": "1.0.16",
4
4
  "description": "Shared TypeScript and ESLint configs for Node.js projects",
5
5
  "exports": {
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",
6
+ "./tsconfig.base": "./tsconfig.base.json",
7
+ "./tsconfig.common": "./tsconfig.common.json",
8
+ "./tsconfig.back-end": "./tsconfig.back-end.json",
9
+ "./tsconfig.front-end.base": "./tsconfig.front-end.base.json",
10
+ "./tsconfig.front-end.dev": "./tsconfig.front-end.dev.json",
11
+ "./tsconfig.front-end.build": "./tsconfig.front-end.build.json",
12
+ "./tsconfig.front-end.node": "./tsconfig.front-end.node.json",
12
13
  "./lint-rules-ui": "./eslint/front-end.js",
13
14
  "./lint-rules-node": "./eslint/back-end.js"
14
15
  },
15
16
  "files": [
16
- "tsconfig/tsconfig.base.json",
17
- "tsconfig/tsconfig.common.json",
18
- "tsconfig/tsconfig.back-end.json",
19
- "tsconfig/tsconfig.front-end.base.json",
20
- "tsconfig/tsconfig.front-end.build.json",
21
- "tsconfig/tsconfig.front-end.dev.json",
22
- "tsconfig/back-end.json",
17
+ "tsconfig.base.json",
18
+ "tsconfig.common.json",
19
+ "tsconfig.back-end.json",
20
+ "tsconfig.front-end.base.json",
21
+ "tsconfig.front-end.build.json",
22
+ "tsconfig.front-end.dev.json",
23
+ "tsconfig.front-end.node.json",
23
24
  "eslint/front-end.js",
24
25
  "eslint/back-end.js"
25
26
  ],
@@ -0,0 +1,17 @@
1
+ {
2
+ "extends": "./base",
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
+ }
@@ -1,3 +0,0 @@
1
- {
2
- "extends": "../tsconfig.back-end.json"
3
- }