Maintain consistent code style enforcement scripts across all projects by standardizing linting and formatting configurations in package.json. Use modern, supported tools instead of deprecated ones (like tslint).
Maintain consistent code style enforcement scripts across all projects by standardizing linting and formatting configurations in package.json. Use modern, supported tools instead of deprecated ones (like tslint).
Every frontend project should include these standard scripts:
{
"scripts": {
"lint-check": "ng lint",
"lint": "ng lint --fix",
"format:check": "prettier --check 'src/**/*.{js,ts,html,scss,css}' || node scripts/check-format-error.js"
}
}
This approach ensures:
lint-check
, format:check
) and auto-fixing options (lint
)When adding these scripts, make appropriate configurations in angular.json as needed to support them.
Enter the URL of a public GitHub repository