Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. 1. install
  2. yarn add -D @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint eslint-config-airbnb eslint-config-prettier eslint-config-react eslint-plugin-prettier eslint-plugin-react
  3.  
  4. 2. .vscode/setting.json
  5. {
  6. "eslint.autoFixOnSave": true,
  7. "eslint.validate": [
  8. "javascript",
  9. "javascriptreact",
  10. { "language": "typescript", "autoFix": true },
  11. { "language": "typescriptreact", "autoFix": true }
  12. ],
  13. "editor.formatOnSave": true,
  14. "[javascript]": {
  15. "editor.formatOnSave": false
  16. },
  17. "[javascriptreact]": {
  18. "editor.formatOnSave": false
  19. },
  20. "[typescript]": {
  21. "editor.formatOnSave": false
  22. },
  23. "[typescriptreact]": {
  24. "editor.formatOnSave": false
  25. }
  26. }
  27.  
  28. 3. .prettierrc
  29. {
  30. "singleQuote": true,
  31. "semi": false,
  32. "printWidth": 100,
  33. "endOfLine": "auto",
  34. "trailingComma": "es5"
  35. }
  36.  
  37. 4. .eslintrc
  38. {
  39. "parser": "@typescript-eslint/parser",
  40. "extends": [
  41. "eslint:recommended",
  42. "plugin:react/recommended",
  43. "plugin:@typescript-eslint/recommended",
  44. "prettier/@typescript-eslint",
  45. "plugin:prettier/recommended"
  46. ],
  47. "plugins": ["react", "@typescript-eslint", "prettier"],
  48. "env": {
  49. "browser": true,
  50. "jasmine": true,
  51. "jest": true
  52. },
  53. "rules": {
  54. "prettier/prettier": ["error", { "singleQuote": true }]
  55. },
  56. "settings": {
  57. "react": {
  58. "pragma": "React",
  59. "version": "detect"
  60. }
  61. }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement