I m在我的项目中拥有ESLint,并出现错误 决定 编号: 无效接口的类型,装上决心器: 进口-无限制-第
, 添加以下规则:<代码> 进口/无限制-第
{
"include": [
"./src/**/*",
"./generated/**/*"
],
"compilerOptions": {
"resolveJsonModule": true,
"target": "es5",
"module": "esnext",
"moduleResolution": "node",
"lib": [
"dom",
"es6"
],
"downlevelIteration": true,
"jsx": "react",
"declaration": false,
"sourceMap": true,
"baseUrl": "src",
"outDir": "./dist/js",
"paths": {
"@generated/*": ["../generated/*"],
"api": ["lib/api"],
"api/*": ["lib/api/*"],
"asset/*": ["lib/asset/*"],
"base/*": ["lib/base/*"]
},
// Rules
"noImplicitAny": false,
"strictNullChecks": true,
"noImplicitThis": true,
"alwaysStrict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true,
"isolatedModules": true
}
}
module.exports = {
env: {
browser: true
},
settings: {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
"typescript": {
paths: "./tsconfig.json",
alwaysTryTypes: true
}
},
},
parser: "@typescript-eslint/parser",
parserOptions: {
tsconfigRootDir: ".",
sourceType: "module",
project: "./tsconfig.json"
},
extends: [
"plugin:import/recommended",
"plugin:import/typescript"
],
plugins: [
"@typescript-eslint",
"import"
],
overrides: [
{
files: [
"src/_migration/**"
],
rules: {
"import/no-restricted-paths": [
"error",
{
basePath: "./src",
zones: [
{ target: "./_migration", from: "./", except: [ ./_migration ] }
],
},
]
}
},
],
rules: {
"import/no-unresolved": "off",
"@typescript-eslint/typedef": [
"error",
{
parameter: true
}
]
}
};