Skip to content

Instantly share code, notes, and snippets.

View yidingww's full-sized avatar
🥦

Wang Yiding yidingww

🥦
View GitHub Profile
@yidingww
yidingww / lint-formatter.js
Created February 8, 2023 08:52
ESLint formatter that groups errors by rule name and sort by number of occurrence in descending order
module.exports = results => {
const byRuleId = results.reduce((map, current) => {
current.messages.forEach(({ruleId, line, column}) => {
if (!map[ruleId]) {
map[ruleId] = [];
}
const occurrence = `${current.filePath}:${line}:${column}`;
map[ruleId].push(occurrence);
});
# Fig pre block. Keep at the top of this file.
[[ -f "$HOME/.fig/shell/zshrc.pre.zsh" ]] && builtin source "$HOME/.fig/shell/zshrc.pre.zsh"
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# If you come from bash you might have to change your $PATH.