1.0.7 • Published 10 months ago

eslint-config-d2-software v1.0.7

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
github
Last release
10 months ago

🔧 ESLint and Prettier configuration for projects

Based and extended from: eslint-config-codely

Install

First of all, you need to install package:

npm install -D eslint-config-d2-software

And then, you should add this code to you .eslintrc.js file:

module.exports = {
  extends: ["eslint-config-d2-software"],
};

If your project uses TypeScript, then you should add this code:

module.exports = {
  extends: ["eslint-config-d2-software/typescript"],
  parserOptions: {
    project: ["./tsconfig.json"],
  },
};

Plugins

This config enables:

Rules overrides

module.exports = {
  // ...
  rules: {
    // Rules override
    "prettier/prettier": ["error", { printWidth: 100, useTabs: false }], // Disabled codely useTabs (sorry I prefer spaces)
    "unicorn/prefer-module": "off", // Disable ESModule error from unicorn
    // Write good comments rules
    "write-good-comments/write-good-comments": "warn", // Neccesary for write-good-comments plugin
  },
  // ...
};

Some extras:

module.exports = {
  // ...
  overrides: [
    // ...
    {
      files: ["jest.config.js"],
      rules: {
        // Write good comments rules
        "write-good-comments/write-good-comments": "off", // Disable comments check in Jest config file
      },
    },
  ],
};

Credits