Skip to content

Commit 2524b6d

Browse files
authored
WV-2812: ESLint Cleanup: Line length (#6248)
* Removed '--quiet' from npm run lint:js so its 'loud' again * web/.eslintrc: 'max-len' rule set to 'error' * ESLint max-len corrections. Part 1 * ESLint max-len corrections. Part 2
1 parent d33a2d3 commit 2524b6d

File tree

130 files changed

+1312
-473
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+1312
-473
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"linkcheck": "node ./tasks/link-check",
6161
"lint": "run-s lint:js lint:scss",
6262
"lint:scss": "npx stylelint ./web/scss/**/*.scss",
63-
"lint:js": "npx eslint . --quiet",
63+
"lint:js": "npx eslint .",
6464
"preinstall": "node tasks/util/checkNodeVersion.js",
6565
"postinstall": "patch-package && husky",
6666
"start": "node ./tasks/util/start.js",

web/.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
// Base rule overrides
8888
"no-nested-ternary": "off", // 164 errors across 40 files
8989
"no-shadow": "warn", // 110 errors across 40 files
90-
"max-len": "off", // 315 errors across 109 files
90+
"max-len": "error", // 315 errors across 109 files
9191
"consistent-return": "off", // 95 errors across 58 files
9292
"no-underscore-dangle": "off", // 40 errors across 7 files
9393
"no-param-reassign": [ // 198 errors across 46 files

web/js/app.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ class App extends React.Component {
7171
kioskModeEnabled, notifications, numberOutagesUnseen, e2eModeEnabled, hideNotificationsPopup,
7272
} = this.props;
7373
if (numberOutagesUnseen !== prevProps.numberOutagesUnseen) {
74-
if (numberOutagesUnseen > 0 && !kioskModeEnabled && !e2eModeEnabled && !hideNotificationsPopup) {
74+
if (numberOutagesUnseen > 0 && !kioskModeEnabled
75+
&& !e2eModeEnabled && !hideNotificationsPopup) {
7576
this.openNotification(notifications, numberOutagesUnseen);
7677
}
7778
}
@@ -165,7 +166,8 @@ class App extends React.Component {
165166
<MapInteractions />
166167
<AlertDropdown isTourActive={isTourActive} />
167168
<div>
168-
{isTourActive && (numberOutagesUnseen === 0 || hideNotificationsPopup) && (!isMobile || isEmbedModeActive) ? <Tour /> : null}
169+
{isTourActive && (numberOutagesUnseen === 0
170+
|| hideNotificationsPopup) && (!isMobile || isEmbedModeActive) ? <Tour /> : null}
169171
</div>
170172
<Sidebar />
171173
<div id="layer-modal" className="layer-modal" />

web/js/components/animation-widget/gif-button.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ function GifButton(props) {
7474
if (gifDisabled) {
7575
return;
7676
}
77-
const nonDownloadableLayers = hasNonDownloadableLayer ? getNonDownloadableLayers(visibleLayersForProj) : null;
77+
const nonDownloadableLayers = hasNonDownloadableLayer
78+
? getNonDownloadableLayers(visibleLayersForProj) : null;
7879
const paletteStore = lodashCloneDeep(activePalettes);
7980
await getPromise(hasCustomPalettes, 'palette', clearCustoms, 'Notice');
8081
await getPromise(isRotated, 'rotate', clearRotate, 'Reset rotation');
@@ -85,7 +86,8 @@ function GifButton(props) {
8586
});
8687

8788
onCloseGif = () => {
88-
refreshStateAfterGif(hasCustomPalettes ? paletteStore : undefined, rotation, nonDownloadableLayers);
89+
refreshStateAfterGif(hasCustomPalettes
90+
? paletteStore : undefined, rotation, nonDownloadableLayers);
8991
toggleGif();
9092
};
9193
toggleGif();

web/js/components/animation-widget/play-queue.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ const getInitialBufferSize = (numberOfFrames, speed) => {
3232
*
3333
* The buffering logic is as follows:
3434
* - n = 10 + speed (frames per sec)
35-
* - Make at least n requests (assuming there are >= n frames) to determine the avg fetch time for a frame
35+
* - Make at least n requests (assuming there are >= n frames) to determine
36+
* the avg fetch time for a frame
3637
* - While making initial requests, if any return too quickly (e.g. they were cached), keep making
37-
* requests until at least n "real" requests can be made to determine average fetch time
38+
* requests until at least n "real" requests can be made to determine average fetch time
3839
* - Based on how long it took to load the first n, calculate how many additional frames
39-
* need to be pre-loaded, based on avg fetch time and playback speed, in order for playback to begin
40-
* without having to stop to buffer.
41-
*
40+
* need to be pre-loaded, based on avg fetch time and playback speed,
41+
* in order for playback to begin without having to stop to buffer.
4242
*/
4343
class PlayQueue extends React.Component {
4444
constructor(props) {

web/js/components/charting/chart-component.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,8 @@ function ChartComponent (props) {
234234
const yAxisValuesArr = getYAxisValues(data);
235235

236236
/**
237-
* Extracts each key from the provided object & returns the list, removing 'name' from the collection
237+
* Extracts each key from the provided object &
238+
* returns the list,removing 'name' from the collection
238239
* @param {Object} chartData
239240
*/
240241
function getLineNames(obj) {
@@ -475,7 +476,10 @@ function ChartComponent (props) {
475476
</div>
476477
<div className="charting-disclaimer">
477478
<strong className="charting-disclaimer-pre">Note: </strong>
478-
<span>Numerical analyses performed on imagery should only be used for initial basic exploratory purposes.</span>
479+
<span>
480+
Numerical analyses performed on imagery should only
481+
be used for initial basic exploratory purposes.
482+
</span>
479483
{isTruncated
480484
&& (
481485
<div className="charting-disclaimer-upper">

web/js/components/charting/charting-date-selector.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ import {
1010

1111
function ChartingDateSelector (props) {
1212
const {
13-
onUpdateStartDate, onUpdateEndDate, timeSpanStartDate, timeSpanEndDate, timeSpanSelection, date, layerStartDate, layerEndDate,
13+
onUpdateStartDate, onUpdateEndDate,
14+
timeSpanStartDate, timeSpanEndDate,
15+
timeSpanSelection, date,
16+
layerStartDate, layerEndDate,
1417
} = props;
1518
const { selected, selectedB } = date;
1619
const startdate = timeSpanStartDate == null ? selected : timeSpanStartDate;

web/js/components/charting/charting-info.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function ChartingInfo(props) {
1515
<div className="charting-info-text">
1616
<p className="charting-info">
1717
The charting feature is available for beta testing and evaluation.&nbsp;
18-
<span class="charting-feedback" onClick={() => sendFeedback(feedbackIsInitiated, isMobile)}>Please send comments and feedback to us.</span>
18+
<span className="charting-feedback" onClick={() => sendFeedback(feedbackIsInitiated, isMobile)}>Please send comments and feedback to us.</span>
1919
</p>
2020
<p className="charting-info">The Charting Tool provides the option to create a line chart for a date range showing change over time, and statistics for a single date (median, mean, minimum, maximum, and standard deviation) for an area of interest.</p>
2121

web/js/components/charting/simple-statistics.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ function SimpleStatistics(props) {
7777
<strong>Note:</strong>
7878
<br />
7979
{' '}
80-
Numerical analyses performed on imagery should only be used for initial basic exploratory purposes.
80+
Numerical analyses performed on imagery should
81+
only be used for initial basic exploratory purposes.
8182
</div>
8283
</>
8384
);

web/js/components/context-menu/context-menu.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ function RightClickMenu(props) {
2323
const [toolTipToggleTime, setToolTipToggleTime] = useState(0);
2424
const [formattedCoordinates, setFormattedCoordinates] = useState();
2525
const {
26-
map, proj, unitOfMeasure, onToggleUnits, isCoordinateSearchActive, allMeasurements, measurementIsActive, isMobile,
26+
map, proj, unitOfMeasure, onToggleUnits, isCoordinateSearchActive,
27+
allMeasurements, measurementIsActive, isMobile,
2728
} = props;
2829
const { crs } = proj.selected;
2930
const measurementsInProj = !!(Object.keys(allMeasurements[crs]) || []).length;

0 commit comments

Comments
 (0)