
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@apify/eslint-config-ts
Advanced tools
npm install --save-dev eslint typescript @apify/eslint-config-ts @typescript-eslint/eslint-plugin @typescript-eslint/parser
To make use of React types such as state, children etc. install:
npm i --save-dev @types/react
.eslintrc
Add (or replace @apify/eslint-config
package)
{
"extends": "@apify/eslint-config-ts"
}
NOTE (from https://eslint.org/docs/developer-guide/shareable-configs):
When using scoped modules it is not possible to omit the eslint-config- prefix. Doing so would result in package naming conflicts, and thus in resolution errors in most of cases. For example a package named @scope/eslint-config-myconfig vs @scope/my-config, since both are valid scoped package names, the configuration should be specified as:
{
"extends": "@scope/eslint-config-myconfig"
}
tsconfig.json
Create tsconfig.json
file in the root of the project and add:
{}
List of all options https://www.typescriptlang.org/tsconfig
{
"compilerOptions": {
"skipLibCheck": true,
"esModuleInterop": true,
"jsx": "preserve",
"noUnusedLocals": true,
"noUnusedParameters": true
},
"exclude": [
"node_modules",
],
"include": [
"**/*.ts",
"**/*.tsx"
]
}
skipLibCheck
:
Skips typechecking of 3rd party libraries declaration files (extension .d.ts) since they may have different tsconfig
esModuleInterop
:
Allows eg "import React from 'react'" instead of "import * as React from 'react'"
jsx
:
Allows use of JSX tags
noUnusedLocals
:
Error on unused variables
noUnusedParameters
:
Error on unused function params
Edit lint npm script to include .ts, .tsx files and to run typescript validation
"eslint --ext .js,.jsx,.ts,.tsx ; tsc --noemit"
FAQs
Typescript ESLint configuration shared across projects in Apify.
We found that @apify/eslint-config-ts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 10 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
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.