I am working on a teams app. I have my tab in react and typescript. (if you are not aware of teams app, the tab can be considered as a individual react app)
I am initiating linting with help of es lint and prettier.
I am able to run my script and get the issues. In fact I have resolved all of them.
When I start debugging my teams application, I get this error:
`ERROR in [eslint] Cannot find module 'node:fs' Require stack:
- /Users/teams_app/tabs/node_modules/synckit/lib/index.cjs
- /Users/teams_app/tabs/node_modules/eslint-plugin-prettier/eslint-plugin-prettier.js
- /Users/teams_app/tabs/node_modules/@eslint/eslintrc/dist/eslintrc.cjs Occurred while linting /Users/teams_app/tabs/src/components/tabs/wish-tab/Wish.tsx:1 Rule: "prettier/prettier"`
Here's my eslintrc.json
{
"env": {
"browser": true,
"es2021": true,
"jest": true
},
"extends": [
"react-app",
"react-app/jest",
"airbnb",
"airbnb-typescript",
"plugin:import/typescript",
"plugin:prettier/recommended"
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"project": "./tsconfig.json"
},
"plugins": ["react", "@typescript-eslint", "prettier"],
"rules": {
//my rules here
}
}
Here's the list of dev dependencies
"devDependencies": {
"@types/node": "^20.4.2",
"@types/react": "^16.14.6",
"@types/react-dom": "^16.9.12",
"@types/react-router-dom": "^5.1.7",
"cross-env": "^7.0.3",
"env-cmd": "^10.1.0",
"eslint": "^8.45.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^17.1.0",
"eslint-import-resolver-typescript": "^2.7.1",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"typescript": "^4.1.2"
},
This is my folder structure folder structure image But on everyfile I get this error - seems like it is not taking the path correctly path error image
I tried downgrading "eslint-import-resolver-typescript" to "^2.7.1", and installing the latest node version. I am using 18.16.1 I upgraded the "@types/node" to "^20.4.2",
I am expecting it to run with out any error
"@types/node": "^12.0.0",doesn't match the version of Node you are using. It's ancient.