My ESLint config for Javascript, Typescript, React and Node ๐

I use the ESLint extension on Visual Studio code in my day-to day coding activities. I find ESLint to be of a great help to write some proper, clean-cut ES6 code, avoid errors and enforce best practices. Here is the configuration I use to lint my *.js
, *.ts
, *.jsx
and *.tsx
files, available as a shareable config.
How I use ESLint in my dev environment
- Windows 10 x64, Hyper-V enabled.
- Debian Bookworm running in a Hyper-V VM.
- Node.js v22.15.0 LTS on Debian.
- VSCode targeting Debian through SSH.
- VSCode ESLint extension enabled.
- ESLint v9.29.0 installed as a project dev dependency.
@mulekick/eslint-config-muleslint
installed as a project dev dependency.
- A minimal
eslint.config.js
file included in the project's root folder :
import muleslint from "@mulekick/eslint-config-muleslint";
import typescript from "typescript-eslint";
export default typescript.config(...muleslint, {
ignores: [ `**/node_modules/**`, `**/dist/**`, `**/build/**` ]
});
Use it in your own project
- Install with
npx install-peerdeps --dev @mulekick/eslint-config-muleslint
.
- Be sure to add the above
eslint.config.js
file in your project's root folder.
Configuration details
- This configuration uses the new eslint flat config format.
- It extends the following configurations :
eslint.configs.recommended | core eslint recommended configuration |
stylistic.configs.recommended | recommended configuration for stylistic-related eslint rules |
typescript.configs.strictTypeChecked | typescript-eslint strict configuration with type-checked linting enabled ๐ค |
import.flatConfigs.recommended | recommended configuration from the eslint import plugin |
n.configs['flat/recommended'] | recommended configuration from the eslint node plugin |
react.configs.flat.recommended | recommended configuration from the eslint react plugin |
security.configs.recommended | recommended configuration from the eslint security plugin |
- It also uses the html plugin to lint JS code in HTML pages
<script>
tags.
- Quite a few of the
eslint.configs.recommended
and stylistic.configs.recommended
options are overriden ๐
- The use of modern ECMA features (ES6 and beyond) is enforced whenever possible.
- The use of Crockford indentation (4 spaces) and unix-style line breaks is enforced as well.
- ESM modules use is enforced too, therefore making strict mode mandatory everywhere ๐