mirnuyfila-task-runner
v1.0.1
Published
## Overview
Readme
Code Quality Checker
Overview
The Code Quality Checker is a Node.js package designed to help developers ensure the quality of their JavaScript code. It provides functionality for checking syntax errors and linting code to detect potential issues and adherence to coding standards.
Installation
To install the Code Quality Checker package, use npm:
npm install code-quality-checkerUsage
To use the Code Quality Checker in your Node.js application, import the CodeQualityChecker class and create an instance with your JavaScript code. You can then use the provided methods to check syntax errors and lint your code.
const CodeQualityChecker = require('code-quality-checker');
const code = `
function add(a, b) {
return a + b;
}
console.log(add(3, 5));
`;
const checker = new CodeQualityChecker(code);
const syntaxResult = checker.checkSyntaxErrors();
console.log('Syntax Check:', syntaxResult);
const lintingResult = checker.lintCode();
console.log('Linting Report:', lintingResult);API
new CodeQualityChecker(code)
Creates a new instance of the CodeQualityChecker with the provided JavaScript code.
code(string): The JavaScript code to be checked.
checkSyntaxErrors()
Checks the syntax of the provided JavaScript code and returns a result object.
- Returns:
success(boolean): Indicates if the syntax check was successful.message(string): A message describing the result of the syntax check.
lintCode()
Lints the provided JavaScript code using ESLint and returns a formatted report.
- Returns:
formattedReport(string): A formatted report of any issues found during linting.
License
This project is licensed under the MIT License - see the LICENSE file for details.
