我將 charting_library 用于 react/typescript 專案。由于 linting,我收到了這些編譯錯誤,CL 建議忽略這些 linting 問題。

這是我的 tsconfig.json 檔案
{
"compilerOptions": {
"baseUrl": "src",
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"downlevelIteration": true,
"allowJs": false,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"types":[
"node",
"webpack-env" // here
]
},
"include": [
"src",
"**/*.ts",
"**/*.tsx",
"types/*.d.ts",
"**/*.d.ts"
]
}
我添加了一個名為 tsconfig.eslint.json 的單獨檔案,并嘗試像這樣放置檔案夾路徑
{
"extends": "./tsconfig.json",
"exclude": ["./src/pages/instuments/technicalAnalysis/charting_library/*js"]
}
但這并不排除該檔案夾。如何從 linting 中排除 charting_libray 檔案夾?
uj5u.com熱心網友回復:
我不確定那個tsconfig.eslint.json檔案。
由于您想eslint忽略該檔案夾,因此您應該.eslintignore在專案的根目錄中創建一個。
在.eslintignore檔案中,添加/附加這一行:
src/pages/instuments/technicalAnalysis/charting_library/**/*.js
該**/*.js部分匹配該.js檔案charting_library夾中的所有檔案和子檔案夾。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/406591.html
標籤:
