Indlela ukuvimbela 'Okungalindelekile console isitatimende.’ (kungekho-console) e Eslint?

Ukuze ukhubaze 'Okungalindelekile console isitatimende.’ (kungekho-console) iphutha Eslint, udinga ukwengeza umthetho efayeleni .eslintrc.json.

Kwizimiso kwesigaba wefayela .eslintrc.json ukungeza ulayini olandelayo:

"kungekho-console":0

Lokhu kuzovimbela iphutha.

Beningakwenza esikhundleni:

"kungekho-console": "ukuvala"

Lokhu kuzokwenzeka into efanayo, which is turn off any errors when using the Console object in your JavaScript code.

Ngezansi kukhona ongakhetha umnyuziki okwasesikhathini akukho-console futhi abakwenzayo:

“ukuvala” noma 0 – vula zokubusa

“ukuxwayisa” noma 1 – vula isimiso kuyisixwayiso (akuphazamisi ophumayo ikhodi)

“Iphutha” noma 2 – vula isimiso njengoba nephutha (ikhodi ephumayo 1 uma abangelwe)

Okulandelayo ifayela isampula .eslintrc.json yona futhi sikubonise ukuthi umthetho kungekho-console kuhambisana.

{

  "env":{

    "isiphequluli":kweqiniso,

    "commonjs":kweqiniso,

    "es6":kweqiniso,

    "node":kweqiniso

  },

  "kwelula":"eslint:Kunconywa",

  "parserOptions":{

  "sourceType":"module"

},

  "imithetho":{

    "indenti":[

      "Iphutha",

      4

    ],

    "LINEBREAK-isitayela":[

      "Iphutha",

      "amafasitela"

    ],

    "izingcaphuno":[

      "Iphutha",

      "olulodwa"

    ],

    "semi":[

      "Iphutha",

      "njalo"

    ],

    "kungekho-console":0

  }

}

Shiya impendulo