feat: Update dev environment #383 Phase 1
This commit is contained in:
parent
5a77fc2082
commit
2ddf6c6ead
7 changed files with 11324 additions and 46 deletions
|
@ -3,7 +3,7 @@
|
||||||
"image": "mcr.microsoft.com/vscode/devcontainers/base:bullseye",
|
"image": "mcr.microsoft.com/vscode/devcontainers/base:bullseye",
|
||||||
"features": {
|
"features": {
|
||||||
"ghcr.io/devcontainers/features/node:1": {
|
"ghcr.io/devcontainers/features/node:1": {
|
||||||
"version": "6.9.1"
|
"version": "22.12.0"
|
||||||
},
|
},
|
||||||
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}
|
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}
|
||||||
},
|
},
|
||||||
|
|
99
.eslintrc.js
Normal file
99
.eslintrc.js
Normal file
|
@ -0,0 +1,99 @@
|
||||||
|
// ESLint configuration for Node.js 22.12.0 LTS
|
||||||
|
export default {
|
||||||
|
"env": {
|
||||||
|
"es2024": true, // Enables ES2024 globals and syntax
|
||||||
|
"node": true, // Enables Node.js global variables and Node.js scoping
|
||||||
|
"jest": true // Keep jest environment for legacy tests during migration
|
||||||
|
},
|
||||||
|
"extends": [
|
||||||
|
"eslint:recommended",
|
||||||
|
"plugin:node/recommended",
|
||||||
|
"plugin:security/recommended",
|
||||||
|
"plugin:prettier/recommended"
|
||||||
|
],
|
||||||
|
"plugins": [
|
||||||
|
"node",
|
||||||
|
"security",
|
||||||
|
"prettier"
|
||||||
|
],
|
||||||
|
"parserOptions": {
|
||||||
|
"ecmaVersion": 2024,
|
||||||
|
"sourceType": "module", // Enable ES modules
|
||||||
|
"ecmaFeatures": {
|
||||||
|
"impliedStrict": true // Enable strict mode automatically
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
// Modern JavaScript
|
||||||
|
"no-var": "error",
|
||||||
|
"prefer-const": "error",
|
||||||
|
"prefer-rest-params": "error",
|
||||||
|
"prefer-spread": "error",
|
||||||
|
"prefer-template": "error",
|
||||||
|
"template-curly-spacing": ["error", "never"],
|
||||||
|
|
||||||
|
// ES Modules
|
||||||
|
"node/exports-style": ["error", "exports"],
|
||||||
|
"node/file-extension-in-import": ["error", "always"],
|
||||||
|
"node/prefer-global/buffer": ["error", "always"],
|
||||||
|
"node/prefer-global/console": ["error", "always"],
|
||||||
|
"node/prefer-global/process": ["error", "always"],
|
||||||
|
"node/prefer-global/url-search-params": ["error", "always"],
|
||||||
|
"node/prefer-global/url": ["error", "always"],
|
||||||
|
"node/prefer-promises/dns": "error",
|
||||||
|
"node/prefer-promises/fs": "error",
|
||||||
|
|
||||||
|
// Async patterns
|
||||||
|
"no-promise-executor-return": "error",
|
||||||
|
"require-atomic-updates": "error",
|
||||||
|
"max-nested-callbacks": ["error", 3],
|
||||||
|
|
||||||
|
// Security
|
||||||
|
"security/detect-buffer-noassert": "error",
|
||||||
|
"security/detect-child-process": "warn",
|
||||||
|
"security/detect-disable-mustache-escape": "error",
|
||||||
|
"security/detect-eval-with-expression": "error",
|
||||||
|
"security/detect-new-buffer": "error",
|
||||||
|
"security/detect-no-csrf-before-method-override": "error",
|
||||||
|
"security/detect-non-literal-fs-filename": "warn",
|
||||||
|
"security/detect-non-literal-regexp": "warn",
|
||||||
|
"security/detect-non-literal-require": "warn",
|
||||||
|
"security/detect-object-injection": "warn",
|
||||||
|
"security/detect-possible-timing-attacks": "warn",
|
||||||
|
"security/detect-pseudoRandomBytes": "warn",
|
||||||
|
|
||||||
|
// Best practices
|
||||||
|
"no-console": ["warn", { "allow": ["warn", "error", "info", "debug"] }],
|
||||||
|
"curly": ["error", "all"],
|
||||||
|
"eqeqeq": ["error", "always", { "null": "ignore" }],
|
||||||
|
"no-return-await": "error",
|
||||||
|
"require-await": "error",
|
||||||
|
|
||||||
|
// Style (with Prettier compatibility)
|
||||||
|
"prettier/prettier": ["error", {
|
||||||
|
"singleQuote": true,
|
||||||
|
"trailingComma": "es5",
|
||||||
|
"printWidth": 100,
|
||||||
|
"semi": false
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": ["**/*.test.js", "**/*.spec.js"],
|
||||||
|
"env": {
|
||||||
|
"jest": true,
|
||||||
|
"node": true
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"node/no-unpublished-require": "off",
|
||||||
|
"node/no-missing-require": "off"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"settings": {
|
||||||
|
"node": {
|
||||||
|
"version": ">=22.12.0",
|
||||||
|
"tryExtensions": [".js", ".json", ".node"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,29 +0,0 @@
|
||||||
extends:
|
|
||||||
- airbnb-base
|
|
||||||
- prettier
|
|
||||||
- plugin:node/recommended
|
|
||||||
- plugin:jest/recommended
|
|
||||||
|
|
||||||
plugins:
|
|
||||||
- prettier
|
|
||||||
- jest
|
|
||||||
|
|
||||||
env:
|
|
||||||
jest/globals: true
|
|
||||||
|
|
||||||
rules:
|
|
||||||
prettier/prettier: error
|
|
||||||
no-unused-vars: warn
|
|
||||||
no-console: off
|
|
||||||
func-names: off
|
|
||||||
no-process-exit: off
|
|
||||||
object-shorthand: off
|
|
||||||
class-methods-use-this: off
|
|
||||||
semi: [2, never]
|
|
||||||
strict: off
|
|
||||||
|
|
||||||
overrides:
|
|
||||||
- files:
|
|
||||||
- "**/*.test.js"
|
|
||||||
env:
|
|
||||||
jest: true
|
|
1
.nvmrc
Normal file
1
.nvmrc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
22.12.0
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"semi": false,
|
"singleQuote": true,
|
||||||
"singleQuote": false,
|
"trailingComma": "es5",
|
||||||
"trailingComma": "none"
|
"printWidth": 100,
|
||||||
|
"semi": false
|
||||||
}
|
}
|
11209
package-lock.json
generated
Normal file
11209
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
23
package.json
23
package.json
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "webssh2-server",
|
"name": "webssh2-server",
|
||||||
"version": "0.2.22",
|
"version": "2.0.0-alpha",
|
||||||
"ignore": [
|
"ignore": [
|
||||||
".gitignore"
|
".gitignore"
|
||||||
],
|
],
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
"Bill Church <wmchurch@gmail.com>"
|
"Bill Church <wmchurch@gmail.com>"
|
||||||
],
|
],
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 6"
|
"node": ">= 22"
|
||||||
},
|
},
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/billchurch/WebSSH2/issues"
|
"url": "https://github.com/billchurch/WebSSH2/issues"
|
||||||
|
@ -49,7 +49,7 @@
|
||||||
"start": "node index.js",
|
"start": "node index.js",
|
||||||
"lint": "eslint app",
|
"lint": "eslint app",
|
||||||
"lint:fix": "eslint app --fix",
|
"lint:fix": "eslint app --fix",
|
||||||
"watch": "NODE_ENV=development DEBUG=webssh* nodemon index.js -w app/ -w index.js -w config.json -w package.json",
|
"watch": "NODE_ENV=development DEBUG=webssh* node --watch index.js",
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
"release": "standard-version -a -s --release-as patch --commit-all",
|
"release": "standard-version -a -s --release-as patch --commit-all",
|
||||||
"release:dry-run": "standard-version -a -s --release-as patch --dry-run",
|
"release:dry-run": "standard-version -a -s --release-as patch --dry-run",
|
||||||
|
@ -74,17 +74,14 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "^5.16.0",
|
"@eslint/js": "^9.16.0",
|
||||||
"eslint-config-airbnb-base": "^13.2.0",
|
"eslint": "^9.16.0",
|
||||||
"eslint-config-prettier": "^3.6.0",
|
"eslint-config-prettier": "^9.1.0",
|
||||||
"eslint-plugin-import": "^2.29.1",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
"eslint-plugin-jest": "^21.27.2",
|
"eslint-plugin-prettier": "^5.2.1",
|
||||||
"eslint-plugin-node": "^8.0.1",
|
"eslint-plugin-security": "^3.0.1",
|
||||||
"eslint-plugin-prettier": "^2.7.0",
|
|
||||||
"jest": "^21.2.1",
|
"jest": "^21.2.1",
|
||||||
"nodemon": "^1.12.1",
|
"prettier": "^3.4.2",
|
||||||
"prettier": "^1.19.1",
|
|
||||||
"prettier-eslint": "^7.1.0",
|
|
||||||
"standard-version": "^4.4.0"
|
"standard-version": "^4.4.0"
|
||||||
},
|
},
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
|
|
Loading…
Reference in a new issue