Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@codingwithchris/eslint-config
Advanced tools
My ESLint is currently set up out of the box to work for projects that are using the following stack:
I am currently extending the eslint-config-airbnb-typescript package. It's built on the eslint-config-airbnb config and it adds Typescript support on top of it. I have future plans to build my own ESLint from the ground up :)
package.json
file, create one with npm init
.For NPM:
npx install-peerdeps --dev @codingwithchris/eslint-config
For Yarn (npm5+ only):
npx install-peerdeps --dev @codingwithchris/eslint-config -Y
Hey, now!! It automagically works with Yarn too! 🎉🎉🎉
.eslintrc
file in the root of your project's directory (it should live where package.json does).For a Vanilla Javascript project
{
"extends": [
"@codingwithchris/eslint-config/vanilla-js"
]
}
For a Vanilla React project
{
"extends": [
"@codingwithchris/eslint-config/vanilla-react"
]
}
For a Vanilla Typescript project
{
"extends": [
"@codingwithchris/eslint-config/vanilla-typescript"
]
}
For a React Typescript project
{
"extends": [
"@codingwithchris/eslint-config/react-typescript"
]
}
Tip: You can alternatively put this object in your package.json
under the property "eslintConfig"
:. This makes one less file in your project.
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix"
},
npm run lint
and fix all fixable issues with npm run lint:fix
.I highly recommend configuring your editor to do this automatically on file save across your whole project.
Install the ESLint plugin for VSCode
Create a file in your current project in .vscode/settings.json
.
Place the following configuration in the file:
{
//
// Auto-run code formatting on save
//
"editor.formatOnSave": true,
// Tell the ESLint plugin to run on save
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
// The following prevents linting from running twice
// turn it off for JS and JSX, we will do this via eslint
"[javascript]": {
"editor.formatOnSave": false
},
"[javascriptreact]": {
"editor.formatOnSave": false
},
// Turn it off for TS & TSX
"[typescript]": {
"editor.formatOnSave": false
},
"[typescriptreact]": {
"editor.formatOnSave": false
},
}
.vscode/extensions.json
with the following content:{
// See http://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"dbaeumer.vscode-eslint"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": [
"esbenp.prettier-vscode", // You don't need the prettier extension with this setup
"editorconfig.editorconfig", // You don't need editor config with this setup
]
}
This will make sure that anyone working on the project is aware of enabling/disabling proper extensions!
FAQs
My ESLint config for writing clean, consistent code
The npm package @codingwithchris/eslint-config receives a total of 1 weekly downloads. As such, @codingwithchris/eslint-config popularity was classified as not popular.
We found that @codingwithchris/eslint-config demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.