@agilebot/eslint-config 0.8.10 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,9 +1,9 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2024 Agilebot, Inc.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
-
7
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
-
9
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 Agilebot, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,52 +1,52 @@
1
- # @agilebot/eslint-config
2
-
3
- [![npm](https://img.shields.io/npm/v/@agilebot/eslint-config?color=444&label=)](https://npmjs.com/package/@agilebot/eslint-config)
4
-
5
- ## Usage
6
-
7
- ### Manual Install
8
-
9
- ```bash
10
- npm install --save-dev eslint \
11
- @agilebot/eslint-config
12
- ```
13
-
14
- And create `eslint.config.mjs` in your project root:
15
-
16
- ```js
17
- // eslint.config.mjs
18
- import { agilebot } from '@agilebot/eslint-config';
19
-
20
- export default agilebot(import.meta);
21
- ```
22
-
23
- ## Customization
24
-
25
- The `agilebot` preset provides a streamlined way to configure your ESLint setup. Here’s how you can use it and customize it based on your needs.
26
-
27
- ### Basic Usage
28
-
29
- To get started, import the `agilebot` preset:
30
-
31
- ```js
32
- // eslint.config.mjs
33
- import { agilebot } from '@agilebot/eslint-config';
34
-
35
- export default agilebot(import.meta);
36
- ```
37
-
38
- This will automatically apply the default configurations provided by `agilebot`.
39
-
40
- ### Advanced Customization
41
-
42
- If you want more control, you can customize individual integrations using the [FactoryOptions](https://github.com/sh-agilebot/frontend-toolkit/blob/master/packages/eslint-config/src/factory/options.ts) interface. For example:
43
-
44
- ```js
45
- // eslint.config.mjs
46
- import { agilebot } from '@agilebot/eslint-config';
47
-
48
- export default agilebot(import.meta, {
49
- ...
50
- // Other options
51
- });
52
- ```
1
+ # @agilebot/eslint-config
2
+
3
+ [![npm](https://img.shields.io/npm/v/@agilebot/eslint-config?color=444&label=)](https://npmjs.com/package/@agilebot/eslint-config)
4
+
5
+ ## Usage
6
+
7
+ ### Manual Install
8
+
9
+ ```bash
10
+ npm install --save-dev eslint \
11
+ @agilebot/eslint-config
12
+ ```
13
+
14
+ And create `eslint.config.mjs` in your project root:
15
+
16
+ ```js
17
+ // eslint.config.mjs
18
+ import { agilebot } from '@agilebot/eslint-config';
19
+
20
+ export default agilebot(import.meta);
21
+ ```
22
+
23
+ ## Customization
24
+
25
+ The `agilebot` preset provides a streamlined way to configure your ESLint setup. Here’s how you can use it and customize it based on your needs.
26
+
27
+ ### Basic Usage
28
+
29
+ To get started, import the `agilebot` preset:
30
+
31
+ ```js
32
+ // eslint.config.mjs
33
+ import { agilebot } from '@agilebot/eslint-config';
34
+
35
+ export default agilebot(import.meta);
36
+ ```
37
+
38
+ This will automatically apply the default configurations provided by `agilebot`.
39
+
40
+ ### Advanced Customization
41
+
42
+ If you want more control, you can customize individual integrations using the [FactoryOptions](https://github.com/sh-agilebot/frontend-toolkit/blob/master/packages/eslint-config/src/factory/options.ts) interface. For example:
43
+
44
+ ```js
45
+ // eslint.config.mjs
46
+ import { agilebot } from '@agilebot/eslint-config';
47
+
48
+ export default agilebot(import.meta, {
49
+ ...
50
+ // Other options
51
+ });
52
+ ```
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- require('../dist/cli');
2
+ import '../dist/cli.js';
package/dist/cli.js CHANGED
@@ -1,20 +1,13 @@
1
- /**
2
- * @license @agilebot/eslint-config v0.8.10
3
- *
4
- * Copyright (c) Agilebot, Inc. and its affiliates.
5
- *
6
- * This source code is licensed under the MIT license found in the
7
- * LICENSE file in the root directory of this source tree.
8
- */
9
-
10
- const require_constants = require('./constants-U8EdftFI.js');
11
- const yargs = require_constants.__toESM(require("yargs"));
12
- const yargs_helpers = require_constants.__toESM(require("yargs/helpers"));
13
- const ansis = require_constants.__toESM(require("ansis"));
14
- const __agilebot_eslint_utils = require_constants.__toESM(require("@agilebot/eslint-utils"));
15
- const node_path = require_constants.__toESM(require("node:path"));
1
+ import { CLI_NAME } from "./constants-D6y7pnqv.js";
2
+ import { createRequire } from "node:module";
3
+ import yargs from "yargs";
4
+ import { hideBin } from "yargs/helpers";
5
+ import ansis from "ansis";
6
+ import { isCI } from "@agilebot/eslint-utils";
7
+ import path from "node:path";
16
8
 
17
9
  //#region src/cli/stages/eslint.ts
10
+ const require = createRequire(import.meta.url);
18
11
  function patch() {
19
12
  if (console?.error) {
20
13
  const origConsoleError = console.error;
@@ -26,7 +19,7 @@ function patch() {
26
19
  }
27
20
  function runBinary() {
28
21
  const pkg = require.resolve("eslint/package.json");
29
- const bin = node_path.default.join(pkg, "..", "bin", "eslint.js");
22
+ const bin = path.join(pkg, "..", "bin", "eslint.js");
30
23
  require(bin);
31
24
  }
32
25
 
@@ -34,7 +27,7 @@ function runBinary() {
34
27
  //#region src/cli/index.ts
35
28
  function cli() {
36
29
  patch();
37
- const argv = (0, yargs.default)((0, yargs_helpers.hideBin)(process.argv)).scriptName(require_constants.CLI_NAME).usage(`${require_constants.CLI_NAME} [options] file.js [file.js] [dir]`).options({
30
+ const argv = yargs(hideBin(process.argv)).scriptName(CLI_NAME).usage(`${CLI_NAME} [options] file.js [file.js] [dir]`).options({
38
31
  config: {
39
32
  alias: "c",
40
33
  type: "string",
@@ -63,7 +56,7 @@ function cli() {
63
56
  }).alias("h", "help").alias("v", "version").parseSync();
64
57
  process.argv = process.argv.slice(0, 2);
65
58
  if (argv._.length === 0) {
66
- console.error(ansis.default.red("Error: 'patterns' must be a non-empty string or an array of non-empty strings"));
59
+ console.error(ansis.red("Error: 'patterns' must be a non-empty string or an array of non-empty strings"));
67
60
  process.exit(1);
68
61
  }
69
62
  argv._.forEach((pattern) => {
@@ -71,9 +64,9 @@ function cli() {
71
64
  });
72
65
  if (argv.fix) process.argv.splice(2, 0, "--fix");
73
66
  if (argv.config) process.argv.splice(2, 0, "--config", argv.config);
74
- if (argv.progress && !(0, __agilebot_eslint_utils.isCI)()) process.argv.splice(2, 0, "--plugin", "file-progress", "--rule", "file-progress/activate: 1");
75
- if (!argv.showWarningsInCi && (0, __agilebot_eslint_utils.isCI)()) {
76
- console.warn(ansis.default.yellow(`Warning: ${require_constants.CLI_NAME} will report errors only in CI environment`));
67
+ if (argv.progress && !isCI()) process.argv.splice(2, 0, "--plugin", "file-progress", "--rule", "file-progress/activate: 1");
68
+ if (!argv.showWarningsInCi && isCI()) {
69
+ console.warn(ansis.yellow(`Warning: ${CLI_NAME} will report errors only in CI environment`));
77
70
  process.argv.splice(2, 0, "--quiet");
78
71
  }
79
72
  if (argv.checkIntl) process.argv.splice(2, 0, "--rule", "@agilebot/intl-id-unused: 1");
@@ -84,4 +77,5 @@ function cli() {
84
77
  //#region src/cli.ts
85
78
  cli();
86
79
 
87
- //#endregion
80
+ //#endregion
81
+ export { };
@@ -1,12 +1,3 @@
1
- /**
2
- * @license @agilebot/eslint-config v0.8.10
3
- *
4
- * Copyright (c) Agilebot, Inc. and its affiliates.
5
- *
6
- * This source code is licensed under the MIT license found in the
7
- * LICENSE file in the root directory of this source tree.
8
- */
9
-
10
1
  //#region src/constants.ts
11
2
  const JS_EXTS = [
12
3
  ".js",
package/dist/index.d.ts CHANGED
@@ -1,15 +1,6 @@
1
- /**
2
- * @license @agilebot/eslint-config v0.8.10
3
- *
4
- * Copyright (c) Agilebot, Inc. and its affiliates.
5
- *
6
- * This source code is licensed under the MIT license found in the
7
- * LICENSE file in the root directory of this source tree.
8
- */
9
-
1
+ import { Options } from "@cspell/eslint-plugin";
10
2
  import { Linter } from "eslint";
11
- import { Options } from "prettier";
12
- import { Options as Options$1 } from "@cspell/eslint-plugin";
3
+ import { Options as Options$1 } from "prettier";
13
4
 
14
5
  //#region src/types.d.ts
15
6
  interface FlatConfigItem extends Linter.Config {
@@ -19,7 +10,7 @@ interface FlatConfigItem extends Linter.Config {
19
10
  }
20
11
  //#endregion
21
12
  //#region src/configs/cspell.d.ts
22
- type Options$2 = Options$1['cspell'];
13
+ type Options$2 = Options['cspell'];
23
14
  //#endregion
24
15
  //#region src/configs/imports.d.ts
25
16
  interface ImportsOptions {
@@ -49,11 +40,6 @@ interface ImportsOptions {
49
40
  */
50
41
  allowExtraneousDependencies?: boolean;
51
42
  }
52
- /**
53
- * eslint-plugin-import 规则
54
- * @param packageDir 子包路径
55
- * @param opts 参数
56
- */
57
43
  //#endregion
58
44
  //#region src/factory/options.d.ts
59
45
  interface FactoryOptions {
@@ -101,7 +87,7 @@ interface FactoryOptions {
101
87
  * Enable Prettier for code formatting
102
88
  * @default true
103
89
  */
104
- prettier?: boolean | Options;
90
+ prettier?: boolean | Options$1;
105
91
  /**
106
92
  * Enable Lodash-specific linting rules
107
93
  * @default true