A search for doubly-charged Higgs bosons decaying to pairs of same-charge, isolated, high-pT electrons is presented. Same-charge electron pairs are selected in an inclusive way and the same-charge electron pair invariant mass spectrum is studied. The search uses the collision data sample corresponding to 13.9\,\mathrm{fb}^{-1} of integrated luminosity collected in 2015 and 2016 by the ATLAS detector at the LHC at the centre-of-mass energy of 13\,\mathrm{TeV}. A model independent search for new physics processes was performed and no clear evidence for an excess was observed. Therefore, the upper limits for the signal cross-sections were set at 95% confidence level. Consequently, the observed lower mass limits, assuming a branching ratio to electrons (), are 420\,\mathrm{GeV} for a doubly-charged Higgs boson coupling to right-handed leptons () and 570\,\mathrm{GeV} for a doubly-charged Higgs boson coupling to left-handed leptons (). The expected lower mass limits were 460\,\mathrm{GeV} for and 580\,\mathrm{GeV} for . Limits were also derived with the assumption that . In this case, the lower mass limits are 380\,\mathrm{GeV} for and 530\,\mathrm{GeV} for . The expected limits for this assumption were 400\,\mathrm{GeV} for and 530\,\mathrm{GeV} for .