eslint-plugin-varp

ESLint and Prettier Config from Varp

Usage no npm install needed!

<script type="module">
  import eslintPluginVarp from 'https://cdn.skypack.dev/eslint-plugin-varp';
</script>

README

eslint-plugin-varp

How to set up

  1. Install package and it's peer dependencies:
npx install-peerdeps --dev eslint-plugin-varp
  1. Create .eslintrc.js file in root with content:
module.exports = {
    parser: "@typescript-eslint/parser",
    plugins: ["varp"],
    rules: {
      ...
    },
    parserOptions: {
        ecmaVersion: 2018,
        sourceType: "module",
        ecmaFeatures: {
            jsx: true,
        },
    },
};
  1. Add .vscode/settings.json file with content:
{
    "eslint.format.enable": true,
    "eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact", "html", "markdown"],
    "editor.formatOnSave": true,
    "editor.codeActionsOnSave": {
        "source.fixAll.eslint": true
    },
    "editor.defaultFormatter": "dbaeumer.vscode-eslint"
}
  1. Add new scripts to package.json:
"scripts": {
  "lint": "eslint .",
  "lint:fix": "eslint . --fix"
}

Optional Settings

  • Remove or disable Prettier to not intersept with ESLint