@agilebot/eslint-config 0.7.3 → 0.8.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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @agilebot/eslint-config v0.7.3
2
+ * @license @agilebot/eslint-config v0.8.0
3
3
  *
4
4
  * Copyright (c) Agilebot, Inc. and its affiliates.
5
5
  *
@@ -17,7 +17,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
17
17
  // <define:__STANDARD_RULES>
18
18
  var define_STANDARD_RULES_default = { "class-methods-use-this": ["off"], "dot-notation": ["off"], "init-declarations": ["off"], "max-params": ["off"], "no-array-constructor": ["off"], "no-dupe-class-members": ["off"], "no-empty-function": ["off"], "no-implied-eval": ["off"], "no-loop-func": ["off"], "no-magic-numbers": ["off"], "no-unused-expressions": ["off"], "no-unused-vars": ["off"], "no-use-before-define": ["off"], "no-useless-constructor": ["off"], "prefer-destructuring": ["off"], "prefer-promise-reject-errors": ["off"], "accessor-pairs": ["error", { setWithoutGet: true, getWithoutSet: false, enforceForClassMembers: true }], "array-callback-return": ["error", { allowImplicit: false, allowVoid: false, checkForEach: false }], "constructor-super": ["error"], curly: ["error", "multi-line"], "default-case-last": ["error"], eqeqeq: ["error", "always", { null: "ignore" }], "new-cap": ["error", { newIsCap: true, capIsNew: false, properties: true }], "no-async-promise-executor": ["error"], "no-caller": ["error"], "no-case-declarations": ["error"], "no-class-assign": ["error"], "no-compare-neg-zero": ["error"], "no-cond-assign": ["error"], "no-const-assign": ["error"], "no-constant-condition": ["error", { checkLoops: false }], "no-control-regex": ["error"], "no-debugger": ["error"], "no-delete-var": ["error"], "no-dupe-args": ["error"], "no-dupe-keys": ["error"], "no-duplicate-case": ["error"], "no-useless-backreference": ["error"], "no-empty": ["error", { allowEmptyCatch: true }], "no-empty-character-class": ["error"], "no-empty-pattern": ["error"], "no-eval": ["error"], "no-ex-assign": ["error"], "no-extend-native": ["error"], "no-extra-bind": ["error"], "no-extra-boolean-cast": ["error"], "no-fallthrough": ["error"], "no-func-assign": ["error"], "no-global-assign": ["error"], "no-import-assign": ["error"], "no-invalid-regexp": ["error"], "no-irregular-whitespace": ["error"], "no-iterator": ["error"], "no-labels": ["error", { allowLoop: false, allowSwitch: false }], "no-lone-blocks": ["error"], "no-loss-of-precision": ["error"], "no-misleading-character-class": ["error"], "no-prototype-builtins": ["error"], "no-useless-catch": ["error"], "no-multi-str": ["error"], "no-new": ["error"], "no-new-func": ["error"], "no-new-native-nonconstructor": ["error"], "no-new-wrappers": ["error"], "no-obj-calls": ["error"], "no-object-constructor": ["error"], "no-octal": ["error"], "no-octal-escape": ["error"], "no-proto": ["error"], "no-regex-spaces": ["error"], "no-return-assign": ["error", "except-parens"], "no-self-assign": ["error", { props: true }], "no-self-compare": ["error"], "no-sequences": ["error"], "no-shadow-restricted-names": ["error"], "no-sparse-arrays": ["error"], "no-template-curly-in-string": ["error"], "no-this-before-super": ["error"], "no-throw-literal": ["off"], "no-unexpected-multiline": ["error"], "no-unmodified-loop-condition": ["error"], "no-unneeded-ternary": ["error", { defaultAssignment: false }], "no-unreachable": ["error"], "no-unreachable-loop": ["error"], "no-unsafe-finally": ["error"], "no-unsafe-negation": ["error"], "no-useless-call": ["error"], "no-useless-computed-key": ["error"], "no-useless-escape": ["error"], "no-useless-rename": ["error"], "no-useless-return": ["error"], "no-var": ["error"], "no-void": ["error", { allowAsStatement: true }], "no-with": ["error"], "object-shorthand": ["warn", "properties"], "one-var": ["error", { initialized: "never" }], "prefer-const": ["error", { destructuring: "all", ignoreReadBeforeAssign: false }], "prefer-regex-literals": ["error", { disallowRedundantWrapping: true }], "symbol-description": ["error"], "unicode-bom": ["error", "never"], "use-isnan": ["error", { enforceForSwitchCase: true, enforceForIndexOf: true }], "valid-typeof": ["error", { requireStringLiterals: true }], yoda: ["error", "never"], "import/export": ["error"], "import/first": ["error"], "import/no-absolute-path": ["error", { esmodule: true, commonjs: true, amd: false }], "import/no-duplicates": ["error"], "import/no-named-default": ["error"], "import/no-webpack-loader-syntax": ["error"], "n/handle-callback-err": ["error", "^(err|error)$"], "n/no-callback-literal": ["error"], "n/no-deprecated-api": ["error"], "n/no-exports-assign": ["error"], "n/no-new-require": ["error"], "n/no-path-concat": ["error"], "n/process-exit-as-throw": ["error"], "promise/param-names": ["error"], "@typescript-eslint/adjacent-overload-signatures": ["error"], "@typescript-eslint/array-type": ["error", { default: "array-simple" }], "@typescript-eslint/await-thenable": ["error"], "@typescript-eslint/ban-ts-comment": ["error", { "ts-expect-error": "allow-with-description", "ts-ignore": true, "ts-nocheck": true, "ts-check": false, minimumDescriptionLength: 3 }], "@typescript-eslint/ban-tslint-comment": ["error"], "@typescript-eslint/class-literal-property-style": ["error", "fields"], "@typescript-eslint/class-methods-use-this": ["error", { exceptMethods: [], enforceForClassFields: true, ignoreOverrideMethods: false, ignoreClassesThatImplementAnInterface: false }], "@typescript-eslint/consistent-generic-constructors": ["error", "constructor"], "@typescript-eslint/consistent-indexed-object-style": ["error", "record"], "@typescript-eslint/consistent-type-assertions": ["error", { assertionStyle: "as", objectLiteralTypeAssertions: "never" }], "@typescript-eslint/consistent-type-definitions": ["error", "interface"], "@typescript-eslint/consistent-type-exports": ["error", { fixMixedExportsWithInlineTypeSpecifier: true }], "@typescript-eslint/consistent-type-imports": ["error", { prefer: "type-imports", disallowTypeAnnotations: true, fixStyle: "inline-type-imports" }], "@typescript-eslint/dot-notation": ["error", { allowIndexSignaturePropertyAccess: false, allowKeywords: true, allowPattern: "", allowPrivateClassPropertyAccess: false, allowProtectedClassPropertyAccess: false }], "@typescript-eslint/explicit-function-return-type": ["error", { allowExpressions: true, allowHigherOrderFunctions: true, allowTypedFunctionExpressions: true, allowDirectConstAssertionInArrowFunctions: true }], "@typescript-eslint/init-declarations": ["error", "always"], "@typescript-eslint/max-params": ["error", { max: 4 }], "@typescript-eslint/method-signature-style": ["error"], "@typescript-eslint/naming-convention": ["error", { selector: "variableLike", leadingUnderscore: "allow", trailingUnderscore: "allow", format: ["camelCase", "PascalCase", "UPPER_CASE"] }], "@typescript-eslint/no-array-constructor": ["error"], "@typescript-eslint/no-array-delete": ["error"], "@typescript-eslint/no-base-to-string": ["error"], "@typescript-eslint/no-confusing-non-null-assertion": ["error"], "@typescript-eslint/no-confusing-void-expression": ["error", { ignoreArrowShorthand: false, ignoreVoidOperator: false }], "@typescript-eslint/no-deprecated": ["warn"], "@typescript-eslint/no-dupe-class-members": ["error"], "@typescript-eslint/no-duplicate-enum-values": ["error"], "@typescript-eslint/no-duplicate-type-constituents": ["error", { ignoreIntersections: false, ignoreUnions: false }], "@typescript-eslint/no-dynamic-delete": ["error"], "@typescript-eslint/no-empty-function": ["error", { allow: [] }], "@typescript-eslint/no-empty-object-type": ["error", { allowInterfaces: "with-single-extends", allowObjectTypes: "never" }], "@typescript-eslint/no-explicit-any": ["error", { fixToUnknown: false, ignoreRestArgs: false }], "@typescript-eslint/no-extra-non-null-assertion": ["error"], "@typescript-eslint/no-extraneous-class": ["error", { allowWithDecorator: true }], "@typescript-eslint/no-floating-promises": ["error"], "@typescript-eslint/no-for-in-array": ["error"], "@typescript-eslint/no-implied-eval": ["error"], "@typescript-eslint/no-import-type-side-effects": ["error"], "@typescript-eslint/no-inferrable-types": ["error", { ignoreParameters: false, ignoreProperties: false }], "@typescript-eslint/no-invalid-void-type": ["error"], "@typescript-eslint/no-loop-func": ["error"], "@typescript-eslint/no-magic-numbers": ["error", { ignore: [], ignoreArrayIndexes: false, ignoreDefaultValues: false, ignoreClassFieldInitialValues: false, enforceConst: false, detectObjects: true, ignoreEnums: true, ignoreNumericLiteralTypes: false, ignoreReadonlyClassProperties: true, ignoreTypeIndexes: false }], "@typescript-eslint/no-meaningless-void-operator": ["error", { checkNever: true }], "@typescript-eslint/no-misused-new": ["error"], "@typescript-eslint/no-misused-promises": ["error"], "@typescript-eslint/no-mixed-enums": ["error"], "@typescript-eslint/no-namespace": ["error"], "@typescript-eslint/no-non-null-asserted-nullish-coalescing": ["error"], "@typescript-eslint/no-non-null-asserted-optional-chain": ["error"], "@typescript-eslint/no-non-null-assertion": ["error"], "@typescript-eslint/no-redundant-type-constituents": ["error"], "@typescript-eslint/no-require-imports": ["error", { allow: [], allowAsImport: false }], "@typescript-eslint/no-this-alias": ["error", { allowDestructuring: true }], "@typescript-eslint/no-unnecessary-boolean-literal-compare": ["error"], "@typescript-eslint/no-unnecessary-condition": ["error", { allowConstantLoopConditions: true }], "@typescript-eslint/no-unnecessary-parameter-property-assignment": ["error"], "@typescript-eslint/no-unnecessary-qualifier": ["error"], "@typescript-eslint/no-unnecessary-template-expression": ["error"], "@typescript-eslint/no-unnecessary-type-arguments": ["error"], "@typescript-eslint/no-unnecessary-type-assertion": ["error"], "@typescript-eslint/no-unnecessary-type-constraint": ["error"], "@typescript-eslint/no-unnecessary-type-parameters": ["error"], "@typescript-eslint/no-unsafe-argument": ["error"], "@typescript-eslint/no-unsafe-assignment": ["error"], "@typescript-eslint/no-unsafe-call": ["error"], "@typescript-eslint/no-unsafe-declaration-merging": ["error"], "@typescript-eslint/no-unsafe-enum-comparison": ["error"], "@typescript-eslint/no-unsafe-function-type": ["error"], "@typescript-eslint/no-unsafe-member-access": ["error"], "@typescript-eslint/no-unsafe-return": ["error"], "@typescript-eslint/no-unsafe-unary-minus": ["error"], "@typescript-eslint/no-unused-expressions": ["error", { allowShortCircuit: true, allowTernary: true, allowTaggedTemplates: true, enforceForJSX: false }], "@typescript-eslint/no-unused-vars": ["error", { args: "none", caughtErrors: "none", ignoreRestSiblings: true, vars: "all" }], "@typescript-eslint/no-use-before-define": ["error", { functions: false, classes: false, enums: false, variables: false, typedefs: false }], "@typescript-eslint/no-useless-constructor": ["error"], "@typescript-eslint/no-useless-empty-export": ["error"], "@typescript-eslint/no-wrapper-object-types": ["error"], "@typescript-eslint/non-nullable-type-assertion-style": ["error"], "@typescript-eslint/only-throw-error": ["error", { allowThrowingAny: false, allowThrowingUnknown: false }], "@typescript-eslint/prefer-as-const": ["error"], "@typescript-eslint/prefer-destructuring": ["error", { array: true, object: true }, { enforceForRenamedProperties: true, enforceForDeclarationWithTypeAnnotation: false }], "@typescript-eslint/prefer-function-type": ["error"], "@typescript-eslint/prefer-includes": ["error"], "@typescript-eslint/prefer-nullish-coalescing": ["error", { ignoreConditionalTests: false, ignoreMixedLogicalExpressions: false }], "@typescript-eslint/prefer-optional-chain": ["error"], "@typescript-eslint/prefer-promise-reject-errors": ["error"], "@typescript-eslint/prefer-readonly": ["error"], "@typescript-eslint/prefer-reduce-type-parameter": ["error"], "@typescript-eslint/prefer-return-this-type": ["error"], "@typescript-eslint/promise-function-async": ["error"], "@typescript-eslint/require-array-sort-compare": ["error", { ignoreStringArrays: true }], "@typescript-eslint/restrict-plus-operands": ["error", { skipCompoundAssignments: false }], "@typescript-eslint/restrict-template-expressions": ["error", { allowNumber: true }], "@typescript-eslint/return-await": ["error", "always"], "@typescript-eslint/strict-boolean-expressions": ["error", { allowString: false, allowNumber: false, allowNullableObject: false, allowNullableBoolean: false, allowNullableString: false, allowNullableNumber: false, allowAny: false }], "@typescript-eslint/triple-slash-reference": ["error", { lib: "never", path: "never", types: "never" }], "@typescript-eslint/unbound-method": ["error", { ignoreStatic: false }] };
19
19
 
20
- // ../../node_modules/.pnpm/tsup@8.3.5_jiti@2.3.3_postcss@8.4.49_tsx@4.19.2_typescript@5.7.2_yaml@2.6.1/node_modules/tsup/assets/esm_shims.js
20
+ // ../../node_modules/.pnpm/tsup@8.4.0_jiti@2.4.2_postcss@8.5.3_tsx@4.19.3_typescript@5.7.2_yaml@2.7.0/node_modules/tsup/assets/esm_shims.js
21
21
  import { fileURLToPath } from "url";
22
22
  import path from "path";
23
23
  var getFilename = () => fileURLToPath(import.meta.url);
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @agilebot/eslint-config v0.7.3
2
+ * @license @agilebot/eslint-config v0.8.0
3
3
  *
4
4
  * Copyright (c) Agilebot, Inc. and its affiliates.
5
5
  *
@@ -32,10 +32,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
32
32
  ));
33
33
 
34
34
  // src/cli/index.ts
35
- var import_eslint_utils = require("@agilebot/eslint-utils");
36
35
  var import_yargs = __toESM(require("yargs"));
37
36
  var import_helpers = require("yargs/helpers");
38
- var import_picocolors = __toESM(require("picocolors"));
37
+ var import_ansis = __toESM(require("ansis"));
38
+ var import_eslint_utils = require("@agilebot/eslint-utils");
39
39
 
40
40
  // src/constants.ts
41
41
  var JS_EXTS = [".js", ".jsx", ".cjs", ".cjsx", ".mjs", ".mjsx"];
@@ -102,7 +102,7 @@ function cli() {
102
102
  process.argv = process.argv.slice(0, 2);
103
103
  if (argv._.length === 0) {
104
104
  console.error(
105
- import_picocolors.default.red(
105
+ import_ansis.default.red(
106
106
  "Error: 'patterns' must be a non-empty string or an array of non-empty strings"
107
107
  )
108
108
  );
@@ -129,7 +129,7 @@ function cli() {
129
129
  }
130
130
  if (!argv.showWarningsInCi && (0, import_eslint_utils.isCI)()) {
131
131
  console.warn(
132
- import_picocolors.default.yellow(
132
+ import_ansis.default.yellow(
133
133
  `Warning: ${CLI_NAME} will report errors only in CI environment`
134
134
  )
135
135
  );
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @agilebot/eslint-config v0.7.3
2
+ * @license @agilebot/eslint-config v0.8.0
3
3
  *
4
4
  * Copyright (c) Agilebot, Inc. and its affiliates.
5
5
  *
@@ -10,13 +10,13 @@
10
10
  import {
11
11
  CLI_NAME,
12
12
  __require
13
- } from "./chunk-CGJVNMKG.mjs";
13
+ } from "./chunk-NVFPC5RO.mjs";
14
14
 
15
15
  // src/cli/index.ts
16
- import { isCI } from "@agilebot/eslint-utils";
17
16
  import yargs from "yargs";
18
17
  import { hideBin } from "yargs/helpers";
19
- import pc from "picocolors";
18
+ import ansis from "ansis";
19
+ import { isCI } from "@agilebot/eslint-utils";
20
20
 
21
21
  // src/cli/stages/eslint.ts
22
22
  import path from "node:path";
@@ -70,7 +70,7 @@ function cli() {
70
70
  process.argv = process.argv.slice(0, 2);
71
71
  if (argv._.length === 0) {
72
72
  console.error(
73
- pc.red(
73
+ ansis.red(
74
74
  "Error: 'patterns' must be a non-empty string or an array of non-empty strings"
75
75
  )
76
76
  );
@@ -97,7 +97,7 @@ function cli() {
97
97
  }
98
98
  if (!argv.showWarningsInCi && isCI()) {
99
99
  console.warn(
100
- pc.yellow(
100
+ ansis.yellow(
101
101
  `Warning: ${CLI_NAME} will report errors only in CI environment`
102
102
  )
103
103
  );
package/dist/index.d.mts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Linter } from 'eslint';
2
+ import { Options as Options$2 } from 'prettier';
2
3
  import { Options as Options$1 } from '@cspell/eslint-plugin';
3
4
 
4
5
  interface FlatConfigItem extends Linter.Config {
@@ -9,32 +10,50 @@ interface FlatConfigItem extends Linter.Config {
9
10
 
10
11
  type Options = Options$1['cspell'];
11
12
 
12
- interface FactoryOptions {
13
+ interface ImportsOptions {
13
14
  /**
14
- * Custom ESLint configuration to override or extend defaults
15
+ * 额外的devDependencies
15
16
  * @default undefined
16
17
  */
17
- config?: Omit<FlatConfigItem, 'name' | 'files'>;
18
+ devDependencies?: string[];
18
19
  /**
19
- * List of files to ignore
20
+ * monorepo前缀
20
21
  * @default undefined
21
22
  */
22
- ignores?: string[];
23
+ monorepoScope?: string;
23
24
  /**
24
- * List of files or directories where development dependencies are allowed
25
- * @default undefined
25
+ * 核心模块
26
+ * @default undefiend
26
27
  */
27
- devDependencies?: string[];
28
+ coreModules?: string[];
29
+ /**
30
+ * 解析器
31
+ * @default 'typescript'
32
+ */
33
+ resolver?: 'typescript' | 'oxc';
34
+ /**
35
+ * 是否允许相对路径
36
+ * @default false
37
+ */
38
+ allowRelativePaths?: boolean;
28
39
  /**
29
- * List of modules to be treated as built-in
40
+ * 是否允许幽灵依赖
41
+ * @default false
42
+ */
43
+ allowExtraneousDependencies?: boolean;
44
+ }
45
+
46
+ interface FactoryOptions {
47
+ /**
48
+ * Custom ESLint configuration to override or extend defaults
30
49
  * @default undefined
31
50
  */
32
- coreModules?: string[];
51
+ config?: Omit<FlatConfigItem, 'name' | 'files'>;
33
52
  /**
34
- * Specific monorepo scope to apply configurations for
53
+ * List of files to ignore
35
54
  * @default undefined
36
55
  */
37
- monorepoScope?: string;
56
+ ignores?: string[];
38
57
  /**
39
58
  * Enable React-specific linting rules
40
59
  * @default undefined
@@ -64,7 +83,7 @@ interface FactoryOptions {
64
83
  * Enable Prettier for code formatting
65
84
  * @default true
66
85
  */
67
- prettier?: boolean;
86
+ prettier?: boolean | Options$2;
68
87
  /**
69
88
  * Enable Lodash-specific linting rules
70
89
  * @default true
@@ -76,14 +95,10 @@ interface FactoryOptions {
76
95
  */
77
96
  cspell?: Options | false;
78
97
  /**
79
- * Enable imports-related linting configurations
98
+ * Enable or disable import linting rules
80
99
  * @default true
81
100
  */
82
- import?: boolean;
83
- /**
84
- * Flag indicating which import resolver to use
85
- */
86
- importResolver?: 'typescript' | 'oxc';
101
+ import?: ImportsOptions | boolean;
87
102
  }
88
103
 
89
104
  declare function factory(root: string | ImportMeta, options?: FactoryOptions): FlatConfigItem[];
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Linter } from 'eslint';
2
+ import { Options as Options$2 } from 'prettier';
2
3
  import { Options as Options$1 } from '@cspell/eslint-plugin';
3
4
 
4
5
  interface FlatConfigItem extends Linter.Config {
@@ -9,32 +10,50 @@ interface FlatConfigItem extends Linter.Config {
9
10
 
10
11
  type Options = Options$1['cspell'];
11
12
 
12
- interface FactoryOptions {
13
+ interface ImportsOptions {
13
14
  /**
14
- * Custom ESLint configuration to override or extend defaults
15
+ * 额外的devDependencies
15
16
  * @default undefined
16
17
  */
17
- config?: Omit<FlatConfigItem, 'name' | 'files'>;
18
+ devDependencies?: string[];
18
19
  /**
19
- * List of files to ignore
20
+ * monorepo前缀
20
21
  * @default undefined
21
22
  */
22
- ignores?: string[];
23
+ monorepoScope?: string;
23
24
  /**
24
- * List of files or directories where development dependencies are allowed
25
- * @default undefined
25
+ * 核心模块
26
+ * @default undefiend
26
27
  */
27
- devDependencies?: string[];
28
+ coreModules?: string[];
29
+ /**
30
+ * 解析器
31
+ * @default 'typescript'
32
+ */
33
+ resolver?: 'typescript' | 'oxc';
34
+ /**
35
+ * 是否允许相对路径
36
+ * @default false
37
+ */
38
+ allowRelativePaths?: boolean;
28
39
  /**
29
- * List of modules to be treated as built-in
40
+ * 是否允许幽灵依赖
41
+ * @default false
42
+ */
43
+ allowExtraneousDependencies?: boolean;
44
+ }
45
+
46
+ interface FactoryOptions {
47
+ /**
48
+ * Custom ESLint configuration to override or extend defaults
30
49
  * @default undefined
31
50
  */
32
- coreModules?: string[];
51
+ config?: Omit<FlatConfigItem, 'name' | 'files'>;
33
52
  /**
34
- * Specific monorepo scope to apply configurations for
53
+ * List of files to ignore
35
54
  * @default undefined
36
55
  */
37
- monorepoScope?: string;
56
+ ignores?: string[];
38
57
  /**
39
58
  * Enable React-specific linting rules
40
59
  * @default undefined
@@ -64,7 +83,7 @@ interface FactoryOptions {
64
83
  * Enable Prettier for code formatting
65
84
  * @default true
66
85
  */
67
- prettier?: boolean;
86
+ prettier?: boolean | Options$2;
68
87
  /**
69
88
  * Enable Lodash-specific linting rules
70
89
  * @default true
@@ -76,14 +95,10 @@ interface FactoryOptions {
76
95
  */
77
96
  cspell?: Options | false;
78
97
  /**
79
- * Enable imports-related linting configurations
98
+ * Enable or disable import linting rules
80
99
  * @default true
81
100
  */
82
- import?: boolean;
83
- /**
84
- * Flag indicating which import resolver to use
85
- */
86
- importResolver?: 'typescript' | 'oxc';
101
+ import?: ImportsOptions | boolean;
87
102
  }
88
103
 
89
104
  declare function factory(root: string | ImportMeta, options?: FactoryOptions): FlatConfigItem[];
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @agilebot/eslint-config v0.7.3
2
+ * @license @agilebot/eslint-config v0.8.0
3
3
  *
4
4
  * Copyright (c) Agilebot, Inc. and its affiliates.
5
5
  *
@@ -37,11 +37,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
37
37
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
38
38
 
39
39
  // src/index.ts
40
- var src_exports = {};
41
- __export(src_exports, {
40
+ var index_exports = {};
41
+ __export(index_exports, {
42
42
  agilebot: () => factory
43
43
  });
44
- module.exports = __toCommonJS(src_exports);
44
+ module.exports = __toCommonJS(index_exports);
45
45
 
46
46
  // <define:__STANDARD_RULES>
47
47
  var define_STANDARD_RULES_default = { "class-methods-use-this": ["off"], "dot-notation": ["off"], "init-declarations": ["off"], "max-params": ["off"], "no-array-constructor": ["off"], "no-dupe-class-members": ["off"], "no-empty-function": ["off"], "no-implied-eval": ["off"], "no-loop-func": ["off"], "no-magic-numbers": ["off"], "no-unused-expressions": ["off"], "no-unused-vars": ["off"], "no-use-before-define": ["off"], "no-useless-constructor": ["off"], "prefer-destructuring": ["off"], "prefer-promise-reject-errors": ["off"], "accessor-pairs": ["error", { setWithoutGet: true, getWithoutSet: false, enforceForClassMembers: true }], "array-callback-return": ["error", { allowImplicit: false, allowVoid: false, checkForEach: false }], "constructor-super": ["error"], curly: ["error", "multi-line"], "default-case-last": ["error"], eqeqeq: ["error", "always", { null: "ignore" }], "new-cap": ["error", { newIsCap: true, capIsNew: false, properties: true }], "no-async-promise-executor": ["error"], "no-caller": ["error"], "no-case-declarations": ["error"], "no-class-assign": ["error"], "no-compare-neg-zero": ["error"], "no-cond-assign": ["error"], "no-const-assign": ["error"], "no-constant-condition": ["error", { checkLoops: false }], "no-control-regex": ["error"], "no-debugger": ["error"], "no-delete-var": ["error"], "no-dupe-args": ["error"], "no-dupe-keys": ["error"], "no-duplicate-case": ["error"], "no-useless-backreference": ["error"], "no-empty": ["error", { allowEmptyCatch: true }], "no-empty-character-class": ["error"], "no-empty-pattern": ["error"], "no-eval": ["error"], "no-ex-assign": ["error"], "no-extend-native": ["error"], "no-extra-bind": ["error"], "no-extra-boolean-cast": ["error"], "no-fallthrough": ["error"], "no-func-assign": ["error"], "no-global-assign": ["error"], "no-import-assign": ["error"], "no-invalid-regexp": ["error"], "no-irregular-whitespace": ["error"], "no-iterator": ["error"], "no-labels": ["error", { allowLoop: false, allowSwitch: false }], "no-lone-blocks": ["error"], "no-loss-of-precision": ["error"], "no-misleading-character-class": ["error"], "no-prototype-builtins": ["error"], "no-useless-catch": ["error"], "no-multi-str": ["error"], "no-new": ["error"], "no-new-func": ["error"], "no-new-native-nonconstructor": ["error"], "no-new-wrappers": ["error"], "no-obj-calls": ["error"], "no-object-constructor": ["error"], "no-octal": ["error"], "no-octal-escape": ["error"], "no-proto": ["error"], "no-regex-spaces": ["error"], "no-return-assign": ["error", "except-parens"], "no-self-assign": ["error", { props: true }], "no-self-compare": ["error"], "no-sequences": ["error"], "no-shadow-restricted-names": ["error"], "no-sparse-arrays": ["error"], "no-template-curly-in-string": ["error"], "no-this-before-super": ["error"], "no-throw-literal": ["off"], "no-unexpected-multiline": ["error"], "no-unmodified-loop-condition": ["error"], "no-unneeded-ternary": ["error", { defaultAssignment: false }], "no-unreachable": ["error"], "no-unreachable-loop": ["error"], "no-unsafe-finally": ["error"], "no-unsafe-negation": ["error"], "no-useless-call": ["error"], "no-useless-computed-key": ["error"], "no-useless-escape": ["error"], "no-useless-rename": ["error"], "no-useless-return": ["error"], "no-var": ["error"], "no-void": ["error", { allowAsStatement: true }], "no-with": ["error"], "object-shorthand": ["warn", "properties"], "one-var": ["error", { initialized: "never" }], "prefer-const": ["error", { destructuring: "all", ignoreReadBeforeAssign: false }], "prefer-regex-literals": ["error", { disallowRedundantWrapping: true }], "symbol-description": ["error"], "unicode-bom": ["error", "never"], "use-isnan": ["error", { enforceForSwitchCase: true, enforceForIndexOf: true }], "valid-typeof": ["error", { requireStringLiterals: true }], yoda: ["error", "never"], "import/export": ["error"], "import/first": ["error"], "import/no-absolute-path": ["error", { esmodule: true, commonjs: true, amd: false }], "import/no-duplicates": ["error"], "import/no-named-default": ["error"], "import/no-webpack-loader-syntax": ["error"], "n/handle-callback-err": ["error", "^(err|error)$"], "n/no-callback-literal": ["error"], "n/no-deprecated-api": ["error"], "n/no-exports-assign": ["error"], "n/no-new-require": ["error"], "n/no-path-concat": ["error"], "n/process-exit-as-throw": ["error"], "promise/param-names": ["error"], "@typescript-eslint/adjacent-overload-signatures": ["error"], "@typescript-eslint/array-type": ["error", { default: "array-simple" }], "@typescript-eslint/await-thenable": ["error"], "@typescript-eslint/ban-ts-comment": ["error", { "ts-expect-error": "allow-with-description", "ts-ignore": true, "ts-nocheck": true, "ts-check": false, minimumDescriptionLength: 3 }], "@typescript-eslint/ban-tslint-comment": ["error"], "@typescript-eslint/class-literal-property-style": ["error", "fields"], "@typescript-eslint/class-methods-use-this": ["error", { exceptMethods: [], enforceForClassFields: true, ignoreOverrideMethods: false, ignoreClassesThatImplementAnInterface: false }], "@typescript-eslint/consistent-generic-constructors": ["error", "constructor"], "@typescript-eslint/consistent-indexed-object-style": ["error", "record"], "@typescript-eslint/consistent-type-assertions": ["error", { assertionStyle: "as", objectLiteralTypeAssertions: "never" }], "@typescript-eslint/consistent-type-definitions": ["error", "interface"], "@typescript-eslint/consistent-type-exports": ["error", { fixMixedExportsWithInlineTypeSpecifier: true }], "@typescript-eslint/consistent-type-imports": ["error", { prefer: "type-imports", disallowTypeAnnotations: true, fixStyle: "inline-type-imports" }], "@typescript-eslint/dot-notation": ["error", { allowIndexSignaturePropertyAccess: false, allowKeywords: true, allowPattern: "", allowPrivateClassPropertyAccess: false, allowProtectedClassPropertyAccess: false }], "@typescript-eslint/explicit-function-return-type": ["error", { allowExpressions: true, allowHigherOrderFunctions: true, allowTypedFunctionExpressions: true, allowDirectConstAssertionInArrowFunctions: true }], "@typescript-eslint/init-declarations": ["error", "always"], "@typescript-eslint/max-params": ["error", { max: 4 }], "@typescript-eslint/method-signature-style": ["error"], "@typescript-eslint/naming-convention": ["error", { selector: "variableLike", leadingUnderscore: "allow", trailingUnderscore: "allow", format: ["camelCase", "PascalCase", "UPPER_CASE"] }], "@typescript-eslint/no-array-constructor": ["error"], "@typescript-eslint/no-array-delete": ["error"], "@typescript-eslint/no-base-to-string": ["error"], "@typescript-eslint/no-confusing-non-null-assertion": ["error"], "@typescript-eslint/no-confusing-void-expression": ["error", { ignoreArrowShorthand: false, ignoreVoidOperator: false }], "@typescript-eslint/no-deprecated": ["warn"], "@typescript-eslint/no-dupe-class-members": ["error"], "@typescript-eslint/no-duplicate-enum-values": ["error"], "@typescript-eslint/no-duplicate-type-constituents": ["error", { ignoreIntersections: false, ignoreUnions: false }], "@typescript-eslint/no-dynamic-delete": ["error"], "@typescript-eslint/no-empty-function": ["error", { allow: [] }], "@typescript-eslint/no-empty-object-type": ["error", { allowInterfaces: "with-single-extends", allowObjectTypes: "never" }], "@typescript-eslint/no-explicit-any": ["error", { fixToUnknown: false, ignoreRestArgs: false }], "@typescript-eslint/no-extra-non-null-assertion": ["error"], "@typescript-eslint/no-extraneous-class": ["error", { allowWithDecorator: true }], "@typescript-eslint/no-floating-promises": ["error"], "@typescript-eslint/no-for-in-array": ["error"], "@typescript-eslint/no-implied-eval": ["error"], "@typescript-eslint/no-import-type-side-effects": ["error"], "@typescript-eslint/no-inferrable-types": ["error", { ignoreParameters: false, ignoreProperties: false }], "@typescript-eslint/no-invalid-void-type": ["error"], "@typescript-eslint/no-loop-func": ["error"], "@typescript-eslint/no-magic-numbers": ["error", { ignore: [], ignoreArrayIndexes: false, ignoreDefaultValues: false, ignoreClassFieldInitialValues: false, enforceConst: false, detectObjects: true, ignoreEnums: true, ignoreNumericLiteralTypes: false, ignoreReadonlyClassProperties: true, ignoreTypeIndexes: false }], "@typescript-eslint/no-meaningless-void-operator": ["error", { checkNever: true }], "@typescript-eslint/no-misused-new": ["error"], "@typescript-eslint/no-misused-promises": ["error"], "@typescript-eslint/no-mixed-enums": ["error"], "@typescript-eslint/no-namespace": ["error"], "@typescript-eslint/no-non-null-asserted-nullish-coalescing": ["error"], "@typescript-eslint/no-non-null-asserted-optional-chain": ["error"], "@typescript-eslint/no-non-null-assertion": ["error"], "@typescript-eslint/no-redundant-type-constituents": ["error"], "@typescript-eslint/no-require-imports": ["error", { allow: [], allowAsImport: false }], "@typescript-eslint/no-this-alias": ["error", { allowDestructuring: true }], "@typescript-eslint/no-unnecessary-boolean-literal-compare": ["error"], "@typescript-eslint/no-unnecessary-condition": ["error", { allowConstantLoopConditions: true }], "@typescript-eslint/no-unnecessary-parameter-property-assignment": ["error"], "@typescript-eslint/no-unnecessary-qualifier": ["error"], "@typescript-eslint/no-unnecessary-template-expression": ["error"], "@typescript-eslint/no-unnecessary-type-arguments": ["error"], "@typescript-eslint/no-unnecessary-type-assertion": ["error"], "@typescript-eslint/no-unnecessary-type-constraint": ["error"], "@typescript-eslint/no-unnecessary-type-parameters": ["error"], "@typescript-eslint/no-unsafe-argument": ["error"], "@typescript-eslint/no-unsafe-assignment": ["error"], "@typescript-eslint/no-unsafe-call": ["error"], "@typescript-eslint/no-unsafe-declaration-merging": ["error"], "@typescript-eslint/no-unsafe-enum-comparison": ["error"], "@typescript-eslint/no-unsafe-function-type": ["error"], "@typescript-eslint/no-unsafe-member-access": ["error"], "@typescript-eslint/no-unsafe-return": ["error"], "@typescript-eslint/no-unsafe-unary-minus": ["error"], "@typescript-eslint/no-unused-expressions": ["error", { allowShortCircuit: true, allowTernary: true, allowTaggedTemplates: true, enforceForJSX: false }], "@typescript-eslint/no-unused-vars": ["error", { args: "none", caughtErrors: "none", ignoreRestSiblings: true, vars: "all" }], "@typescript-eslint/no-use-before-define": ["error", { functions: false, classes: false, enums: false, variables: false, typedefs: false }], "@typescript-eslint/no-useless-constructor": ["error"], "@typescript-eslint/no-useless-empty-export": ["error"], "@typescript-eslint/no-wrapper-object-types": ["error"], "@typescript-eslint/non-nullable-type-assertion-style": ["error"], "@typescript-eslint/only-throw-error": ["error", { allowThrowingAny: false, allowThrowingUnknown: false }], "@typescript-eslint/prefer-as-const": ["error"], "@typescript-eslint/prefer-destructuring": ["error", { array: true, object: true }, { enforceForRenamedProperties: true, enforceForDeclarationWithTypeAnnotation: false }], "@typescript-eslint/prefer-function-type": ["error"], "@typescript-eslint/prefer-includes": ["error"], "@typescript-eslint/prefer-nullish-coalescing": ["error", { ignoreConditionalTests: false, ignoreMixedLogicalExpressions: false }], "@typescript-eslint/prefer-optional-chain": ["error"], "@typescript-eslint/prefer-promise-reject-errors": ["error"], "@typescript-eslint/prefer-readonly": ["error"], "@typescript-eslint/prefer-reduce-type-parameter": ["error"], "@typescript-eslint/prefer-return-this-type": ["error"], "@typescript-eslint/promise-function-async": ["error"], "@typescript-eslint/require-array-sort-compare": ["error", { ignoreStringArrays: true }], "@typescript-eslint/restrict-plus-operands": ["error", { skipCompoundAssignments: false }], "@typescript-eslint/restrict-template-expressions": ["error", { allowNumber: true }], "@typescript-eslint/return-await": ["error", "always"], "@typescript-eslint/strict-boolean-expressions": ["error", { allowString: false, allowNumber: false, allowNullableObject: false, allowNullableBoolean: false, allowNullableString: false, allowNullableNumber: false, allowAny: false }], "@typescript-eslint/triple-slash-reference": ["error", { lib: "never", path: "never", types: "never" }], "@typescript-eslint/unbound-method": ["error", { ignoreStatic: false }] };
@@ -50,9 +50,9 @@ var define_STANDARD_RULES_default = { "class-methods-use-this": ["off"], "dot-no
50
50
  var import_node_assert = __toESM(require("assert"));
51
51
  var import_node_url = require("url");
52
52
  var import_node_path3 = __toESM(require("path"));
53
- var import_eslint_utils3 = require("@agilebot/eslint-utils");
54
53
  var parserTs = __toESM(require("@typescript-eslint/parser"));
55
54
  var parserVue = __toESM(require("vue-eslint-parser"));
55
+ var import_eslint_utils3 = require("@agilebot/eslint-utils");
56
56
 
57
57
  // src/configs/env.ts
58
58
  var import_globals = __toESM(require("globals"));
@@ -234,11 +234,11 @@ function standardDisabled() {
234
234
  }
235
235
 
236
236
  // src/configs/ts.ts
237
- var import_eslint_utils = require("@agilebot/eslint-utils");
238
237
  var pluginTs2 = __toESM(require("@typescript-eslint/eslint-plugin"));
239
238
  var import_eslint_plugin2 = __toESM(require("@stylistic/eslint-plugin"));
240
239
  var import_eslint_plugin_prefer_arrow_functions = __toESM(require("eslint-plugin-prefer-arrow-functions"));
241
240
  var import_eslint_plugin_unused_imports = __toESM(require("eslint-plugin-unused-imports"));
241
+ var import_eslint_utils = require("@agilebot/eslint-utils");
242
242
  function ts() {
243
243
  return {
244
244
  name: "agilebot/ts",
@@ -378,14 +378,14 @@ function dts() {
378
378
  // src/configs/imports.ts
379
379
  var import_node_path = __toESM(require("path"));
380
380
  var import_node_fs = __toESM(require("fs"));
381
- var import_eslint_utils2 = require("@agilebot/eslint-utils");
382
381
  var import_eslint_plugin_import_x2 = __toESM(require("eslint-plugin-import-x"));
383
382
  var import_eslint_plugin_no_relative_import_paths = __toESM(require("eslint-plugin-no-relative-import-paths"));
384
- function imports(opts) {
383
+ var import_eslint_utils2 = require("@agilebot/eslint-utils");
384
+ function imports(packageDir, opts) {
385
385
  const rootDir = (0, import_eslint_utils2.findRootDir)(__dirname);
386
- const pkgPath = import_node_path.default.join(opts.packageDir, "package.json");
386
+ const pkgPath = import_node_path.default.join(packageDir, "package.json");
387
387
  if (!import_node_fs.default.existsSync(pkgPath)) {
388
- throw new Error(`package.json not found in ${opts.packageDir}`);
388
+ throw new Error(`package.json not found in ${packageDir}`);
389
389
  }
390
390
  const pkg = JSON.parse(import_node_fs.default.readFileSync(pkgPath, "utf8"));
391
391
  const tmpPkg = {
@@ -439,10 +439,10 @@ function imports(opts) {
439
439
  allowObject: true
440
440
  }
441
441
  ],
442
- "import-x/no-extraneous-dependencies": [
442
+ "import-x/no-extraneous-dependencies": opts.allowExtraneousDependencies ? "off" : [
443
443
  "error",
444
444
  {
445
- packageDir: [opts.packageDir, tmpPkgDir, rootDir],
445
+ packageDir: [packageDir, tmpPkgDir, rootDir],
446
446
  devDependencies: [
447
447
  "test/**/*",
448
448
  "tests/**/*",
@@ -476,14 +476,11 @@ function imports(opts) {
476
476
  position: "after"
477
477
  }
478
478
  ],
479
- "newlines-between": "never",
479
+ "newlines-between": "always",
480
480
  distinctGroup: false
481
481
  }
482
482
  ],
483
- "no-relative-import-paths/no-relative-import-paths": [
484
- "warn",
485
- { allowSameFolder: true }
486
- ]
483
+ "no-relative-import-paths/no-relative-import-paths": opts.allowRelativePaths ? "off" : ["warn", { allowSameFolder: true }]
487
484
  },
488
485
  settings: {
489
486
  "import-x/parsers": {
@@ -567,8 +564,6 @@ function react(opts) {
567
564
  },
568
565
  rules: {
569
566
  ...import_eslint_plugin_jsx_a11y.default.flatConfigs.recommended.rules,
570
- // recommended rules from eslint-plugin-react
571
- "react/no-is-mounted": "error",
572
567
  // recommended rules from @eslint-react
573
568
  "@eslint-react/no-direct-mutation-state": "error",
574
569
  // Children API
@@ -625,6 +620,7 @@ function react(opts) {
625
620
  "react-hooks/rules-of-hooks": "error",
626
621
  // recommended rules from @eslint-react/naming-convention
627
622
  "@eslint-react/naming-convention/component-name": "error",
623
+ "@eslint-react/naming-convention/context-name": "error",
628
624
  "@eslint-react/naming-convention/use-state": "error",
629
625
  // recommended rules from @eslint-react/web-api
630
626
  "@eslint-react/web-api/no-leaked-interval": "warn",
@@ -725,7 +721,7 @@ function jsdoc(opt) {
725
721
  // src/configs/lodash.ts
726
722
  var import_eslint_plugin_you_dont_need_lodash_underscore = __toESM(require("eslint-plugin-you-dont-need-lodash-underscore"));
727
723
 
728
- // ../../node_modules/.pnpm/@eslint+compat@1.2.3_eslint@9.15.0_jiti@2.3.3_/node_modules/@eslint/compat/dist/esm/index.js
724
+ // ../../node_modules/.pnpm/@eslint+compat@1.2.7_eslint@9.21.0_jiti@2.4.2_/node_modules/@eslint/compat/dist/esm/index.js
729
725
  var import_node_fs2 = __toESM(require("fs"), 1);
730
726
  var import_node_path2 = __toESM(require("path"), 1);
731
727
  var removedMethodNames = /* @__PURE__ */ new Map([
@@ -917,8 +913,8 @@ function cspell(opts) {
917
913
  }
918
914
 
919
915
  // src/configs/agilebot.ts
920
- var import_eslint_plugin7 = __toESM(require("@agilebot/eslint-plugin"));
921
916
  var import_eslint_plugin_react_hooks2 = __toESM(require("eslint-plugin-react-hooks"));
917
+ var import_eslint_plugin7 = __toESM(require("@agilebot/eslint-plugin"));
922
918
  function agilebot(opts) {
923
919
  return {
924
920
  name: "agilebot/agilebot",
@@ -942,7 +938,21 @@ function agilebot(opts) {
942
938
  // src/configs/prettier.ts
943
939
  var import_recommended = __toESM(require("eslint-plugin-prettier/recommended"));
944
940
  var import_eslint_plugin_prettier = __toESM(require("eslint-plugin-prettier"));
945
- function prettier() {
941
+
942
+ // ../prettier-config/dist/index.mjs
943
+ var config = {
944
+ tabWidth: 2,
945
+ singleQuote: true,
946
+ trailingComma: "none",
947
+ bracketSpacing: true,
948
+ bracketSameLine: true,
949
+ useTabs: false,
950
+ arrowParens: "avoid"
951
+ };
952
+ var index_default = config;
953
+
954
+ // src/configs/prettier.ts
955
+ function prettier(opts) {
946
956
  return {
947
957
  name: "agilebot/prettier",
948
958
  files: DEFAULT_GLOBS,
@@ -958,7 +968,12 @@ function prettier() {
958
968
  "prettier/prettier": [
959
969
  "error",
960
970
  {
961
- endOfLine: "auto"
971
+ endOfLine: "auto",
972
+ ...index_default,
973
+ ...opts
974
+ },
975
+ {
976
+ usePrettierrc: !opts
962
977
  }
963
978
  ]
964
979
  }
@@ -1029,8 +1044,7 @@ function factory(root, options) {
1029
1044
  prettier: true,
1030
1045
  lodash: true,
1031
1046
  cspell: {},
1032
- import: true,
1033
- importResolver: "typescript"
1047
+ import: true
1034
1048
  };
1035
1049
  options = {
1036
1050
  ...defaultOptions,
@@ -1052,21 +1066,19 @@ function factory(root, options) {
1052
1066
  ];
1053
1067
  if (options.import) {
1054
1068
  commonConfigs.push(
1055
- imports({
1056
- packageDir: rootDir,
1057
- devDependencies: options.devDependencies,
1058
- monorepoScope: options.monorepoScope,
1059
- coreModules: options.coreModules,
1060
- resolver: options.importResolver
1061
- })
1069
+ imports(rootDir, typeof options.import === "object" ? options.import : {})
1062
1070
  );
1063
1071
  }
1064
1072
  if (options.prettier) {
1065
- commonConfigs.push(prettier());
1073
+ commonConfigs.push(
1074
+ prettier(
1075
+ typeof options.prettier === "object" ? options.prettier : void 0
1076
+ )
1077
+ );
1066
1078
  }
1067
- const config = [];
1079
+ const config2 = [];
1068
1080
  if (options.godaddy) {
1069
- config.push({
1081
+ config2.push({
1070
1082
  name: "agilebot/parser",
1071
1083
  files: DEFAULT_GLOBS,
1072
1084
  languageOptions: {
@@ -1076,18 +1088,18 @@ function factory(root, options) {
1076
1088
  }
1077
1089
  }
1078
1090
  });
1079
- config.push(env());
1091
+ config2.push(env());
1080
1092
  if (options.jsdoc) {
1081
- config.push(
1093
+ config2.push(
1082
1094
  jsdoc({
1083
1095
  ts: false
1084
1096
  })
1085
1097
  );
1086
1098
  }
1087
- config.push(...commonConfigs);
1088
- config.push(godaddy());
1099
+ config2.push(...commonConfigs);
1100
+ config2.push(godaddy());
1089
1101
  } else {
1090
- config.push({
1102
+ config2.push({
1091
1103
  name: "agilebot/parser",
1092
1104
  files: DEFAULT_GLOBS,
1093
1105
  languageOptions: {
@@ -1105,77 +1117,85 @@ function factory(root, options) {
1105
1117
  }
1106
1118
  }
1107
1119
  });
1108
- config.push(env());
1109
- config.push(standard());
1110
- config.push(ts());
1111
- config.push(jsOnly());
1112
- config.push(dts());
1113
- config.push(tsOnly());
1120
+ config2.push(env());
1121
+ config2.push(standard());
1122
+ config2.push(ts());
1123
+ config2.push(jsOnly());
1124
+ config2.push(dts());
1125
+ config2.push(tsOnly());
1114
1126
  if (options.react) {
1115
- config.push(react({ version: options.react }));
1116
- config.push(reactJsOnly());
1127
+ config2.push(react({ version: options.react }));
1128
+ config2.push(reactJsOnly());
1117
1129
  }
1118
1130
  if (options.vue) {
1119
- config.push(
1131
+ config2.push(
1120
1132
  vue({
1121
1133
  version: options.vue
1122
1134
  })
1123
1135
  );
1124
1136
  }
1125
1137
  if (options.lodash) {
1126
- config.push(lodash());
1138
+ config2.push(lodash());
1127
1139
  }
1128
1140
  if (options.cspell) {
1129
- config.push(cspell(options.cspell));
1141
+ config2.push(cspell(options.cspell));
1130
1142
  }
1131
1143
  if (options.jsdoc) {
1132
- config.push({
1144
+ config2.push({
1133
1145
  ...jsdoc({
1134
1146
  ts: true
1135
1147
  }),
1136
1148
  files: TS_GLOBS
1137
1149
  });
1138
- config.push({
1150
+ config2.push({
1139
1151
  ...jsdoc({
1140
1152
  ts: false
1141
1153
  }),
1142
1154
  files: JS_GLOBS
1143
1155
  });
1144
1156
  }
1145
- config.push(...commonConfigs);
1146
- config.push(
1157
+ config2.push(...commonConfigs);
1158
+ config2.push(
1147
1159
  agilebot({
1148
1160
  root: rootDir,
1149
- monorepoScope: options.monorepoScope
1161
+ monorepoScope: typeof options.import === "object" ? options.import?.monorepoScope : void 0
1150
1162
  })
1151
1163
  );
1152
1164
  }
1153
1165
  if (options.config) {
1154
- config.push({
1166
+ config2.push({
1155
1167
  name: "agilebot/custom",
1156
1168
  files: DEFAULT_GLOBS,
1157
1169
  ...options.config
1158
1170
  });
1159
1171
  }
1160
- config.push({
1172
+ config2.push({
1161
1173
  name: "agilebot/ignores",
1162
1174
  ignores: [...IGNORE_GLOBS, ...options.ignores ?? []]
1163
1175
  });
1164
1176
  const allPlugins = {};
1165
- config.forEach((configItem) => {
1177
+ config2.forEach((configItem) => {
1166
1178
  if (configItem.plugins) {
1167
1179
  Object.assign(allPlugins, configItem.plugins);
1168
1180
  delete configItem.plugins;
1169
1181
  }
1170
1182
  });
1171
- config.unshift({
1183
+ config2.unshift({
1172
1184
  name: "agilebot/plugins",
1173
1185
  files: DEFAULT_GLOBS,
1174
1186
  plugins: allPlugins
1175
1187
  });
1176
- return config;
1188
+ return config2;
1177
1189
  }
1178
1190
  // Annotate the CommonJS export names for ESM import in node:
1179
1191
  0 && (module.exports = {
1180
1192
  agilebot
1181
1193
  });
1194
+ /**
1195
+ * @license @agilebot/prettier-config v0.8.0
1196
+ *
1197
+ * Copyright (c) Agilebot, Inc. and its affiliates.
1198
+ *
1199
+ * This source code is licensed under the MIT license found in the
1200
+ * LICENSE file in the root directory of this source tree.
1201
+ */
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @agilebot/eslint-config v0.7.3
2
+ * @license @agilebot/eslint-config v0.8.0
3
3
  *
4
4
  * Copyright (c) Agilebot, Inc. and its affiliates.
5
5
  *
@@ -16,15 +16,15 @@ import {
16
16
  VUE_GLOBS,
17
17
  __dirname,
18
18
  define_STANDARD_RULES_default
19
- } from "./chunk-CGJVNMKG.mjs";
19
+ } from "./chunk-NVFPC5RO.mjs";
20
20
 
21
21
  // src/factory/index.ts
22
22
  import assert from "node:assert";
23
23
  import { fileURLToPath } from "node:url";
24
24
  import path2 from "node:path";
25
- import { findTsconfigFiles } from "@agilebot/eslint-utils";
26
25
  import * as parserTs from "@typescript-eslint/parser";
27
26
  import * as parserVue from "vue-eslint-parser";
27
+ import { findTsconfigFiles } from "@agilebot/eslint-utils";
28
28
 
29
29
  // src/configs/env.ts
30
30
  import globals from "globals";
@@ -159,11 +159,11 @@ function standardDisabled() {
159
159
  }
160
160
 
161
161
  // src/configs/ts.ts
162
- import { isInEditor } from "@agilebot/eslint-utils";
163
162
  import * as pluginTs2 from "@typescript-eslint/eslint-plugin";
164
163
  import pluginStylistic from "@stylistic/eslint-plugin";
165
164
  import pluginPreferArrowFunctions from "eslint-plugin-prefer-arrow-functions";
166
165
  import pluginUnusedImports from "eslint-plugin-unused-imports";
166
+ import { isInEditor } from "@agilebot/eslint-utils";
167
167
  function ts() {
168
168
  return {
169
169
  name: "agilebot/ts",
@@ -303,14 +303,14 @@ function dts() {
303
303
  // src/configs/imports.ts
304
304
  import path from "node:path";
305
305
  import fs from "node:fs";
306
- import { findCacheDir, findRootDir, isInEditor as isInEditor2 } from "@agilebot/eslint-utils";
307
306
  import pluginImport2 from "eslint-plugin-import-x";
308
307
  import pluginNoRelativeImportPaths from "eslint-plugin-no-relative-import-paths";
309
- function imports(opts) {
308
+ import { findCacheDir, findRootDir, isInEditor as isInEditor2 } from "@agilebot/eslint-utils";
309
+ function imports(packageDir, opts) {
310
310
  const rootDir = findRootDir(__dirname);
311
- const pkgPath = path.join(opts.packageDir, "package.json");
311
+ const pkgPath = path.join(packageDir, "package.json");
312
312
  if (!fs.existsSync(pkgPath)) {
313
- throw new Error(`package.json not found in ${opts.packageDir}`);
313
+ throw new Error(`package.json not found in ${packageDir}`);
314
314
  }
315
315
  const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
316
316
  const tmpPkg = {
@@ -364,10 +364,10 @@ function imports(opts) {
364
364
  allowObject: true
365
365
  }
366
366
  ],
367
- "import-x/no-extraneous-dependencies": [
367
+ "import-x/no-extraneous-dependencies": opts.allowExtraneousDependencies ? "off" : [
368
368
  "error",
369
369
  {
370
- packageDir: [opts.packageDir, tmpPkgDir, rootDir],
370
+ packageDir: [packageDir, tmpPkgDir, rootDir],
371
371
  devDependencies: [
372
372
  "test/**/*",
373
373
  "tests/**/*",
@@ -401,14 +401,11 @@ function imports(opts) {
401
401
  position: "after"
402
402
  }
403
403
  ],
404
- "newlines-between": "never",
404
+ "newlines-between": "always",
405
405
  distinctGroup: false
406
406
  }
407
407
  ],
408
- "no-relative-import-paths/no-relative-import-paths": [
409
- "warn",
410
- { allowSameFolder: true }
411
- ]
408
+ "no-relative-import-paths/no-relative-import-paths": opts.allowRelativePaths ? "off" : ["warn", { allowSameFolder: true }]
412
409
  },
413
410
  settings: {
414
411
  "import-x/parsers": {
@@ -492,8 +489,6 @@ function react(opts) {
492
489
  },
493
490
  rules: {
494
491
  ...pluginJsxA11y.flatConfigs.recommended.rules,
495
- // recommended rules from eslint-plugin-react
496
- "react/no-is-mounted": "error",
497
492
  // recommended rules from @eslint-react
498
493
  "@eslint-react/no-direct-mutation-state": "error",
499
494
  // Children API
@@ -550,6 +545,7 @@ function react(opts) {
550
545
  "react-hooks/rules-of-hooks": "error",
551
546
  // recommended rules from @eslint-react/naming-convention
552
547
  "@eslint-react/naming-convention/component-name": "error",
548
+ "@eslint-react/naming-convention/context-name": "error",
553
549
  "@eslint-react/naming-convention/use-state": "error",
554
550
  // recommended rules from @eslint-react/web-api
555
551
  "@eslint-react/web-api/no-leaked-interval": "warn",
@@ -650,7 +646,7 @@ function jsdoc(opt) {
650
646
  // src/configs/lodash.ts
651
647
  import pluginLodash from "eslint-plugin-you-dont-need-lodash-underscore";
652
648
 
653
- // ../../node_modules/.pnpm/@eslint+compat@1.2.3_eslint@9.15.0_jiti@2.3.3_/node_modules/@eslint/compat/dist/esm/index.js
649
+ // ../../node_modules/.pnpm/@eslint+compat@1.2.7_eslint@9.21.0_jiti@2.4.2_/node_modules/@eslint/compat/dist/esm/index.js
654
650
  var removedMethodNames = /* @__PURE__ */ new Map([
655
651
  ["getSource", "getText"],
656
652
  ["getSourceLines", "getLines"],
@@ -840,8 +836,8 @@ function cspell(opts) {
840
836
  }
841
837
 
842
838
  // src/configs/agilebot.ts
843
- import pluginAgilebot2 from "@agilebot/eslint-plugin";
844
839
  import pluginReactHooks2 from "eslint-plugin-react-hooks";
840
+ import pluginAgilebot2 from "@agilebot/eslint-plugin";
845
841
  function agilebot(opts) {
846
842
  return {
847
843
  name: "agilebot/agilebot",
@@ -865,7 +861,21 @@ function agilebot(opts) {
865
861
  // src/configs/prettier.ts
866
862
  import prettierRecommended from "eslint-plugin-prettier/recommended";
867
863
  import pluginPrettier from "eslint-plugin-prettier";
868
- function prettier() {
864
+
865
+ // ../prettier-config/dist/index.mjs
866
+ var config = {
867
+ tabWidth: 2,
868
+ singleQuote: true,
869
+ trailingComma: "none",
870
+ bracketSpacing: true,
871
+ bracketSameLine: true,
872
+ useTabs: false,
873
+ arrowParens: "avoid"
874
+ };
875
+ var index_default = config;
876
+
877
+ // src/configs/prettier.ts
878
+ function prettier(opts) {
869
879
  return {
870
880
  name: "agilebot/prettier",
871
881
  files: DEFAULT_GLOBS,
@@ -881,7 +891,12 @@ function prettier() {
881
891
  "prettier/prettier": [
882
892
  "error",
883
893
  {
884
- endOfLine: "auto"
894
+ endOfLine: "auto",
895
+ ...index_default,
896
+ ...opts
897
+ },
898
+ {
899
+ usePrettierrc: !opts
885
900
  }
886
901
  ]
887
902
  }
@@ -952,8 +967,7 @@ function factory(root, options) {
952
967
  prettier: true,
953
968
  lodash: true,
954
969
  cspell: {},
955
- import: true,
956
- importResolver: "typescript"
970
+ import: true
957
971
  };
958
972
  options = {
959
973
  ...defaultOptions,
@@ -975,21 +989,19 @@ function factory(root, options) {
975
989
  ];
976
990
  if (options.import) {
977
991
  commonConfigs.push(
978
- imports({
979
- packageDir: rootDir,
980
- devDependencies: options.devDependencies,
981
- monorepoScope: options.monorepoScope,
982
- coreModules: options.coreModules,
983
- resolver: options.importResolver
984
- })
992
+ imports(rootDir, typeof options.import === "object" ? options.import : {})
985
993
  );
986
994
  }
987
995
  if (options.prettier) {
988
- commonConfigs.push(prettier());
996
+ commonConfigs.push(
997
+ prettier(
998
+ typeof options.prettier === "object" ? options.prettier : void 0
999
+ )
1000
+ );
989
1001
  }
990
- const config = [];
1002
+ const config2 = [];
991
1003
  if (options.godaddy) {
992
- config.push({
1004
+ config2.push({
993
1005
  name: "agilebot/parser",
994
1006
  files: DEFAULT_GLOBS,
995
1007
  languageOptions: {
@@ -999,18 +1011,18 @@ function factory(root, options) {
999
1011
  }
1000
1012
  }
1001
1013
  });
1002
- config.push(env());
1014
+ config2.push(env());
1003
1015
  if (options.jsdoc) {
1004
- config.push(
1016
+ config2.push(
1005
1017
  jsdoc({
1006
1018
  ts: false
1007
1019
  })
1008
1020
  );
1009
1021
  }
1010
- config.push(...commonConfigs);
1011
- config.push(godaddy());
1022
+ config2.push(...commonConfigs);
1023
+ config2.push(godaddy());
1012
1024
  } else {
1013
- config.push({
1025
+ config2.push({
1014
1026
  name: "agilebot/parser",
1015
1027
  files: DEFAULT_GLOBS,
1016
1028
  languageOptions: {
@@ -1028,76 +1040,84 @@ function factory(root, options) {
1028
1040
  }
1029
1041
  }
1030
1042
  });
1031
- config.push(env());
1032
- config.push(standard());
1033
- config.push(ts());
1034
- config.push(jsOnly());
1035
- config.push(dts());
1036
- config.push(tsOnly());
1043
+ config2.push(env());
1044
+ config2.push(standard());
1045
+ config2.push(ts());
1046
+ config2.push(jsOnly());
1047
+ config2.push(dts());
1048
+ config2.push(tsOnly());
1037
1049
  if (options.react) {
1038
- config.push(react({ version: options.react }));
1039
- config.push(reactJsOnly());
1050
+ config2.push(react({ version: options.react }));
1051
+ config2.push(reactJsOnly());
1040
1052
  }
1041
1053
  if (options.vue) {
1042
- config.push(
1054
+ config2.push(
1043
1055
  vue({
1044
1056
  version: options.vue
1045
1057
  })
1046
1058
  );
1047
1059
  }
1048
1060
  if (options.lodash) {
1049
- config.push(lodash());
1061
+ config2.push(lodash());
1050
1062
  }
1051
1063
  if (options.cspell) {
1052
- config.push(cspell(options.cspell));
1064
+ config2.push(cspell(options.cspell));
1053
1065
  }
1054
1066
  if (options.jsdoc) {
1055
- config.push({
1067
+ config2.push({
1056
1068
  ...jsdoc({
1057
1069
  ts: true
1058
1070
  }),
1059
1071
  files: TS_GLOBS
1060
1072
  });
1061
- config.push({
1073
+ config2.push({
1062
1074
  ...jsdoc({
1063
1075
  ts: false
1064
1076
  }),
1065
1077
  files: JS_GLOBS
1066
1078
  });
1067
1079
  }
1068
- config.push(...commonConfigs);
1069
- config.push(
1080
+ config2.push(...commonConfigs);
1081
+ config2.push(
1070
1082
  agilebot({
1071
1083
  root: rootDir,
1072
- monorepoScope: options.monorepoScope
1084
+ monorepoScope: typeof options.import === "object" ? options.import?.monorepoScope : void 0
1073
1085
  })
1074
1086
  );
1075
1087
  }
1076
1088
  if (options.config) {
1077
- config.push({
1089
+ config2.push({
1078
1090
  name: "agilebot/custom",
1079
1091
  files: DEFAULT_GLOBS,
1080
1092
  ...options.config
1081
1093
  });
1082
1094
  }
1083
- config.push({
1095
+ config2.push({
1084
1096
  name: "agilebot/ignores",
1085
1097
  ignores: [...IGNORE_GLOBS, ...options.ignores ?? []]
1086
1098
  });
1087
1099
  const allPlugins = {};
1088
- config.forEach((configItem) => {
1100
+ config2.forEach((configItem) => {
1089
1101
  if (configItem.plugins) {
1090
1102
  Object.assign(allPlugins, configItem.plugins);
1091
1103
  delete configItem.plugins;
1092
1104
  }
1093
1105
  });
1094
- config.unshift({
1106
+ config2.unshift({
1095
1107
  name: "agilebot/plugins",
1096
1108
  files: DEFAULT_GLOBS,
1097
1109
  plugins: allPlugins
1098
1110
  });
1099
- return config;
1111
+ return config2;
1100
1112
  }
1101
1113
  export {
1102
1114
  factory as agilebot
1103
1115
  };
1116
+ /**
1117
+ * @license @agilebot/prettier-config v0.8.0
1118
+ *
1119
+ * Copyright (c) Agilebot, Inc. and its affiliates.
1120
+ *
1121
+ * This source code is licensed under the MIT license found in the
1122
+ * LICENSE file in the root directory of this source tree.
1123
+ */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agilebot/eslint-config",
3
- "version": "0.7.3",
3
+ "version": "0.8.0",
4
4
  "description": "Agilebot's ESLint config",
5
5
  "bin": {
6
6
  "eslint-agilebot": "bin/eslint-agilebot"
@@ -26,39 +26,39 @@
26
26
  },
27
27
  "homepage": "https://github.com/sh-agilebot/frontend-toolkit/tree/master/packages/eslint-config#readme",
28
28
  "dependencies": {
29
- "@cspell/eslint-plugin": "^8.16.0",
29
+ "@cspell/eslint-plugin": "^8.17.5",
30
30
  "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
31
- "@eslint-react/eslint-plugin": "^1.17.1",
32
- "@eslint/js": "^9.15.0",
33
- "@stylistic/eslint-plugin": "^2.11.0",
34
- "@typescript-eslint/eslint-plugin": "~8.15.0",
35
- "@typescript-eslint/parser": "~8.15.0",
31
+ "@eslint-react/eslint-plugin": "^1.29.0",
32
+ "@eslint/js": "^9.21.0",
33
+ "@stylistic/eslint-plugin": "^4.1.0",
34
+ "@typescript-eslint/eslint-plugin": "~8.25.0",
35
+ "@typescript-eslint/parser": "~8.25.0",
36
+ "ansis": "^3.17.0",
36
37
  "eslint-config-godaddy": "^6.0.0",
37
38
  "eslint-config-prettier": "^9.1.0",
38
- "eslint-import-resolver-oxc": "^0.4.0",
39
- "eslint-import-resolver-typescript": "^3.6.3",
40
- "eslint-plugin-file-progress": "^1.5.0",
41
- "eslint-plugin-import-x": "^4.4.3",
42
- "eslint-plugin-jsdoc": "^50.5.0",
39
+ "eslint-import-resolver-oxc": "^0.12.0",
40
+ "eslint-import-resolver-typescript": "^3.8.3",
41
+ "eslint-plugin-file-progress": "^3.0.1",
42
+ "eslint-plugin-import-x": "^4.6.1",
43
+ "eslint-plugin-jsdoc": "^50.6.3",
43
44
  "eslint-plugin-jsx-a11y": "^6.10.2",
44
45
  "eslint-plugin-mocha": "^10.5.0",
45
- "eslint-plugin-n": "^17.13.2",
46
- "eslint-plugin-no-relative-import-paths": "^1.5.5",
47
- "eslint-plugin-prefer-arrow-functions": "^3.4.1",
46
+ "eslint-plugin-n": "^17.16.1",
47
+ "eslint-plugin-no-relative-import-paths": "^1.6.1",
48
+ "eslint-plugin-prefer-arrow-functions": "^3.6.2",
48
49
  "eslint-plugin-prettier": "^5.2.1",
49
- "eslint-plugin-promise": "^7.1.0",
50
+ "eslint-plugin-promise": "^7.2.1",
50
51
  "eslint-plugin-react": "^7.37.2",
51
52
  "eslint-plugin-react-hooks": "^5.0.0",
52
53
  "eslint-plugin-unicorn": "^56.0.1",
53
54
  "eslint-plugin-unused-imports": "^4.1.4",
54
- "eslint-plugin-vue": "^9.31.0",
55
+ "eslint-plugin-vue": "^9.32.0",
55
56
  "eslint-plugin-you-dont-need-lodash-underscore": "^6.13.0",
56
57
  "find-up": "^5.0.0",
57
- "globals": "^15.12.0",
58
- "picocolors": "^1.1.0",
58
+ "globals": "^16.0.0",
59
59
  "vue-eslint-parser": "^9.4.3",
60
60
  "yargs": "^17.7.2",
61
- "@agilebot/eslint-utils": "0.7.3"
61
+ "@agilebot/eslint-utils": "0.8.0"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@types/yargs": "^17.0.33",
@@ -66,7 +66,7 @@
66
66
  },
67
67
  "peerDependencies": {
68
68
  "eslint": "^8.57.0 || ^9.0.0",
69
- "@agilebot/eslint-plugin": "0.7.3"
69
+ "@agilebot/eslint-plugin": "0.8.0"
70
70
  },
71
71
  "files": [
72
72
  "bin",
package/LICENSE.tpl DELETED
@@ -1,8 +0,0 @@
1
- /**
2
- * @license %(name)s v%(version)s
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
- */