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.
eslint-config-conventions
Advanced tools
ESLint shareable config to enforce strict conventions and good code quality.
ESLint shareable config to enforce strict conventions and good code quality.
eslint-config-conventions is a ESLint configuration to enforce strict conventions and good code quality. It supports both JavaScript and TypeScript.
This configuration is mostly for catching bugs and code-quality so it is recommended to use it with Prettier for a consistent code style, it works with any .prettierrc.json
configuration.
More information about formatting rules vs code-quality rules can be found on Prettier vs. Linters.
Node.js >= 20.11.0
npm install --save-dev \
eslint@^9.12.0 \
eslint-plugin-promise@^7.1.0 \
eslint-plugin-unicorn@^56.0.0 \
eslint-plugin-import-x@^4.3.1 \
globals@^15.10.0 \
typescript@~5.5.4 \
typescript-eslint@^8.8.0 \
eslint-config-conventions@latest
Dependencies are:
eslint-config-conventions
eslint.config.js
import typescriptESLint from "typescript-eslint"
import configConventions from "eslint-config-conventions"
export default typescriptESLint.config(...configConventions, {
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
parser: typescriptESLint.parser,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
})
npm install --save-dev prettier
# Create an empty config file to let editors and other tools know you are using Prettier
# You can personalize it with your own rules
echo "{}" > .prettierrc.json
That's all! No need to update the eslint.config.js
configuration.
We discourage usage of eslint-config-prettier and eslint-plugin-prettier, as eslint-config-conventions
doesn't include any stylistic rules, and including these packages has several drawbacks (listed in Integrating with Linters) and brings no benefits for this configuration.
package.json
{
"scripts": {
"lint:eslint": "eslint . --max-warnings 0",
"lint:prettier": "prettier . --check"
}
}
node --run lint:eslint
# or to apply automatic fixes to code
node --run lint:eslint -- --fix
# Validate code formatting in all supported languages by Prettier
node --run lint:prettier
Anyone can help to improve the project, submit a Feature Request, a bug report or even correct a simple spelling mistake.
The steps to contribute can be found in the CONTRIBUTING.md file.
FAQs
ESLint shareable config to enforce strict conventions and good code quality.
The npm package eslint-config-conventions receives a total of 62 weekly downloads. As such, eslint-config-conventions popularity was classified as not popular.
We found that eslint-config-conventions 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.