@acuris/eslint-config

中文文档
0.1.18发布于 2025/07/16MITCommonJS近 30 天下载 5488

Acuris eslint shareable configuration

原始使用文档
文档目录6 节
  1. initialize your project
  2. if you install new packages after initializing a project (f…
  3. update @acuris/eslint-config
  4. lint your entire project
  5. project configuration
  6. Changelog

@acuris/eslint-config

@acuris/eslint-config

Shared Acuris eslint configuration and code quality tooling.

initialize your project

The simplest and preferred way to initialise your project is to run in your project folder this command:

npx @acuris/eslint-config@latest --init

This will start an interactive initialisation script that will setup everything you need, including packages installation.

if you install new packages after initializing a project (for example, jest or typescript), you may want to run acuris-eslint --init again to add additional dependencies.

update @acuris/eslint-config

Once installed, you can update to the latest version (including dependencies) executing

acuris-eslint --init

lint your entire project

You can lint your entire project running

acuris-eslint

You can fix the formatting for your entire project running

acuris-eslint --fix

You can also pass glob paths, folders or sinngle files to lint.

acuris-eslint hello.js myFolder

For mor help on the list of available options and commands, run

acuris-eslint --help

Note: If PATH does not resolve node binaries in node_modules/.bin, you can prepend all commands with npx.

project configuration

You can add acuris-eslint in package.json root to pass additional options.

{
  name: 'my-package',

  // ...

  "acuris-eslint": {
    /**
     * Override patterns used to apply different eslint rules.
     */
    filePatterns: {
      /** patterns that should be prettified when running --fix, but not validated using eslint parsers */
      prettier: string[] | { [pattern: string]: boolean },

      /** mjs module patterns */
      mjs: string[] | { [pattern: string]: boolean },

      /** .ts, .tsx patterns */
      typescript: string[] | { [pattern: string]: boolean },

      /** .d.ts patterns */
      typescriptDefinition: string[] | { [pattern: string]: boolean },

      /** binary script patterns */
      bin: string[] | { [pattern: string]: boolean },

      /** scripts pattern, similar to bin*/
      scripts: string[] | { [pattern: string]: boolean },

      /** server side code patterns */
      server: string[] | { [pattern: string]: boolean },

      /** dist folder patterns (less stringent rules) */
      dist: string[] | { [pattern: string]: boolean },

      /** test files patterns */
      tests: string[] | { [pattern: string]: boolean }
    },

    /**
     * The path of the eslintrc file to load when running acuris-eslint command
     * Can be overridden by command line option '--config'
     */
    eslintrc: string,
    /**
     * Enables or disable eslint cache when running acuris-eslint command.
     * Can be overridden by command line option '--cache' or '--no-cache'
     */
    eslintCache: boolean,
    /**
     * Changes the path of eslint cache when running acuris-eslint command.
     * By default is `.eslintcache`
     * Can be overridden by command line option '--cache-location'
     */
    eslintCacheLocation: string,
    /**
     * The warnigns and errors output format when running acuris-eslint command.
     * By default is `stylish`.
     * Can be overridden by command line option '--format'
     */
    eslintOutputFormat: string,

    /**
     * The react version to use for react eslint plugin.
     */
    reactVersion: string,

    /**
     * A custom path for the `tsconfig.json` configuration when using typescript.
     * By default, the first tsconfig.json in the current folder or parent folders is used.
     */
    tsConfigPath: string,

    /**
     * The list of packages to disable when initializing a project or running eslint.
     * For example, ['typescript', 'react', 'eslint-plugin-jsx-a11y'] disables typescript, react and jsx-a11y.
     *
     */
    ignoredPackages: string[] | { [packageName: string]: boolean },

    /**
      * Additional node_modules paths to use when resolving eslint plugins or configurations.
      */
    nodeResolvePaths: string[] | { [path: string]: boolean },
  }
}

Changelog

  • v.0.1.1
    • acuris-eslint now supports prettify all supported files, not only JS and TS. Uses thread workers to use free CPUs for prettify.
    • load extensions by overrides
    • add supports for .files, now they get linted
    • options --lint-staged and --ignore-unknown-extensions will skip file with extensions not supported when processing a list of files.
    • eslint 7.0.0, typesript 3.9
    • performance improvements and asynchronous write during fixing

版本与发布记录

@acuris/eslint-config 共发布 76 个版本,首次发布于 2019/07/26;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.1.18latest2025/07/161.3 年前
0.1.162023/08/093 年前
0.1.152020/10/236 年前
0.1.142020/10/096 年前
0.1.132020/10/096 年前
0.1.122020/08/106 年前

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

@acuris/eslint-config 是什么?

Acuris eslint shareable configuration

如何安装 @acuris/eslint-config?

在项目目录运行 npm install @acuris/eslint-config,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:eslint(>=7.11.0)、eslint-plugin-import(>=2.22.1)、eslint-plugin-json(>=2.1.2)、eslint-plugin-node(>=11.1.0)、eslint-plugin-promise(>=4.2.1)、prettier(>=2.1.2)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。它还提供命令行工具 acuris-eslint,可以用 npx acuris-eslint 直接运行。

@acuris/eslint-config 支持 TypeScript 吗?

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

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

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

@acuris/eslint-config 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=16.15.1。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

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

@acuris/eslint-config 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

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

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

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

最新版本 0.1.18 发布于 2025/07/16(1.3 年前);至今共发布 76 个版本,其中过去 12 个月发布了 0 个;首次发布于 2019/07/26。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。