CoderLim / FE-cheat-sheet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FE-cheat-sheet

安装 node-sass 报错(仅供参考)

第一步:保证依赖版本是匹配的
1. node 与 pnpm:https://pnpm.io/installation#compatibility
2. node 与 node-sass:https://www.npmjs.com/package/node-sass


第二步:python 版本
brew update
brew install pyenv
echo 'eval "$(pyenv init -)"' >> ~/.profile

# 安装 2.7
pyenv install 2.7.18
pyenv global system 2.7.18


# 移除
brew uninstall python@3.11
# 安装 3.10.1
# 设置 python 版本
pyenv 2.7.18 3.10.1

cocos creator 源码

  1. 消除
  2. 简版消消乐
  3. 炮弹抛射
  4. 2048
  5. 贪吃蛇简版
  6. 一堆效果

公众号:白玉无冰 / 菜鸟小栈

开发技巧

  1. cmd+\ 或 F8 可以立即断下来,方便查看 popover 的样式;

VSCode

插件

AutoCloseTag AutoCompleteTag AutoRenameTag CodeSpellChecker ESLint StyleLint GitGraph importCost Prettier - Code formatter Tailwind CSS IntelliSense TODO Highlight Vetur Vim ChatGPT

配置

// .vscode/extensions.json
{
  "recommendations": [
    "editorconfig.editorconfig",
    "dbaeumer.vscode-eslint",
    "jpoissonnier.vscode-styled-components",
    "drknoxy.eslint-disable-snippets",
    "wix.vscode-import-cost",
    "eg2.vscode-npm-script",
    "wayou.vscode-todo-highlight",
    "esbenp.prettier-vscode"
  ]
}

// .vscode/settings.json
{
  "typescript.tsdk": "node_modules/typescript/lib",
  "eslint.options": {
    "configFile": "./.eslintrc"
  },
  "eslint.probe": ["javascript", "javascriptreact", "typescript", "typescriptreact", "html", "vue", "markdown"],
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
    // "source.organizeImports": true
  },
  "editor.formatOnSave": true,
  "autoimport.useSemiColon": true,
  "[json]": {
    "editor.tabSize": 2,
    "editor.formatOnType": true,
    "editor.formatOnPaste": true,
    "editor.formatOnSave": true
  },
  "[jsonc]": {
    "editor.tabSize": 2,
    "editor.formatOnType": true,
    "editor.formatOnPaste": true,
    "editor.formatOnSave": true
  },
  "cSpell.words": ["aksks", "unavail"],
  "typescript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces": true
}
// .prettierrc
{
  "printWidth": 120,
  "tabWidth": 2,
  "trailingComma": "all",
  "jsxBracketSameLine": true,
  "semi": true,
  "singleQuote": true,
  "arrowParens": "avoid",
  "overrides": [
    {
      "files": "*.ts",
      "options": {
        "parser": "typescript"
      }
    }
  ]
}
// .stylelintrc.json
{
  "extends": "stylelint-config-recommended",
  "rules": {
    "no-descending-specificity": null,
    "declaration-colon-newline-after": null,
    "at-rule-no-unknown": null,
    "selector-pseudo-class-no-unknown": [
      true,
      {
        "ignorePseudoClasses": ["global"]
      }
    ]
  }
}

.eslintrc
{
  "root": true,
  "env": {
    "browser": true,
    "es6": true
  },
  "extends": ["eslint:recommended", "plugin:react/recommended", "plugin:@typescript-eslint/recommended"],
  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "ecmaFeatures": {
      "experimentalObjectRestSpread": true,
      "jsx": true
    },
    "sourceType": "module"
  },
  "plugins": ["@typescript-eslint", "react", "react-hooks"],
  "settings": {
    "react": {
      "version": "detect"
    }
  },
  "rules": {
    // "indent": ["error", 2, { "SwitchCase": 1 }],
    "quotes": ["error", "single"],
    "semi": ["error", "always"],
    "no-console": "error",
    "block-spacing": ["error", "always"],
    "no-trailing-spaces": "error",
    "object-curly-spacing": ["error", "always"],
    "no-empty": 0,
    "react/prop-types": [
      "warn",
      {
        "ignore": ["children"]
      }
    ],
    "@typescript-eslint/no-unused-vars": ["warn", { "vars": "local" }],
    "@typescript-eslint/ban-ts-ignore": 0,
    "@typescript-eslint/ban-ts-comment": 0,
    "@typescript-eslint/no-explicit-any": 0,
    "@typescript-eslint/camelcase": 0,
    "@typescript-eslint/no-empty-interface": 0,
    "@typescript-eslint/explicit-function-return-type": 0,
    "@typescript-eslint/no-non-null-assertion": 0,
    "@typescript-eslint/explicit-module-boundary-types": 0,
    "arrow-parens": [2, "as-needed"]
  }
}

HTML

  1. 一张图搞定各种属性:offsetTop、clientTop、scrollTop等

CSS

  1. BEM common problems

React

  1. react 揭秘
  2. Build your react
  3. Build your own x
  4. react-philosophies

性能优化

  1. 前端性能优化

面试题

  1. https://vue3js.cn/interview/

GIT

  1. 图解 GIT
  2. 这才是真正的Git——Git内部原理揭秘!

API

  1. 10-best-practices-for-writing-node-js-rest-apis

Design Pattern

  1. 工厂模式,依赖注入

Deploy

  1. docker化webapp

Security

  1. helmet.js
  2. Auth2.0 Auth2.0 RFC

前端面试

  1. 前端面试真题,会 80% 直接进大厂

Node

  1. node定时器详解
  2. nodejs-->timer
  3. 写一个脚手架

TDD

  1. https://blog.risingstack.com/getting-node-js-testing-and-tdd-right-node-js-at-scale/

Browser

  1. 浏览器多进程到JS单线程
  2. js编译器结构、Shape、IC、对象和数组是如何存储的
  3. Tasks, microtasks, queues and schedules

函数式编程

  1. 很不错的gitbook

Better

  1. https://www.coderhood.com/5-problem-solving-skills-great-software-developers/
  2. How to read es specification
  3. 组件库的思考
  4. Cam Jackson: 微前端

ML

  1. 入门必备
  2. 谷歌教程
  3. Tensorflow:识别手写数字

成品

  1. HooksAdmin react 管理后台
  2. Geeker vue 管理后台

赚钱

  1. 推特精华合订本@JourneymanChina

QA

  1. 为什么 inline-block 且 overflow:hidden 的元素的 baseline 在元素底部
  2. inlineblock 的 vertical-align

About