generator-superlinters

Linter configurations for Superkoders.

Usage no npm install needed!

<script type="module">
  import generatorSuperlinters from 'https://cdn.skypack.dev/generator-superlinters';
</script>

README

SuperLinters (custom yeoman generator)

Get Stylelint, ESLint and Prettier configurations, along with lint-staged pre-commit hook to living project with one command.

Installation

  1. Go to the project folder and run
npm init yo superlinters

Installation process will ask you about overriding files, even package.json. If you keep your files in version control, you don't have to be afraid of it. The package.json will be extended only, so it is also safe. Answer yes everytime.

Recommended settings

Works best with relevant editor extensions

And these settings:

Turn off default validation:

"css.validate": false,
"less.validate": false,
"scss.validate": false,

Constrain Prettier use only for correctly configured projects

"prettier.requireConfig": true,

If you feel like it, turn on Autosave formatting:

"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
    "source.fixAll.eslint": true,
    "source.fixAll.stylelint": true
},

Turn it off for unsupported languages, because it could try and fail with formatting it.

"[twig]": {
    "editor.formatOnSave": false
},
"[njk]": {
    "editor.formatOnSave": false
},

Enjoy clean code and make something nice!