Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
typescript-strictly-typed
Advanced tools
Enable configurations for strictly typed TypeScript, ESLint or TSLint, and optionally Angular.
Enable configurations for strictly typed TypeScript, ESLint or TSLint, and optionally Angular.
Because TypeScript strict
mode is not enough.
A blog post explains the motivation of this lib.
cd path/to/my-project
npx typescript-strictly-typed
Adding configuration for:
strict
@typescript-eslint/no-explicit-any
@typescript-eslint/explicit-function-return-type
no-any
typedef
with call-signature
fullTemplateTypeCheck
strictInjectionParameters
strictTemplates
(Angular >=9)My open source contributions are done on free time. So if your company earns money with them, it would be nice to consider becoming a sponsor.
You need a LTS version of Node and npm, ie. currently:
Be sure to invoke the command in the root directory of your project,
ie. where your configuration files (like tsconfig.json
) are located.
strict
mode is available in TypeScript >= 2.3.
ESLint must be configured for TypeScript, ie. with:
"parser": "@typescript-eslint/parser"
and "plugins": ["@typescript-eslint"]
"extends": ["@vue/typescript"]
and React uses "extends": "react-app"
)Official getting started documentation of @typescript-eslint
The project must use a LTS version of Angular CLI, ie. with a angular.json
file.
TypeScript strict
mode includes the strictPropertyInitialization
rule.
But property initialization check is an issue in Angular projects,
as most properties are initiliazed in ngOnInit()
instead of constructor()
or via decorators (mainly via @Input()
).
So this lib disables strictPropertyInitialization
by default in Angular projects,
as recommended by the Angular team.
If you're feeling adventurous and want to enable it:
npx typescript-strictly-typed --strictPropertyInitialization
This lib is here to promote good practices. But at the end of the day, it just adds a few lines in configuration files, as explained above in "What does it do?".
It was already a lot of work to support all possible official configuration formats. So if it doesn't work for your project because of a custom configuration, you can just modify the configuration files yourself.
For React apps created with create-react-app
, after running this lib command,
it will work out of the box:
eslint src/**
command)But it won't be taken into account at React compilation (ie. on npm start
),
because React does custom things.
See issue #2 if you want to help.
.eslintrc.js
(including Vue)If your project uses a .eslintrc
.js
file (instead of a more classic .eslintrc
.json
file)
you'll have to copy the strict rules newly generated in .eslintrc
.json
file
into the existing .eslintrc
.js
file.
For Vue apps created with vue create
, after running this lib command,
it will work out of the box if you chose one of the following Vue options:
But if you chose ESLint with a dedicated config file,
Vue will create a .eslintrc
.js
file and so you'll have to do the above step.
See issue #3 if you want to help.
MIT
1.0.0 (2020-01-13)
Initial release.
FAQs
Enable configurations for strictly typed TypeScript, ESLint, and optionally Angular.
The npm package typescript-strictly-typed receives a total of 30 weekly downloads. As such, typescript-strictly-typed popularity was classified as not popular.
We found that typescript-strictly-typed 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.