
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
eslint-config-automatic
Advanced tools
这是个人的ESLint规则配置,包括多个常用集合,对于每一条规则,提供简要注释和规则说明网址,没有使用其他的extends
。
在rules
目录下,有一些规则库,可以作为单独的配置信息,放入ESLint配置文件中的extends
里面。
例如,如果想引用React Native
的规则,则在extends
中添加如下代码:
"extends": [
"@smartshallot/rules/react-native",
]
其余依次类推,目前支持的配置如下所示:
base
:包含现有的每一条规则,按照分类组织文件结构。具体规则列表请参照ESLint官方网站:规则文档。react
react-native
:使用了插件eslint-plugin-react-native。typescript
如果只引用规则,那ESLint配置文件剩余的部分都需要自行完成,也可以使用install
目录下相应的安装脚本来进行设置。
依旧以react-native
为例,在.eslintrc.js
中,设置如下:
const config = {
// ...
"extends": [
// ...
"@smartshallot/rules/react-native",
],
// ...
}
require('@smartshallot/install/react-native')(config);
module.exports = config;
注意:install
中的脚本,只设置一个配置插件的设置项,如果要引用多个配置信息,则需要依次对config
进行设置,可参照module
目录中的文件写法。
除了上述的只引用规则信息之外,还可以使用已经集成好的脚本,来生成相应的ESLint配置文件。
以TypeScript语言的react-native
项目为例,对应于module
目录下的typescript-react-native.js
文件,需要在.eslintrc.js
中,设置如下:
const config = require('@smartshallot/module/typescript-react-native');
// 这里添加想修改的设置,也可以不添加
module.exports = config;
目前支持的集成设置类型如下:
javascript
:只使用JavaScript开发的项目,没有React相关代码。javascript-react
:使用JavaScript开发的React项目。javascript-react-native
:使用JavaScript开发的React Native项目。typescript
:只使用TypeScript开发的项目,没有React相关代码。typescript-react
:使用TypeScript开发的React项目。typescript-react-native
:使用TypeScript开发的React Native项目。FAQs
An ESLint Configuration Set.
The npm package eslint-config-automatic receives a total of 1 weekly downloads. As such, eslint-config-automatic popularity was classified as not popular.
We found that eslint-config-automatic 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.