Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
@hyrious/configs
Advanced tools
Shared configs across my projects.
npm i -g @hyrious/configs
{ "extends": "@hyrious/configs/tsconfig.json" }
Default choice for normal projects.
{ "extends": "@hyrious/configs/tsconfig.strictest.json" }
The strictest
adds these configs aside from strict
:
{ "extends": "@hyrious/configs/tsconfig.casual.json" }
Less strict mode, it alters these settings from strict
:
noImplicitAny: false
It allows you to write globalThis.debug = 1
without error.
strictPropertyInitialization: false
It stops reporting error on uninitialized properties in constructor,
which allows you to write an initialize()
pattern of code.
class Rectangle {
x: number; y: number; width: number; height: number
constructor() { this.initialize.apply(this, arguments) }
initialize(x = 0, y = 0, width = 0, height = 0) { /* ... */ }
}
Why this pattern? Because you can reuse other classes' constructors without hack.
// This is a valid and common usage of JavaScript.
Rectangle.prototype.initialize.call(somethingNotRectangle, ...args)
useUnknownInCatchVariables: false
Make the err
object in catch clause as type of any
.
Some people prefer unknown
because it prevents stupid authors throwing null
or undefined
which
causes err.message
become a TypeError: Cannot read properties of undefined
.
But this is an insane idea and common codes just throw new Error('message')
.
noImplicitOverride: true
Must write an override
annotation before these methods. I just like this mark.
useDefineForClassFields: false
class { foo = 1 }
becomes class { constructor() { this.foo = 1 } }
.
FAQs
Shared configs across my projects
We found that @hyrious/configs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.