Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
eslint-config-amity
Advanced tools
ESLint config for Amity orgnization.
yarn add --dev eslint-config-amity eslint prettier
# npm i --dev eslint-config-amity eslint prettier
// .eslintrc.js
// for javascript project
{
"extends": "amity"
}
// for typescript project
{
"extends": "amity/typescript"
}
// for react project
{
"extends": "amity/react"
}
.prettierrc
file at the root of your project{
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"trailingComma": "all",
"quoteProps": "as-needed",
"semi": true,
"bracketSpacing": true,
"arrowParens": "avoid",
"printWidth": 120
}
.vscode/settings.json
file at the root of your project// See VS Code settings in https: //code.visualstudio.com/docs/getstarted/settings#_default-settings
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"search.exclude": {
"**/node_modules": true,
"**/dist": true
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.formatOnPaste": true
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.formatOnPaste": true
},
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.format.semicolons": "remove"
}
scripts
"scripts": {
"lint": "eslint . --ext .js,.ts",
"lint:fix": "eslint . --ext .js,.ts --fix",
"prettier": "prettier --write '{src,test}/**/*.{ts,json,md}'"
}
yarn add --dev husky lint-staged
# npm i --dev husky lint-staged
In package.json:
"husky": {
"hooks": {
"post-commit": "git update-index --again",
"pre-commit": "lint-staged",
"pre-push": "yarn test",
"commit-msg": "commitlint -c .commitlintrc.json -E HUSKY_GIT_PARAMS"
}
},
"lint-staged": {
"*.{ts,js,jsx}": [
"yarn prettier",
"yarn lint"
],
"*.{json,md}": [
"yarn prettier"
]
}
commitlint
yarn add --dev @commitlint/cli @commitlint/config-angular
# npm i --dev @commitlint/cli @commitlint/config-angular
add .commitlintrc.json
at the root:
{
"extends": ["@commitlint/config-angular"],
"rules": {
"subject-case": [2, "always", ["sentence-case", "start-case", "pascal-case", "upper-case", "lower-case"]],
"type-enum": [2, "always", ["build", "chore", "ci", "docs", "feat", "fix", "perf", "refactor", "revert", "style", "test", "sample"]]
}
}
In package.json:
"husky": {
"hooks": {
...
"commit-msg": "commitlint -c .commitlintrc.json -E HUSKY_GIT_PARAMS"
}
}
FAQs
Eslint configuration for Amity
We found that eslint-config-amity demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.