Skip to content

Instantly share code, notes, and snippets.

@curly210102
Last active December 21, 2024 03:15
Show Gist options
  • Select an option

  • Save curly210102/5b68c8f958b5e1bc428514681b528dec to your computer and use it in GitHub Desktop.

Select an option

Save curly210102/5b68c8f958b5e1bc428514681b528dec to your computer and use it in GitHub Desktop.
code-canonicalization
# https://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
insert_final_newline = false
trim_trailing_whitespace = false
module.exports = {
extends: ["plugin:prettier/recommended"],
env: {
browser: true,
es2021: true,
node: true,
},
parserOptions: {
ecmaVersion: 12,
sourceType: "module",
}
};
module.exports = {
semi: true,
singleQuote: false,
printWidth: 80,
};
{
"scripts": {
"prepare": "husky install"
},
"devDependencies": {
"eslint": "^7.24.0",
"eslint-config-prettier": "^8.2.0",
"eslint-plugin-prettier": "^3.4.0",
"husky": "^6.0.0",
"lint-staged": ">=10",
"prettier": "^2.2.1",
},
"lint-staged": {
"*.@(js|jsx)": "eslint . --ext .js,.jsx",
"*.{css,scss,json,yml,md}": "prettier --write"
}
}
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
yarn lint-staged
// .vscode/settings.json
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment