eslint-config-bobobox
v1.1.1
Published
Bobobox eslint rules
Downloads
73
Readme
ESLint-Config-Bobobox
This is ESLint rules that Bobobox use for frontend projects. Currently it contains some custom rules depending on our current needs.
⚠️Before You install This
There're maybe some rules that you have to disable if you mix JS/TS or JS only codebase. And, this ESLint rules may changes without any announcement because of company needs.
Installation
npm i --save-dev eslint-config-bobobox
# or if you're using yarn
yarn add -D eslint-config-bobobox
Usage
In your .eslintrc
file you can extend like this
mocule.exports = {
extends: ["bobobox"],
};
What's in here?
eslint-config-bobobox
uses custom ESLint rules to adjust based on the company's current needs. But it also uses some plugins and extend the configuration from external library:
typescript-eslint/eslint-plugin
: Add some new useful plugineslint-plugin-import
: auto import sorting and grouping lintereslint-plugin-unused-import
: to avoid unused import or variableeslint-plugin-sonarjs
: SonarJS rules for ESLint to detect bugs and suspicious patterns in your code.
The ESLint rules that we used here
rules: {
"no-unused-vars": "off",
"no-var": "warn",
"@typescript-eslint/no-unused-vars": "off",
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"warn",
{
vars: "all",
varsIgnorePattern: "^_",
args: "after-used",
argsIgnorePattern: "^_",
},
],
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/naming-convention": [
"warn",
{
selector: "variable",
format: ["camelCase", "snake_case", "PascalCase"],
},
{ selector: "typeProperty", format: ["camelCase", "snake_case"] },
{ selector: "function", format: ["camelCase"] },
{ selector: "typeAlias", format: ["PascalCase"] },
{ selector: "parameter", format: ["camelCase", "snake_case"] },
],
"import/order": [
"warn",
{
groups: [
["builtin", "external"],
"internal",
"parent",
["sibling", "index"],
"object",
],
"newlines-between": "always",
alphabetize: {
order: "asc",
caseInsensitive: true,
},
},
],
complexity: "warn",
"no-console": ["error"],
"sonarjs/no-duplicate-string": ["error", 8],
},
By the way, want to have a staycation in a high-tech capsule hotel or cabin? Visit our website at https://bobobox.co.id/.