
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@6river/prettier-config
Advanced tools
@6river/prettier-config
6 River Systems Prettier configuration.
npm install --save-dev @6river/prettier-config
The simplest way to use it is package.json
:
"prettier": "@6river/prettier-config"
You can also use a standalone file like .prettierrc.json
:
"@6river/prettier-config"
To extend the configuration, use .prettierrc.js
:
module.exports = {
...require('@6river/prettier-config'),
semi: false,
};
For more information, see the Prettier documentation.
npm install --save-dev eslint-config-prettier
In your ESLint configuration, add "prettier"
to extends
. For example, with .eslintrc.json
and the 6 River ESLint configuration:
{
"extends": ["6river", "prettier"]
}
If you are using Typescript and the ESLint plugin @typescript-eslint/eslint-plugin
, add "prettier/@typescript-eslint"
to extends
as well. For example, with .eslintrc.json
and the 6 River ESLint configuration:
{
"extends": ["6river/typescript", "prettier", "prettier/@typescript-eslint"]
}
For more information, see the eslint-config-prettier
documentation.
The most common way to use Prettier is through an editor plugin that automatically formats files on every save. If you use VS Code, the most popular Prettier plugin is esbenp.prettier-vscode
.
There are Prettier plugins for most editors. See the full list on prettier.io.
In projects that use Prettier, it can be useful to set up a commit hook to ensure that no new code is committed without being formatted. This can also be used for a gradual migration to Prettier.
To format staged files with Prettier before each commit, you can use pretty-quick
with husky
.
npm install --save-dev pretty-quick husky
Add the following to package.json
:
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged"
}
}
To ensure that code is formatted as part of the continuous integration (CI) process, you can use pretty-quick
. Since pretty-quick
only looks at changed files, it will only fail CI when there are unformatted files in the current branch.
Add the following to your CI configuration:
npx pretty-quick --check
Optionally, use the --branch
flag to set the base branch to something other than master
.
To convert an entire project to Prettier format:
.prettierignore
. Most of the time, this can be done with cp .gitignore .prettierignore
.npx prettier --write '**/*.{js,ts,md,json,yml,yaml,css,scss,less,graphql,mdx,jsx,tsx}'
FAQs
6 River Systems Prettier configuration.
The npm package @6river/prettier-config receives a total of 103 weekly downloads. As such, @6river/prettier-config popularity was classified as not popular.
We found that @6river/prettier-config demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.