@cloudbeds/eslint-config

中文文档
2.12.7发布于 2025/11/19UNLICENSEDCommonJS近 30 天下载 1831

ESLint configuration for Cloudbeds apps

此软件包已被标记为弃用

This package has been moved to GitHub Packages. Install from https://github.com/cloudbeds/eslint-config/pkgs/npm/eslint-config

原始使用文档
文档目录5 节
  1. Installation
  2. Getting started
  3. Special Cases
  4. Typescript
  5. Eslint-plugin-import

@cloudbeds/eslint-config

This package provides a shared extensible ESLint config for Cloudbeds apps. There are Javascript, Typescript, React, VueJs, Jest, and JSON configs.

Shareable configs are designed to work with the extends feature of .eslintrc files.

Airbnb JavaScript style guide is used as the basis for our ESLint configuration with some additions/changes. See JavaScript Style Guide Confluence page.

This package is shared as a public NPM module under the @Cloudbeds NPM organization.

Installation

Install ESLint and all dependencies:

npm install @cloudbeds/eslint-config --save-dev

Getting started

Add the following to your package.json

{
  "scripts": {
    "lint": "eslint src/**/*.{js,vue,ts}",
    "lint:show-unused-directives": "npm run lint -- --report-unused-disable-directives",
  },
  "eslintConfig": {
    "extends": "@cloudbeds/eslint-config"
  }
}

Special Cases

Typescript

By default path to tsconfig is ./tsconfig.json. If you have different path to tsconfig file. You can specify path and rules in your .eslintrc.js:

module.exports = {
  extends: '@cloudbeds/eslint-config',
  overrides: [
    {
      files: ['*.ts', '**/*.ts'],
      parserOptions: {
        project: 'path_to_tsconfig.js',
      },
      rules: {
        'some_rule': ['off', options]
      },
    },
  ],
};

Eslint-plugin-import

If you have a webpack config please specify it in your .eslintrc.js:

{
    "settings": {
        "import/resolver": {
        "webpack": {
            "config": "./webpack.bask.js"
        }
    }
}

版本与发布记录

@cloudbeds/eslint-config 共发布 77 个版本,首次发布于 2020/01/27;过去 12 个月发布了 1 个版本。

版本发布日期距今
2.12.7latest2025/11/1911 个月前
2.12.62025/10/301 年前
2.12.42025/10/291 年前
2.11.12024/10/182 年前
2.11.02024/10/182 年前
2.10.22024/06/142 年前

其他发布通道:canary → 0.11.8-alpha.0。

关于 @cloudbeds/eslint-config 的常见问题

@cloudbeds/eslint-config 是什么?

ESLint configuration for Cloudbeds apps注意:该包已被作者标记为弃用——This package has been moved to GitHub Packages. Install from https://github.com/cloudbeds/eslint-config/pkgs/npm/eslint-config

如何安装 @cloudbeds/eslint-config?

在项目目录运行 npm install @cloudbeds/eslint-config,或使用 pnpm add / yarn add / bun add。

@cloudbeds/eslint-config 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/cloudbeds__eslint-config 是否存在。

@cloudbeds/eslint-config 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@cloudbeds/eslint-config 可以商用吗?

@cloudbeds/eslint-config 使用 UNLICENSED 许可。作者声明为 UNLICENSED,即不授予公开使用许可(与公共领域的 Unlicense 不同)。使用前需获得作者授权。以上为概括,不构成法律意见,请以许可原文为准。

@cloudbeds/eslint-config 的下载量有多少?

根据 npm 官方下载统计,@cloudbeds/eslint-config 在 2026/10/10 – 2026/11/08 这 30 天内被下载 1,831 次,日均约 61 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@cloudbeds/eslint-config 还在维护吗?

最新版本 2.12.7 发布于 2025/11/19(11 个月前);至今共发布 77 个版本,其中过去 12 个月发布了 1 个;首次发布于 2020/01/27。作者已将其标记为弃用,新项目建议寻找替代方案。