我試圖創建Notes.ts檔案,用于制作typecript的注釋。我需要語法高亮,但沒有eslint。我怎樣才能讓eslint停止對我的筆記檔案作業呢?
MyDir結構
root/.eslintignore。
root/NestJS.ts。
root/package.json。
NestJS.ts內容
/* eslint-disable */>
import { Controller, Get } from '@nestjs/common'/span>。
@Controller('/app')
export class AppController {
@Get('/asdf'/span>)
getRootRoute() {
return 'hi there!'。
}
@Get('/bye')
getByeThere() {
return 'bye there!';
}
.eslintignore content
**/*.js
**/*.ts。
NestJs.ts。
package.json內容
{
"name": "notes",
"版本": "1.0.0"。
"描述": "",
"main": "index.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1" 。
},
"keywords": [],
"author": "",
"許可證": "ISC"。
"eslintConfig": {
"env": {
"browser": true,
"node": true, "node".
}
},
"eslintIgnore": [
"NestJS.ts",
"world.js".
]
}
即使添加了/* eslint-disable */,eslint也向我顯示了錯誤!!
uj5u.com熱心網友回復:
你可以在根目錄中創建一個.eslintignore檔案。這個檔案的格式與.gitignore的格式一致,你不僅可以在那里添加檔案,也可以添加目錄。
uj5u.com熱心網友回復:
將檔案放在.eslintignore或package.json的"eslintIgnore"
編輯。 如果不作業,請說明你是如何指定檔案的路徑的
。轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/332478.html
標籤:
