voss-node-configs 1.0.7 → 1.0.9

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.
@@ -0,0 +1,109 @@
1
+ import js from "@eslint/js";
2
+ import tseslint from "typescript-eslint";
3
+ import prettierPlugin from "eslint-plugin-prettier";
4
+ import globals from "globals";
5
+
6
+ export default [
7
+ js.configs.recommended,
8
+ ...tseslint.configs.recommended,
9
+ {
10
+ ignores: ["build/**", "knexfile.js"], // ⛔ exclude all build output
11
+ },
12
+ {
13
+ files: ["**/*.mjs"],
14
+ languageOptions: {
15
+ globals: {
16
+ ...globals.node,
17
+ },
18
+ ecmaVersion: "latest",
19
+ sourceType: "module",
20
+ },
21
+ },
22
+ {
23
+ files: ["**/*.js"],
24
+ languageOptions: {
25
+ globals: {
26
+ ...globals.node,
27
+ },
28
+ ecmaVersion: "latest",
29
+ sourceType: "script", // or "module" if you're using ESM
30
+ },
31
+ },
32
+ {
33
+ files: ["**/*.ts"],
34
+ languageOptions: {
35
+ globals: {
36
+ console: "readonly",
37
+ exports: "readonly",
38
+ module: "readonly",
39
+ require: "readonly",
40
+ },
41
+ parser: tseslint.parser,
42
+ parserOptions: {
43
+ project: "./tsconfig.json",
44
+ },
45
+ },
46
+ plugins: {
47
+ prettier: prettierPlugin,
48
+ "@typescript-eslint": tseslint.plugin,
49
+ },
50
+ 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
+ // }]
107
+ },
108
+ },
109
+ ];
@@ -0,0 +1,21 @@
1
+ import baseConfig from './base.js';
2
+
3
+ export default [
4
+ ...baseConfig,
5
+ {
6
+ files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
7
+ languageOptions: {
8
+ globals: {
9
+ browser: 'readonly',
10
+ },
11
+ ecmaVersion: 2022,
12
+ 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
+ },
20
+ },
21
+ ];
package/package.json CHANGED
@@ -1,24 +1,40 @@
1
1
  {
2
2
  "name": "voss-node-configs",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "Shared TypeScript and ESLint configs for Node.js projects",
5
5
  "exports": {
6
- "./base": "./tsconfig.base.json",
7
- "./common": "./tsconfig.common.json",
8
- "./back-end": "./back-end/tsconfig.json",
9
- "./front-end-base": "./tsconfig.front-end.base.json",
10
- "./front-end-dev": "./tsconfig.front-end.dev.json",
11
- "./front-end-build": "./tsconfig.front-end.build.json"
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",
12
+ "./lint-rules-ui": "./eslint/front-end.js",
13
+ "./lint-rules-node": "./eslint/back-end.js"
12
14
  },
13
15
  "files": [
14
- "tsconfig.base.json",
15
- "tsconfig.common.json",
16
- "tsconfig.back-end.json",
17
- "tsconfig.front-end.base.json",
18
- "tsconfig.front-end.build.json",
19
- "tsconfig.front-end.dev.json",
20
- "back-end/tsconfig.json"
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",
23
+ "eslint/front-end.js",
24
+ "eslint/back-end.js"
21
25
  ],
26
+ "devDependencies": {
27
+ "@eslint/js": "^9.0.0",
28
+ "@typescript-eslint/eslint-plugin": "^8.0.0",
29
+ "@typescript-eslint/parser": "^8.0.0",
30
+ "eslint": "^9.0.0",
31
+ "eslint-plugin-prettier": "^5.0.0",
32
+ "globals": "^15.0.0",
33
+ "typescript-eslint": "^8.0.0"
34
+ },
35
+ "peerDependencies": {
36
+ "eslint": "^9.0.0"
37
+ },
22
38
  "license": "MIT",
23
39
  "private": false,
24
40
  "publishConfig": {