Like a gathering storm darkening Ireland's green landscape, the crisis in neighboring British-ruled Northern Ireland has cast a shadow over the short campaign for the national election here Tuesday.

The deaths of Irish nationalist hunger strikers in Belfast have stirred traditional anti-British feelings here and raised fears that the violence in Northern Ireland might spill across the border and endanger this country's security and prosperity.

Protest demonstrations and rioting in the heart of Dublin after the deaths of four hunger strikers last month brought an unpleasant taste of the tension across the border. Youths battled police, smashed store windows and set cars on fire in Dublin, and a half dozen British-owned homes were burned in the countryside. Businesses were pressured to close during the hunger strikers' funerals.

Heckling demonstrators who carry black flags have harassed Irish Prime Minister Charles Haughey during the campaign because he refused to support the hunger strikers' demands that Irish nationalist terrorists be treated as prisoners of war rather than criminal convicts in British prisons in Northern Ireland. Haughey has been jostled, shouted down while speaking and hit by a thrown egg that splattered across his forehead.

Nine Irish nationalist terrorists imprisoned in Northern Ireland, including four who have replaced their dead comrades on hunger strike, have been put up as candidates for the Irish Parliament in Thursday's election, taking advantage of cross-border citizenship rights.

Because they are running against candidates from traditional Irish parties with strong local followings, they are given relatively little chance of repeating the success of hunger striker Bobby Sands. Four weeks before his death May 4, Sands won election to the British Parliament against a Protestant opponent in a mostly Catholic and Irish nationalist district near the Irish border in Ulster.

The prisoners' supporters and a number of other minor party and independent candidates in the Irish election are campaigning primarily for a demonstration of Irish voter support for the hunger strike.

The Irish economy is the major publicly debated issue in the campaign, with voters trying to decide which party is better able to reduce unemployment, inflation and the government's large foreign debt while continuing Ireland's rapid postwar industrialization.

But an important, if largely unspoken and unpredictable, concern of Irish voters, according to opinion polls and interviews here, is what opposition leader Garrett Fitzgerald described in a campaign speech last night as the "growing sense of fear and insecurity" as "we realize the troubles of the north have spread beyond the border."

"People were frightened by the intimidation of businesses here and the hooliganism in Dublin after the hunger strike deaths," said Dr. Conald Brennan, a parliamentary candidate in suburban Dublin for Fitzgerald's Fine Gael party. "It scared the daylights out of them."

This and the hunger strike deaths, he and others said, have pierced an insularity from the problems north of the border that had been prevalent here in recent years. Now, growing concern for the Catholic Irish nationalist minority in Northern Ireland appears to conflict with fears of trouble engulfing the entire island.

"We want unification of Ireland," said an Irish official who works almost exclusively on this problem. "But we are fearful of anything precipitate that would cause economic problems or violence here."

There was no way to predict, he added, what impact all this would have on the election because "while people are thinking about it, they don't want to talk about it."

"Northern Ireland is always present in the Irish political consciousness," Prime Minister Haughey said at a press conference last week. "Because of the recent bloodshed and deaths there, interest is now more intense."

Opinion polls indicate that Irish voters will be judging Haughey and Fitzgerald first on how they would deal with the economy and then on security and Northern Ireland.

Fitzgerald, an economist, and his party, Fine Gael, which has offered a detailed plan for stimulating growth with income tax cuts and other measures, has taken the lead in opinion polls on economic issues. But Haughey and his party, Fianna Fail which has ruled Ireland for all but 10 years since 1932 are trusted more on Northern Ireland and security, according to the polls.

Before the hunger strike, Haughey was expected to overcome his vulnerability on the economy by "playing the green card" of Irish nationalism. After he replaced retiring Fianna Fail leader Jack Lynch as prime minister 18 months ago, Haughey made the pursuit of Irish unification through political negotiation "the first priority" of his government.

He was able to claim a breakthrough when he and British Prime Minister Margaret Thatcher agreed at a summit meeting here in December to begain a dialogue between their governments and improve the "totality of relationships within these islands" through closer cooperation on economic, energy, security, citizenship and other matters.

Contrary to what British official have said, Haughey broadly hinted that these talks, now being pursued privately, could lead quickly to a new relationship among Britain, Northern Ireland and Ireland that would solve the problem of Northern Ireland. He was expected to campaign for reelection larged on this accomplishment.

But relations between London and Dublin have since been strained. Thatcher and British official were displeased that Haughey had, in their view, alarmed Ulster Protestants by overselling the British-Irish dialogue for political reasons.Haughey and Irish officials have been unhappy with what they see as Thatcher's insensitivity to Irish feelings in her unyielding position on the hunger strike.

Irish officials said they believe Thatcher could have been more flexible on modification of prison conditions for all inmates in Northern Ireland without giving convicted terrorists any special status. Despite pressure from militant Irish nationalists in both Ireland and Ulster to confront Thatcher publicly on the issue, Haughey has instead urged intervention by the European Commission on Human Rights.

Haughey has not asked Thatcher directly to be more flexible on the hunger strikers' demands, Irish officials said, because Haughey knew she would refuse, which would embarrass him politically. This has left Haughey open to criticism that his new "relationship with Thatcher does not mean so much after all.

Haughey said during the campaign that the British-Irish talks would continue and that he still saw them as "the first steps in a process which will help the two governments to see in a clearer light the possibility of a solution based on new poltical arrangements acceptable to all traditions."

"The violent and unstable situation in Northern Ireland with its implications for peace and security in our jurisdiction," Haughey told voters, made it all the more important that he be reelected with a mandate to continue work on the problem.

Fitzgerald, a former foreign minister with experience in negotiations on Northern Ireland, said in an inteview he also believes the British-Irish talks "are promising as a first step" because "any solution to the problem of Northern Ireland must involve a new relationship between Ireland and Britain." He promised Irish voters to continue the dialogue if he becomes prime minister.

But Fitzgerald said "the secrecy surrounding the talks is damaging" and he would keep Northern Ireland's Protestants informed so they would be less apprehensive. He emphasized Irish government policy that a peaceful solution to the Northern Ireland problem required the consent of everyone involved, including a majority of Ulster's Protestants.

In his campaign speech on Northern Ireland last night, Fitzgerald charged that by agreeing with Thatcher to keep the talks secret and then saying to Irish voters that "we will be able to see they way forward to Irish unity more clearly without any indication of how this is to be achieved," Haughey had both encouraged terrorists "to pursue their evil campaigns" and "provoked" Ulster Protestants "to further intransigence."

Fitzgerald also promised that if elected he would immediately tell Thatcher that her attitude toward the hunger strike and the predicament of moderate Catholic nationalists in Ulster "risks alienating an entire community in Northern Ireland."

Both Hughey and Fitzgerald are committed, according to Irish officials, to maintaining Ireland's increased and expensive antiterrorist security measures in cooperation with Britain along the Irish-Ulster border.