
Security News
npm ‘is’ Package Hijacked in Expanding Supply Chain Attack
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
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.21.0 \
eslint-plugin-promise@^7.2.1 \
eslint-plugin-unicorn@^59.0.0 \
eslint-plugin-import-x@^4.6.1 \
globals@^16.0.0 \
typescript@^5.8.3 \
typescript-eslint@^8.32.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 262 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.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
Security News
A critical flaw in the popular npm form-data package could allow HTTP parameter pollution, affecting millions of projects until patched versions are adopted.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.