CLEVELAND -- The 2017-2018 season has been a struggle for Cleveland Cavaliers shooting guard J.R. Smith, especially as it pertains to having consistent offensive production, which is something he and the team grew accustomed to getting out of the veteran over his first three years with the organization.

And yet, Cavaliers coach Tyronn Lue has remained loyal to Smith, continuing to start the veteran sharpshooter as the team heads into the final quarter of the regular season.

“The whole season, J.R.’s done a lot for us, and if it wasn’t for J.R. in ’16 making those eight straight points coming out in the third quarter, we don’t win a championship, so for people to sit here and quit on J.R. or give up on J.R., it’s not right,” Lue said after Monday’s practice.

As of late, Smith has paid back Lue for that faith.

Since the calendar flipped to February, Smith has started to find his rhythm again, as he has scored in double figures in four of the last five games, including 15 in Sunday’s 121-99 win over the Boston Celtics at TD Garden.

“He gave us effort and energy every night,” Lue said. “Sometimes, the shots come and go. That’s just part of the game, but for the most part, his effort was there every night, so that’s why I wanted to stick with J.R.

“I didn’t want to lose J.R. I want to make sure we keep him in good spirit, keep him going in the right direction, and he’s big for us. When he’s making shots and he’s being aggressive, our team’s a whole different team.”

Cleveland Cavaliers guard J.R. Smith (5) shoots the ball during the third quarter against the Houston Rockets at Toyota Center.

Smith was the subject of rumors and reports throughout the build-up to last Thursday’s NBA trade deadline, and despite the Cavaliers making three deals in the final hours that saw six players and a first-round pick in the 2018 NBA Draft in return for four athletes and a future selection, the veteran shooter remains with the team.

Since the deadline passed Thursday, Smith has averaged 11 points, four rebounds, 1.5 assists, one blocked shot and one steal over 29 minutes of play in a pair of lopsided wins for the Cavaliers at the Atlanta Hawks and Celtics.

“J.R., he’s been good for us, just with the effort and intensity every night,” Lue said. “Like I said, he passed up on a lot of shots early in the season, but now, he’s taking them. When he’s making shots, we’re a totally different team.

“Over the years, we never like really featured him, but he got all of his shots out of transition, LeBron and Kyrie (Irving) attacking and kicking out, or they double-team him. When they double-teamed, Kevin (Love) would make the swing-swing-swing. It’s not like we ran a lot of stuff for J.R. He got his shots through the course of the offense, us playing in transition, playing fast.”

Cleveland Cavaliers guard J.R. Smith (5) celebrates his three-point basket in the fourth quarter against the Utah Jazz at Quicken Loans Arena.

Although Smith is in his 14th NBA season, he still has plenty of energy left to help lead the team.

Early against the Celtics, Smith showed that spry nature when he swept the ball through a strip attempt, dribbled into the lane past former teammate Kyrie Irving and threw down a monstrous one-handed dunk in traffic that set a tone for remainder of the game.

“He’s a two-foot jumper, and when he went off one foot and dunked it, I think that really set the tone for us early,” Lue said. “By him driving and dunking, you saw the bench go crazy and everyone was up cheering and excited. That really set a tone for us early.

“You don’t see it very often, but he’s athletic. He’s always been athletic.”