eslint-config-d2-software
v1.0.7
Published
ESLint and Prettier configuration for projects. Based and extended from eslint-config-codely.
Downloads
4
Maintainers
Readme
🔧 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:
- eslint-plugin-sonarjs
- eslint-plugin-unicorn
- eslint-plugin-write-good-comments
- eslint-plugin-jest (Only for test files)
- eslint-plugin-jest-formatting (Only for test files)
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
},
},
],
};