
Security News
Node.js TSC Votes to Stop Distributing Corepack
Corepack will be phased out from future Node.js releases following a TSC vote.
@bonniernews/eslint-config
Advanced tools
Basic ESLint rules used by Bonnier News. The configuration works both with CommonJS and ES6 modules,
and the appropriate setup will be used by looking at the projects package.json
type property.
For Node versions that support it (version 16 and above), the es2022
environment will also be activated. Otherwise es2021
will be used.
Install eslint
and @bonniernews/eslint-config
:
npm install --save-dev eslint @bonniernews/eslint-config
To activate the config, you need to add the following to your .eslintrc.json
-file:
{
"root": true,
"extends": [ "@bonniernews" ]
}
To activate the config, you need to add the following to your .eslintrc.json
-file:
{
"root": true,
"extends": [ "@bonniernews/eslint-config/react" ]
}
This will enable the react plugin for *.jsx
-files.
To activate the config, you need to add the following to your .eslintrc.json
-file:
{
"root": true,
"extends": [ "@bonniernews/eslint-config/typescript" ]
}
This will enable the typescript plugin for *.ts
-files.
To activate the config, you need to add the following to your .eslintrc.json
-file:
{
"root": true,
"extends": [ "@bonniernews/eslint-config/typescript-react" ]
}
This will enable the typescript and react plugin for *.tsx
-files.
You can also choose to use the test config, which is adapted to testing using mocha
, mocha-cakes-2
and chai
. To also enable this,
either add a separate test configuration file extending from "@bonniernews/eslint-config/test"
, or use the "@bonniernews/eslint-config/all"
in your root configuration to activate everything together:
{
"root": true,
"extends": [ "@bonniernews/eslint-config/all" ]
}
This will activate the test configuration for all files inside directories named test
or tests
.
Run with:
npx eslint .
husky
hooks that uses libraries such as pretty-quick
from your package.json
pretty-quick
if possible.package.json
, i.e.:
eslint-config-airbnb
eslint-config-google
eslint-config-prettier
eslint-plugin-prettier
from package.json
eslint
dependancy.
npm
(if you use nvm nvm install-latest-npm
) & prettier
as-welleslint-plugin-chai-friendly
is used in test).mocha-cakes-2
in your test configuration, they already exist
in the @bonniernews/eslint-config/test
and @bonniernews/eslint-config/all
configs.Once you complete the steps above run the following:
npx eslint . --fix
If you want to use Prettier, run it before eslint. ESLint should be the final judge, i.e. run:
npx prettier --save .
npx eslint . --fix
This will format the entire code base according to the rules of Prettier and the config.
Can be found here.
Released under the MIT license.
1.2.0
typescript
to 5.4.3 and @typescript-eslint
to 7.4.0.FAQs
ESLint config
We found that @bonniernews/eslint-config 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
Corepack will be phased out from future Node.js releases following a TSC vote.
Research
Security News
Research uncovers Black Basta's plans to exploit package registries for ransomware delivery alongside evidence of similar attacks already targeting open source ecosystems.
Security News
Oxlint's beta release introduces 500+ built-in linting rules while delivering twice the speed of previous versions, with future support planned for custom plugins and improved IDE integration.