English
@mmd-toolkit/gantt-no-unknown-exclude
Disallow a word in excludes that is neither weekends nor the name of a day.
✅ The recommended configuration enables this rule.
🔧 This rule is automatically fixable by the --fix CLI option.
excludes leaves days out of the time that the tasks take: weekends, a day of the week such as sunday, or a date. mermaid.js accepts any word there, and a word that is none of these leaves out nothing, without an error. A misspelled word, as weekend, lets the tasks run through the weekend.
Rule Details
This rule applies to Gantt charts (gantt). It reports an excludes item with no digit that is neither weekends nor a full English weekday name from monday to sunday, so abbreviations such as sat and the word weekdays are reported. The comparison ignores case, so WeekEnds and Friday are not reported.
An item with a digit is read as a date and is not checked, also when it leaves out no day, as excludes 06-01-2024 with dateFormat YYYY-MM-DD. Items in includes are not checked either.
Examples of incorrect code for this rule:
mmd
%% eslint @mmd-toolkit/gantt-no-unknown-exclude: error
gantt
dateFormat YYYY-MM-DD
excludes weekend
Design : 2024-01-05, 3dmmd
%% eslint @mmd-toolkit/gantt-no-unknown-exclude: error
gantt
dateFormat YYYY-MM-DD
excludes sat, sun
Design : 2024-01-05, 3dExamples of correct code for this rule:
mmd
%% eslint @mmd-toolkit/gantt-no-unknown-exclude: error
gantt
dateFormat YYYY-MM-DD
excludes weekends
Design : 2024-01-05, 3dmmd
%% eslint @mmd-toolkit/gantt-no-unknown-exclude: error
gantt
dateFormat YYYY-MM-DD
excludes saturday, sunday, 2024-01-08
Design : 2024-01-05, 3dOptions
This rule has no options.
Further Reading
Version
This rule was introduced in @mmd-toolkit/eslint-plugin v0.1.0.