
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@cloudflight/eslint-plugin-typescript
Advanced tools
Cloudflight eslint-plugin & eslint-config for typescript
@cloudflight/eslint-plugin-typescript
The Cloudflight ESLint Plugin Typescript provides a configuration of ESLint rules recommended by Cloudflight.
You can find the directory of all rules including their reasoning here.
The following dependencies are required:
"eslint": ">=9.0.0 < 10.0.0"
In your package.json
add the following:
"devDependencies": {
...
"@cloudflight/eslint-plugin-typescript": "<version>",
...
}
Now open your eslint.config.mjs
and add one of the configurations:
import { cloudflightTypescriptConfig } from '@cloudflight/eslint-plugin-typescript';
import { includeIgnoreFile } from '@eslint/compat';
import { dirname, normalize, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
const directory = dirname(fileURLToPath(import.meta.url));
const gitignorePath = normalize(resolve(directory, '.gitignore'));
export default [
includeIgnoreFile(gitignorePath),
...cloudflightTypescriptConfig({
rootDirectory: import.meta.dirname,
}),
];
See Custom Configuration for more complicated project setups.
When executing your next eslint .
it will now validate your code against the cloudflight-recommended rules.
This package also includes configs for formatting typescript.
In your package.json
add the following:
"devDependencies": {
...
"@cloudflight/eslint-plugin-typescript": "<version>",
...
}
Create a new file called eslint.format.mjs
and add the following:
import { cloudflightTypescriptFormatConfig } from '@cloudflight/eslint-plugin-typescript';
import { includeIgnoreFile } from '@eslint/compat';
import { dirname, normalize, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
const directory = dirname(fileURLToPath(import.meta.url));
const gitignorePath = normalize(resolve(directory, '.gitignore'));
export default [
includeIgnoreFile(gitignorePath),
...cloudflightTypescriptFormatConfig({
rootDirectory: import.meta.dirname,
}),
];
With the command eslint -c eslint.format.mjs .
your project can be checked for formatting violations.
The reason we created another eslint config file just for formatting instead of adding it to the existing one is to separate between linting and formatting, which are two different concerns. Furthermore, with the separation we also gain the ability to fix the formatting automatically before commit. Automatically fixing linting bugs with eslint --fix
is not recommended, since it changes the intent of the code.
To automatically format your code before committing, set up husky and lint-staged with the following content in your package.json
.
{
// ...
"lint-staged": {
"*.ts": "eslint -c eslint.format.mjs --fix"
}
}
FAQs
Cloudflight eslint-plugin & eslint-config for typescript
The npm package @cloudflight/eslint-plugin-typescript receives a total of 1,163 weekly downloads. As such, @cloudflight/eslint-plugin-typescript popularity was classified as popular.
We found that @cloudflight/eslint-plugin-typescript demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.