Showing 52 of 52 total issues
When chaining calls, put method calls on new lines. Open
const parts = hyphenatedRoomId.toUpperCase().trim().split('-');
- Read upRead up
- Exclude checks
Rule: newline-per-chained-call
Requires that chained method calls be broken apart onto separate lines.
Rationale
This style helps to keep code 'vertical', avoiding the need for side-scrolling in IDEs or text editors.
Config
Not configurable
For more information see this page.
When chaining calls, put method calls on new lines. Open
const weeks = weekIdString.slice(weekIdString.indexOf(':') + 1).trim().split(',');
- Read upRead up
- Exclude checks
Rule: newline-per-chained-call
Requires that chained method calls be broken apart onto separate lines.
Rationale
This style helps to keep code 'vertical', avoiding the need for side-scrolling in IDEs or text editors.
Config
Not configurable
For more information see this page.
Use 'undefined' instead of 'null' Open
return null;
- Read upRead up
- Exclude checks
Rule: no-null-keyword
Disallows use of the null
keyword literal.
Rationale
Instead of having the dual concepts of null
andundefined
in a codebase,
this rule ensures that only undefined
is used.
JavaScript originally intended undefined
to refer to a value that doesn't yet exist,
while null
was meant to refer to a value that does exist but points to nothing.
That's confusing.
undefined
is the default value when object members don't exist, and is the return value
for newer native collection APIs such as Map.get
when collection values don't exist.
const myObject = {};
myObject.doesNotExist; // undefined
const myMap = new Map<string number>();
myMap.get("doesNotExist"); // undefined</string>
To remove confusion over the two similar values, it's better to stick with just undefined
.
Notes
- Has Fix
Config
Not configurable.
Examples
"no-null-keyword": true
For more information see this page.
When chaining calls, put method calls on new lines. Open
name: $(teachingWeekSelector, row).text(),
- Read upRead up
- Exclude checks
Rule: newline-per-chained-call
Requires that chained method calls be broken apart onto separate lines.
Rationale
This style helps to keep code 'vertical', avoiding the need for side-scrolling in IDEs or text editors.
Config
Not configurable
For more information see this page.
When chaining calls, put method calls on new lines. Open
$(daySelector).each((day: Day, timetableDay: CheerioElement) => {
- Read upRead up
- Exclude checks
Rule: newline-per-chained-call
Requires that chained method calls be broken apart onto separate lines.
Rationale
This style helps to keep code 'vertical', avoiding the need for side-scrolling in IDEs or text editors.
Config
Not configurable
For more information see this page.
When chaining calls, put method calls on new lines. Open
const weeks = weekIdString.slice(weekIdString.indexOf(':') + 1).trim().split(',');
- Read upRead up
- Exclude checks
Rule: newline-per-chained-call
Requires that chained method calls be broken apart onto separate lines.
Rationale
This style helps to keep code 'vertical', avoiding the need for side-scrolling in IDEs or text editors.
Config
Not configurable
For more information see this page.
When chaining calls, put method calls on new lines. Open
const date = `${$(dateSelector, moduleTimetable).text().trim()} ${$(timeSelector, moduleTimetable).text().trim()}`;
- Read upRead up
- Exclude checks
Rule: newline-per-chained-call
Requires that chained method calls be broken apart onto separate lines.
Rationale
This style helps to keep code 'vertical', avoiding the need for side-scrolling in IDEs or text editors.
Config
Not configurable
For more information see this page.
When chaining calls, put method calls on new lines. Open
info: $(infoSelector, moduleTimetable).text().trim(),
- Read upRead up
- Exclude checks
Rule: newline-per-chained-call
Requires that chained method calls be broken apart onto separate lines.
Rationale
This style helps to keep code 'vertical', avoiding the need for side-scrolling in IDEs or text editors.
Config
Not configurable
For more information see this page.
When chaining calls, put method calls on new lines. Open
$(lessonSelector, timetableDay).each((_: number, lesson: CheerioElement) => {
- Read upRead up
- Exclude checks
Rule: newline-per-chained-call
Requires that chained method calls be broken apart onto separate lines.
Rationale
This style helps to keep code 'vertical', avoiding the need for side-scrolling in IDEs or text editors.
Config
Not configurable
For more information see this page.
When chaining calls, put method calls on new lines. Open
date: moment.tz(date, examDateFormat, timezone).toDate(),
- Read upRead up
- Exclude checks
Rule: newline-per-chained-call
Requires that chained method calls be broken apart onto separate lines.
Rationale
This style helps to keep code 'vertical', avoiding the need for side-scrolling in IDEs or text editors.
Config
Not configurable
For more information see this page.
When chaining calls, put method calls on new lines. Open
startDate: moment.tz($(startDateSelector, row).text(), weekDateFormat, timezone).toDate(),
- Read upRead up
- Exclude checks
Rule: newline-per-chained-call
Requires that chained method calls be broken apart onto separate lines.
Rationale
This style helps to keep code 'vertical', avoiding the need for side-scrolling in IDEs or text editors.
Config
Not configurable
For more information see this page.
When chaining calls, put method calls on new lines. Open
const date = `${$(dateSelector).text().trim()} ${$(timeSelector).text().trim()}`;
- Read upRead up
- Exclude checks
Rule: newline-per-chained-call
Requires that chained method calls be broken apart onto separate lines.
Rationale
This style helps to keep code 'vertical', avoiding the need for side-scrolling in IDEs or text editors.
Config
Not configurable
For more information see this page.
When chaining calls, put method calls on new lines. Open
const date = `${$(dateSelector, moduleTimetable).text().trim()} ${$(timeSelector, moduleTimetable).text().trim()}`;
- Read upRead up
- Exclude checks
Rule: newline-per-chained-call
Requires that chained method calls be broken apart onto separate lines.
Rationale
This style helps to keep code 'vertical', avoiding the need for side-scrolling in IDEs or text editors.
Config
Not configurable
For more information see this page.
When chaining calls, put method calls on new lines. Open
const splitIds = roomIdString.toUpperCase().trim().split(/\s+/g);
- Read upRead up
- Exclude checks
Rule: newline-per-chained-call
Requires that chained method calls be broken apart onto separate lines.
Rationale
This style helps to keep code 'vertical', avoiding the need for side-scrolling in IDEs or text editors.
Config
Not configurable
For more information see this page.
When chaining calls, put method calls on new lines. Open
const date = `${$(dateSelector).text().trim()} ${$(timeSelector).text().trim()}`;
- Read upRead up
- Exclude checks
Rule: newline-per-chained-call
Requires that chained method calls be broken apart onto separate lines.
Rationale
This style helps to keep code 'vertical', avoiding the need for side-scrolling in IDEs or text editors.
Config
Not configurable
For more information see this page.
When chaining calls, put method calls on new lines. Open
info: $(infoSelector).text().trim(),
- Read upRead up
- Exclude checks
Rule: newline-per-chained-call
Requires that chained method calls be broken apart onto separate lines.
Rationale
This style helps to keep code 'vertical', avoiding the need for side-scrolling in IDEs or text editors.
Config
Not configurable
For more information see this page.
When chaining calls, put method calls on new lines. Open
date: moment.tz(date, examDateFormat, timezone).toDate(),
- Read upRead up
- Exclude checks
Rule: newline-per-chained-call
Requires that chained method calls be broken apart onto separate lines.
Rationale
This style helps to keep code 'vertical', avoiding the need for side-scrolling in IDEs or text editors.
Config
Not configurable
For more information see this page.
Use 'undefined' instead of 'null' Open
return null;
- Read upRead up
- Exclude checks
Rule: no-null-keyword
Disallows use of the null
keyword literal.
Rationale
Instead of having the dual concepts of null
andundefined
in a codebase,
this rule ensures that only undefined
is used.
JavaScript originally intended undefined
to refer to a value that doesn't yet exist,
while null
was meant to refer to a value that does exist but points to nothing.
That's confusing.
undefined
is the default value when object members don't exist, and is the return value
for newer native collection APIs such as Map.get
when collection values don't exist.
const myObject = {};
myObject.doesNotExist; // undefined
const myMap = new Map<string number>();
myMap.get("doesNotExist"); // undefined</string>
To remove confusion over the two similar values, it's better to stick with just undefined
.
Notes
- Has Fix
Config
Not configurable.
Examples
"no-null-keyword": true
For more information see this page.
When chaining calls, put method calls on new lines. Open
const date = `${$(dateSelector, moduleTimetable).text().trim()} ${$(timeSelector, moduleTimetable).text().trim()}`;
- Read upRead up
- Exclude checks
Rule: newline-per-chained-call
Requires that chained method calls be broken apart onto separate lines.
Rationale
This style helps to keep code 'vertical', avoiding the need for side-scrolling in IDEs or text editors.
Config
Not configurable
For more information see this page.
When chaining calls, put method calls on new lines. Open
moduleId: $(moduleIdSelector, moduleTimetable).text().trim(),
- Read upRead up
- Exclude checks
Rule: newline-per-chained-call
Requires that chained method calls be broken apart onto separate lines.
Rationale
This style helps to keep code 'vertical', avoiding the need for side-scrolling in IDEs or text editors.
Config
Not configurable
For more information see this page.