
Research
PyPI Package Disguised as Instagram Growth Tool Harvests User Credentials
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
neutrinojs-typescript
Advanced tools
Transpiles TypeScript as part of the build process.
This follows the configuration suggested in the official TypeScript / Babel announcement.
Install dependencies:
npm install --save-dev neutrinojs-typescript typescript
(note that neutrino-typescript
in NPM - without js
- is an unrelated package which is unmaintained).
Include in .neutrinorc.js
:
const typescript = require('neutrinojs-typescript');
// ...
module.exports = {
use: [
typescript(), // must be first in use section
// ...
node(), // or whichever target you are using
],
};
Include type checking in package.json
scripts:
{
"scripts": {
"prebuild": "rewrite-tsconfig",
"prelint": "rewrite-tsconfig",
"lint": "tsc"
}
},
To combine this with other linting steps, you can join the commands like so:
{
"scripts": {
"prebuild": "rewrite-tsconfig",
"prelint": "rewrite-tsconfig",
"lint": "existing lint command && tsc"
}
},
Run npm run lint
to create the initial tsconfig.json
file and test the
integration.
A tsconfig.json
file will be generated automatcially by rewrite-tsconfig
and should be included in your repository. It does not have to be included
(the prelint
script will generate it when needed), but including it is
recommended because many IDEs will look for it to configure their own type
checking.
If you prefer managing tsconfig.json
yourself, simply remove
rewrite-tsconfig
from your NPM scripts. You will need to ensure it remains
compatible with the webpack / babel configuration in .neutrinorc.js
.
If you prefer using tsconfig.js
(or a similar tsconfig-as-code tool), remove rewrite-tsconfig
from your
NPM scripts and set the content of tsconfig.js
to:
const neutrino = require('neutrino');
module.exports = neutrino().tsconfig();
Since rewrite-tsconfig
replaces any tsconfig.json
file in the project
directory. You should specify customisations in .neutrinorc.js
instead:
const typescript = require('neutrinojs-typescript');
module.exports = {
use: [
typescript({ tsconfig: {
compilerOptions: {
strict: true,
allowJs: true,
importsNotUsedAsValues: 'remove', // legacy behaviour
typeRoots: [
'src/types', // custom types directory
'node_modules/@types',
],
},
include: ['some-other-dir'], // sources and tests are included by default
} }),
],
};
Some settings cannot be customised due to babel compatibility requirements. If you attempt to change those settings, they will be ignored and a warning will be printed.
.d.ts
) filesIf you are creating a library, you probably want to include a .d.ts
file.
This can be turned on by specifying declaration: true
as normal in the
tsconfig options:
const typescript = require('neutrinojs-typescript');
module.exports = {
use: [
typescript({ tsconfig: {
compilerOptions: {
declaration: true,
declarationMap: true, // defaults to true
},
} }),
],
};
One declaration file will be generated for each entrypoint you have specified
in mains
. The file will be named to match the input file (for default
neutrino configuration, this means you will get build/index.d.ts
).
If you want to use eslint with typescript, you can install the neutrinojs-typescript-eslint module.
This will work out-of-the-box with Jest, but you will need to install the Jest types:
npm install --save-dev @types/jest
FAQs
Typescript transpilation for neutrino projects
The npm package neutrinojs-typescript receives a total of 28 weekly downloads. As such, neutrinojs-typescript popularity was classified as not popular.
We found that neutrinojs-typescript demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.