
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
@viclafouch/eslint-config-viclafouch
Advanced tools
ESLint and Prettier Config from Victor de la Fouchardiere
These are the ESLint and Prettier settings for a Next.js project ⚡️
react
hooks
next
..tsconfig.json
If you don't already have a package.json
file, create one with npm init
.
Then we need to install the config:
npm i -D @viclafouch/eslint-config-viclafouch
Create a .eslintrc
file in the root of your project's directory (it should live where package.json does). Your .eslintrc
file should look like this:
Extends your config with the minimal base of @viclafouch config :
{
"extends": [
"@viclafouch/eslint-config-viclafouch"
]
}
or js version for .eslintrc.js
file:
/**
* @type {import("eslint").Linter.Config}
*/
module.exports = {
extends: [
"@viclafouch/eslint-config-viclafouch"
]
}
You can add two scripts to your package.json to lint and/or fix your code:
{
"scripts": {
"lint": "eslint .",
"lint:fix": "npm run lint -- --fix",
}
}
First, extend your current config file tsconfig.json
with this following snippet:
{
"extends": "@viclafouch/eslint-config-viclafouch/tsconfig.json",
...
}
Then, add the TypeScript Eslint rules to your .eslintrc
file:
{
"extends": [
"@viclafouch/eslint-config-viclafouch",
"@viclafouch/eslint-config-viclafouch/typescript"
]
}
or js version for .eslintrc.js
file:
/**
* @type {import("eslint").Linter.Config}
*/
module.exports = {
extends: [
'@viclafouch/eslint-config-viclafouch',
'@viclafouch/eslint-config-viclafouch/typescript'
],
parserOptions: {
project: true,
tsconfigRootDir: __dirname
},
root: true
}
TypeScript's built-in typings are not perfect. viclafouch-reset makes them better.
reset.d.ts
file in your project with these contents:// Do not add any other lines of code to this file!
import '@viclafouch/eslint-config-viclafouch/reset.d'
You can add two scripts to your package.json to lint and/or fix your code:
{
"scripts": {
"lint": "tsc --noEmit && eslint . --ext .js,.jsx,.ts,.tsx",
"lint:fix": "npm run lint -- --fix",
},
}
If you want to sort your imports using your alias at the same time from your jsonfig.json
or tsconfig.json
file.
{
"extends": [
"@viclafouch/eslint-config-viclafouch",
"@viclafouch/eslint-config-viclafouch/imports"
]
}
You can also add additional rules for Next.js. It includes the following configurations : @viclafouch/eslint-config-viclafouch/react
, @viclafouch/eslint-config-viclafouch/hooks
and Next.js specific rules.
{
"extends": [
"@viclafouch/eslint-config-viclafouch",
"@viclafouch/eslint-config-viclafouch/next"
]
}
You can also add additional rules for only React.js ecosystem (without Next.js).
{
"extends": [
"@viclafouch/eslint-config-viclafouch",
"@viclafouch/eslint-config-viclafouch/react",
"@viclafouch/eslint-config-viclafouch/hooks"
]
}
Be sure to add the prettier config at the end of your extends
array.
{
"extends": [
"@viclafouch/eslint-config-viclafouch",
"@viclafouch/eslint-config-viclafouch/imports",
"@viclafouch/eslint-config-viclafouch/react",
"@viclafouch/eslint-config-viclafouch/hooks",
"@viclafouch/eslint-config-viclafouch/prettier" // be sure to be the last
]
}
Once you have done. You probably want your editor to lint and fix for you.
.vscode
folder at your root project, and create a settings.json
file in this folder. Then, add this little config:{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
}
FAQs
ESLint and Prettier Config from Victor de la Fouchardiere
The npm package @viclafouch/eslint-config-viclafouch receives a total of 113 weekly downloads. As such, @viclafouch/eslint-config-viclafouch popularity was classified as not popular.
We found that @viclafouch/eslint-config-viclafouch demonstrated a healthy version release cadence and project activity because the last version was released less than 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
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.