We have implemented a coding standard for the company for nodejs backend projects and React js front end projects where a maximum number of lines for a file should be less than 250. We want to prevent developers commit files where the lines count is greater than 250.
How do we automate this other than manually review commits?