
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@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
Configures all rules, js, ts, tsx, jsx and test rules.
To activate the config, you need to add the following to your eslint.config.js
-file:
"use strict";
module.exports = require("@bonniernews/eslint-config");
To activate the config, you need to add the following to your eslint.config.js
-file:
"use strict";
module.exports = require("@bonniernews/eslint-config/js");
To activate the config, you need to add the following to your eslint.config.js
-file:
"use strict";
module.exports = require("@bonniernews/eslint-config/ts");
To activate the config, you need to add the following to your eslint.config.js
-file:
"use strict";
module.exports = require("@bonniernews/eslint-config/jsx");
Adds useful plugins and globals for testing with mocha-cakes-2 + chai.
To activate the config, you need to add the following to your eslint.config.js
-file (for js):
"use strict";
module.exports = require("@bonniernews/eslint-config/test-js");
or the following (for ts):
"use strict";
module.exports = require("@bonniernews/eslint-config/test-ts");
To activate the config, you need to add the following to your eslint.config.js
-file:
"use strict";
module.exports = require("@bonniernews/eslint-config/tsx");
To activate this config (in addition to other config(s), using it alone makes no sense), add the following:
"use strict";
const ignores = require("@bonniernews/eslint-config/ignores");
module.exports = [
...allYourGoodConfigs,
ignores
];
Globals for browsers, etc. that may be needed.
"use strict";
const globals = require("@bonniernews/eslint-config/globals");
module.exports = [
...allYourGoodConfigs,
{ files: [ "assets/scripts" ], languageOptions: { globals: globals.browser } }
];
2.X introduces eslint 9 which has a different configuration format. It is recommended to read the eslint migration guide.
A major change from eslint 8 is that only one eslint.config.js
file will be used, placing a specific configuration file in a folder will not behave in the same
way as in 8 where it would inherit the configuration from files from the root folder, and the new recommendation is to just have one eslint.config.js
at the root
of the repository.
One major change from eslint 8 is that in order for ignores to be global they need to be added in a single config at the root level. If you just use the @bonniernews/eslint-config
you will have it included, but if you construct your own set of rules you need to add it manually to your config file, otherwise eslint will run on files in terraform directories and such.
The different rule sets have changed name and behaviour:
@bonniernews/eslint-config
will import configs and apply them to the respective targets@bonniernews/eslint-config/js
config for js files@bonniernews/eslint-config/ts
config for ts files@bonniernews/eslint-config/jsx
config for jsx files@bonniernews/eslint-config/tsx
config for tsx files@bonniernews/eslint-config/test-js
config for test js files using mocha-cakes-2 and chai@bonniernews/eslint-config/test-ts
config for test ts files using mocha-cakes-2 and chai@bonniernews/eslint-config/ignores
global ignoresRun 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.
2.0.2
FAQs
ESLint config
The npm package @bonniernews/eslint-config receives a total of 1,713 weekly downloads. As such, @bonniernews/eslint-config popularity was classified as popular.
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 37 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.