Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
eslint-config-futu
Advanced tools
富途所有项目共享的ESLint规则,与[JavaScript编码规范](http://gitlab.futunn.com/web/webwiki/wikis/style-guidelines-javascript)对应。
富途所有项目共享的ESLint规则,与JavaScript编码规范对应。
1 安装依赖:
npm install eslint eslint-config-futu --save-dev
2 在项目web根目录上层新建.eslintrc.js文件
module.exports = {
root: true,
extends: 'eslint-config-futu',
env: {
},
parserOptions: {
},
rules:{
// 如果项目有特殊需求,可在此覆盖
}
};
npm install eslint typescript eslint-config-futu --save-dev
module.exports = {
root: true,
extends: 'eslint-config-futu/typescript', // 这里要使用'eslint-config-futu/typescript'配置
env: {
browser: true,
node: true,
amd: true
},
parserOptions: {
ecmaVersion: 7,
sourceType: 'module',
// recommend to use another config file like tsconfig.eslint.json and extends tsconfig.json in it.
// because you may be need to lint test/**/*.test.ts but no need to emit to js.
// @see https://github.com/typescript-eslint/typescript-eslint/issues/890
project: './tsconfig.json'
},
rules:{
// 如果项目有特殊需求,可在此覆盖
}
}
arrow-parens
规则为always
,如果项目有使用prettier,需要同样设置该选项为always
(prettier 2.0默认为always
)。不要全局安装ESLint工具,不要全局安装ESLint工具,不要全局安装ESLint工具。
设置(Preference) - 语言框架(Languages & Frameworks) - JavaScript - 质量工具(Code Quality Tools) - ESLint
勾上 启用(Enable),Node interpreter写 Node 的路径,一般会自动检测到,如果检测不到需要自己选一下。
ESLint package选择项目中的node_modules/eslint
,注意是项目中的,不能是全局的。剩下配置保留现状即可。
如果没有安装Package Control的可以先安装一下,说明见这里。https://packagecontrol.io/installation
然后安装SublimeLinter和SublimeLinter-contrib-eslint即可。
如果使用Package Control拉不出插件列表,可以设置一下Channel:打开命令输入框,找到Package Control: Add Channel,输入 https://git.oschina.net/mugood/PackageControl/raw/master/channel_v3.json 即可。
安装ESLint插件,启用即可。
因为在项目中会通过npm在项目中安装eslint-config-futu
,然后基于这个公共规则配置文件来使用ESLint。
然而ESLint有一个“Bug”,全局ESLint无法找到项目中的eslint-config-futu
,所以无法应用公共规则配置文件。
所以只能使用项目中安装的eslint
依赖。按上方编辑器的配置说明,编辑器均会使用项目中的eslint
依赖。
如果不在编辑器中使用,想在命令行使用,可以有两种方法:
./node_modules/.bin/eslint
,或者将这个命令写入npm scripts
。在npm scripts
中可以直接写eslint
,会默认从./node_modules/.bin
下查找eslint
命令。eslint-cli
这个第三方库,然后使用eslint
命令。arrow-parens
规则改为always
(与prettier
保持一致 & 预留向 TS 兼容)no-magic-numbers
规则no-use-before-define
规则,只做变量的检查,函数与类不做检查FAQs
富途所有项目共享的ESLint规则,与[JavaScript编码规范](http://gitlab.futunn.com/web/webwiki/wikis/style-guidelines-javascript)对应。
The npm package eslint-config-futu receives a total of 1 weekly downloads. As such, eslint-config-futu popularity was classified as not popular.
We found that eslint-config-futu demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
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.