» npm install eslint-plugin-prettier
Malware published in eslint-config-prettier and other packages
eslint-config-prettier npm package compromised
Videos
» npm install eslint-config-prettier
From the tweet:
cc @geteslint @PrettierCode @PrettierESLint
Attention!!!
I was tricked by a phishing email and a new npm token was added and leaked then some popular packages I'm maintaining were released with malicious software, I've deleted the leaked token and marked all affected bad versions as deprecated and released new versions.
All affected packages and versions are:
eslint-config-prettier
8.10.1
9.1.1
10.1.6
10.1.7
eslint-plugin-prettier:
4.2.2
4.2.3
snyckit:
0.11.9
@pkgr/core:
0.2.8
napi-postinstall:
0.3.1
–--
Reminder: if you are publishing npm packages, go to https://www.npmjs.com/settings/<YOUR_USERNAME>/tfa/list and change your 2FA method from Authenticator App to Security Key and create a passkey using biometrics. It would make it impossible to mistakenly enter the OTP into a fake scam site.
I created an angular project with NX 18 and that version unfortunately comes with flat eslint.js config which kind of makes my previous custom eslintrc.json configs obsolete.
(Since there is no eslint subreddit and I already asked on stackoverflow (https://stackoverflow.com/questions/79248446/converting-old-eslint-json-to-flat-eslint-js-for-custom-eslint-rules) I'm asking here now..)
It looks like this (with some custom eslint rules I added there, 4 extra rules for ts and 2 rules for html)
const nx = require('@nx/eslint-plugin');
module.exports = [
...nx.configs['flat/base'],
...nx.configs['flat/typescript'],
...nx.configs['flat/javascript'],
{
ignores: ['**/dist'],
},
{
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
// Override or add rules here
rules: {},
},
...nx.configs['flat/angular'],
...nx.configs['flat/angular-template'],
{
files: ['**/*.ts'],
rules: {
'@angular-eslint/directive-selector': [
'error',
{
type: 'attribute',
prefix: 'app',
style: 'camelCase',
},
],
'@angular-eslint/component-selector': [
'error',
{
type: 'element',
prefix: 'app',
style: 'kebab-case',
},
],
'@typescript-eslint/member-ordering': 'error',
'@typescript-eslint/naming-convention': 'error',
'default-case': 'error',
'default-case-last': 'error',
},
},
{
files: ['**/*.html'],
// Override or add rules here
rules: {
'@angular-eslint/template/attributes-order': ['error'],
'@angular-eslint/template/no-duplicate-attributes': ['error'],
},
},
];How do I include prettier in there with the eslint-plugin-prettier library? (that apparently combines linter and formatter). I really can't find a solution anywhere! Like wtf, why enforce a new config out of nowhere when the doc is bad...