// package.json "devDependencies": { "@typescript-eslint/eslint-plugin": "^5.11.0", "@typescript-eslint/parser": "^5.11.0", "eslint": "^8.8.0", "eslint-config-airbnb": "^19.0.4", "eslint-config-prettier": "^8.3.0", "eslint-plugin-import": "^2.25.4", "eslint-plugin-jest-dom": "^4.0.1", "eslint-plugin-jsx-a11y": "^6.5.1", "eslint-plugin-prettier": "^4.0.0", "eslint-plugin-react": "^7.28.0", "eslint-plugin-react-hooks": "^4.3.0", "eslint-plugin-simple-import-sort": "^7.0.0", "eslint-plugin-testing-library": "^5.0.5", "prettier": "^2.5.1" } // .eslintrc.json { "env": { "browser": true, "es2021": true, "jest": true }, "extends": [ "airbnb", "plugin:react/recommended", "plugin:@typescript-eslint/recommended", "plugin:testing-library/react", "plugin:jest-dom/recommended", "plugin:prettier/recommended" ], "parser": "@typescript-eslint/parser", "parserOptions": { "ecmaFeatures": { "jsx": true }, "ecmaVersion": "latest", "sourceType": "module", "project": "tsconfig.json" }, "settings": { "import/resolver": { "node": { "extensions": [".js", ".jsx", ".ts", ".tsx"], "paths": ["src"] } } }, "plugins": [ "react", "@typescript-eslint", "testing-library", "jest-dom", "simple-import-sort", "prettier" ], "rules": { "react/jsx-filename-extension": [1, { "extensions": [".tsx", ".jsx"] }], "testing-library/await-async-query": "error", "testing-library/no-await-sync-query": "error", "testing-library/prefer-user-event": "error", "testing-library/no-debugging-utils": "warn", "react/react-in-jsx-scope": "off", "import/extensions": ["error", "never"], "simple-import-sort/imports": "error", "simple-import-sort/exports": "error", "sort-imports": "off", "import/order": "off", "no-console": "warn", "@typescript-eslint/prefer-optional-chain": "warn", "@typescript-eslint/prefer-nullish-coalescing": "warn", "@typescript-eslint/no-for-in-array": "warn", "@typescript-eslint/prefer-for-of": "warn", "@typescript-eslint/no-floating-promises": "warn", "@typescript-eslint/promise-function-async": "warn", "@typescript-eslint/sort-type-union-intersection-members": "warn", "@typescript-eslint/no-unnecessary-boolean-literal-compare": "warn", "@typescript-eslint/no-confusing-non-null-assertion": "warn", "@typescript-eslint/no-non-null-asserted-nullish-coalescing": "warn", "@typescript-eslint/consistent-indexed-object-style": [ "warn", "index-signature" ] } } // .vscode/settings.json { "editor.codeActionsOnSave": { "source.fixAll.eslint": true } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter