Я настроил мою конфигурацию eslint для использования абсолютного пути. Я использовал это руководство https://dev.to/oliverandrich/absolute-imports-with-create-react-app-and-vscode-ihn. Все работает нормально, но eslint показывает ошибку «Абсолютный импорт должен предшествовать относительному import.eslint (import / first)». Я пытался гуглить, но безуспешно. Любой совет?
вот мой конфиг eslint:
{
"parser": "babel-eslint",
"parserOptions": {
"sourceType": "module",
"allowImportExportEverywhere": true
},
"extends": ["airbnb","react-app", "plugin:import/errors", "plugin:import/warnings"],
"settings": {
"import/resolver": {
"node": {
"moduleDirectory": ["node_modules", "src/"]
}
}
},
"env": {
"jest/globals": true,
"browser": true,
"node": true
},
"rules": {
"arrow-parens": [
"off"
],
"compat/compat": "error",
"consistent-return": "off",
"comma-dangle": "off",
"flowtype-errors/show-errors": "error",
"generator-star-spacing": "off",
"import/no-unresolved": "error",
"import/no-extraneous-dependencies": "off",
"no-console": "off",
"no-use-before-define": "off",
"no-multi-assign": "off",
"no-underscore-dangle": "off",
"promise/param-names": "error",
"react/no-array-index-key": "off",
"promise/catch-or-return": "error",
"promise/no-native": "off",
"react/sort-comp": [
"error",
{
"order": [
"type-annotations",
"static-methods",
"lifecycle",
"everything-else",
"render"
]
}
],
"react/jsx-no-bind": "off",
"react/jsx-filename-extension": [
"error",
{
"extensions": [
".js",
".jsx"
]
}
],
"react/prefer-stateless-function": "off",
"react/forbid-prop-types": [
"error",
{
"forbid": []
}
],
"no-useless-escape": "off",
"no-confusing-arrow": "off",
"no-plusplus": "off",
"jest/no-disabled-tests": "warn",
"jest/no-focused-tests": "error",
"jest/no-identical-title": "error",
"jest/valid-expect": "error"
},
"plugins": [
"flowtype",
"flowtype-errors",
"import",
"promise",
"compat",
"react",
"jest"
]
}