Stop/warn user when declaring an already existing task or a loop
- Dominant language
- JavaScript
- Stars
- 12.2k
- Forks
- 1.5k
- PR merge metrics
- No merged PRs in 30d
Description
(this is a proposed feature for discussion, I'll gladly do the PR afterwards)
Sometimes, distracted or new developers declare custom tasks using names that are already used for other tasks, which yields surprising (for them) results. Worse, they sometimes do it in a multi-task, which then causes an infinite loop and baffles them:
```
grunt.registerTask('uglify', ['build', `copy`, 'uglify']);
grunt.loadNpmTasks('grunt-contrib-uglify');
```
My proposal would be to have grunt fail with a nice explanation in this case.
What do you think?
Contributor guide
Research direction
The issue names no files, tests, or entry points. Start by tracing how tasks are registered, loaded, and expanded, then determine how duplicate names and recursive task lists should be detected and reported; done would be a decided behavior with coverage for both cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- build-system, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100