我正在尝试创建Notes.ts文件来做打字笔记。我需要语法高亮,但没有eslint。我如何停止eslint来停止对我的笔记文件的工作。
MyDir结构
root/.eslintignore
root/NestJS.ts
root/package.jsonNestJS.ts内容
/* eslint-disable */
import { Controller, Get } from '@nestjs/common';
@Controller('/app')
export class AppController {
@Get('/asdf')
getRootRoute() {
return 'hi there!';
}
@Get('/bye')
getByeThere() {
return 'bye there!';
}
}.eslintignore内容
**/*.js
**/*.ts
NestJs.tspackage.json内容
{
"name": "notes",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"eslintConfig": {
"env": {
"browser": true,
"node": true
}
},
"eslintIgnore": [
"NestJS.ts",
"world.js"
]
}即使在添加/* eslint-disable */之后,eslint仍然显示错误!
发布于 2021-09-21 17:57:45
您可以在根目录中创建文件.eslintignore。此文件的格式与.gitignore的格式相匹配,您不仅可以添加文件,还可以添加目录。
https://stackoverflow.com/questions/69273439
复制相似问题