Skip to content

mulekick/muleslint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My ESLint configuration

GitHub package.json version GitHub License Last Commit NPM Version NPM Downloads Socket Badge

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 and *.ts files, available as a shareable config.

How I use ESLint in my dev environment

  • Windows 10 x64, Hyper-V enabled
  • Debian Bullseye running in a Hyper-V VM
  • Node.js v18.16.1 LTS on Debian
  • VSCode targeting Debian through SSH
  • VSCode ESLint extension enabled
  • @mulekick/eslint-config-muleslint included in the project's dev dependencies
  • a minimal .eslintrc.json file included in the project's root folder :
{"extends": "@mulekick/eslint-config-muleslint"}

Use it in your own project

  • npm install --save-dev @mulekick/eslint-config-muleslint
  • be sure to add the above .eslintrc.json file in your project's root folder.

Configuration details

  • Extends core eslint recommended configuration (eslint:recommended)
  • Quite a few of the recommended options are overriden
  • The use of modern Javascript features (ES6 and beyond) is enforced whenever possible
  • Extends node plugin recommended configuration (plugin:node/recommended)
  • Extends import plugin recommended configuration (plugin:import/recommended)
  • Uses html plugin to lint JS code in HTML pages <script> tags
  • Enforces unix-style line breaks
  • Enforces Crockford indentation (4 spaces)
  • Enforces ESM modules use, therefore enforcing strict mode everywhere