This tool is designed to streamline the linting process for JavaScript projects using ESLint and SonarQube. It automates the configuration of ESLint and facilitates integration with your SonarQube server for comprehensive code analysis.
ESLint configuration can be customized in the .eslintrc.js
file. Refer to the ESLint documentation for available configuration options and rules.
Configure your SonarQube server settings in the lint.config.js
file.
To lint your code using ESLint, run the following command:
-** To run locally **
npx npx ZDLintingFramework lint -- --dir=path/to/file
--** To run CI **
npx ZDLintingFramework lint-ci
-
--dir
- specify directory to lint
This project uses Jest for unit testing.
-
Install dependencies (if not already):
npm install
-
(Optional) If you add new test files, ensure they are named
*.test.js
and placed insrc/test/
orsrc/utils/
.
npm test
or
npx jest
- The project uses ES modules (
"type": "module"
inpackage.json
). - Jest config is in
jest.config.js
. - You can mock dependencies using
jest.mock()
as shown in the test files.
For more advanced configuration, see the Jest documentation.