ESLINT Configuration - SmartOffice-Legends/pet-health-care GitHub Wiki
This page is created for following configuration changes and giving a general overlook of Eslint configuration file eslintrc.json
-
In this project Eslint is also used for code styling using airbnb style guide.
-
Test linting is enabled for jasmine.
-
Test linting is using es2021.
-
Test linting is used for browsers.
-
.eslintignore file can be used for making Eslint ignore files.
-
.vscode/settings.json auto detects problems at each file save and corrects them if possible and validation is set for typescript.
{ "editor.codeActionsOnSave": { "source.fixAll.eslint": true }, "eslint.validate": ["typescript"] }
Eslint Usage and configuration steps can be accessed from the link.
Eslint cli options can be accessed from the link.
Rules used at this project
-
"no-duplicate-imports": "error"
Disallow duplicate module imports
-
"no-unused-private-class-members": "error"
Disallow unused private class members
-
"no-use-before-define": "error"
Disallow the use of variables before they are defined
-
"require-atomic-updates": "error"
Disallow assignments that can lead to race conditions due to usage of await or yield
-
"arrow-body-style": ["error", "always"]
Require braces around arrow function bodies
-
"camelcase": ["error", {"properties": "always"}]
Enforce camelcase naming convention
-
"capitalized-comments": ["error", "always"]
Enforce or disallow capitalization of the first letter of a comment
-
"complexity": "error"
Enforce a maximum cyclomatic complexity allowed in a program
-
"eqeqeq": "error"
Require the use of === and !==
-
"prefer-const": "error"
Require const declarations for variables that are never reassigned after declared
-
"require-await": "error"
Disallow async functions which have no await expression
-
"spaced-comment": ["error", "always"]
Enforce consistent spacing after the "//" or "/*" in a comment
-
"arrow-parens": ["error", "always"]
Require parentheses around arrow function arguments
-
"max-len": ["error", { "code": 180 }]
Enforce a maximum line length
-
"import/prefer-default-export": "off"
When there is only a single export from a module, prefer using default export over named export.
-
"no-console": "off"
Disallow the use of console