![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
eslint-config-blend-react
Advanced tools
blend-react 开发及其模板项目使用的 ESLint 配置规则。
eslint
和 eslint-config-blend-react
为开发依赖包// NPM
> npm i eslint eslint-config-blend-react --save-dev
// Yarn
> yarn add eslint eslint-config-blend-react --dev
.eslintrc.js
),将 blend-react
添加至 extends
选项中module.exports = {
// ...
root: true,
extends: ['blend-react'],
// ...
};
使用下述方案,可强化开发体验:
git commit
之前,自动对部分语法和编写习惯进行修复需要使用 VS Code (Visual Studio Code) ,以下是完整的配置方案:
prettier
prettier-eslint
husky
以及 lint-staged
为开发依赖包// NPM
> npm i prettier prettier-eslint husky lint-staged --save-dev
// Yarn
> yarn add prettier prettier-eslint husky lint-staged --dev
.vscode
的目录,并在该文件夹内创建名为 settings.json
的文件,其内容为:{
"editor.rulers": [80, 120],
"editor.formatOnSave": true,
"editor.tabSize": 4,
"editor.insertSpaces": true,
"editor.codeActionsOnSave": {
"source.fixAll": true
},
"eslint.codeActionsOnSave.mode": "problems",
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
"javascript.implicitProjectConfig.experimentalDecorators": true,
"javascript.validate.enable": false,
"typescript.validate.enable": true,
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
.prettierrc.js
的文件,其内容为:下载 prettier 配置
// NPM
> npm i blend-prettier-config --save-dev
// Yarn
> yarn add blend-prettier-config --dev
module.exports = {
...require('blend-prettier-config'),
};
package.json
,添加以下内容 "husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{js,jsx,cjs,mjs,ts,tsx}": [
"eslint --fix",
"prettier --write"
],
"*.{json,md,css,less,sass,scss}": [
"prettier --write"
]
}
FAQs
针对react项目的规范
The npm package eslint-config-blend-react receives a total of 4 weekly downloads. As such, eslint-config-blend-react popularity was classified as not popular.
We found that eslint-config-blend-react 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.