@agilebot/eslint-config 0.7.4 → 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.
- package/dist/{chunk-F5MZBDNJ.mjs → chunk-NVFPC5RO.mjs} +2 -2
- package/dist/cli.js +5 -5
- package/dist/cli.mjs +6 -6
- package/dist/index.d.mts +32 -18
- package/dist/index.d.ts +32 -18
- package/dist/index.js +22 -33
- package/dist/index.mjs +20 -31
- package/package.json +19 -19
- package/LICENSE.tpl +0 -8
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license @agilebot/eslint-config v0.
|
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.
|
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.
|
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
|
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
|
-
|
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
|
-
|
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.
|
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-
|
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
|
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
|
-
|
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
|
-
|
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
@@ -10,32 +10,50 @@ interface FlatConfigItem extends Linter.Config {
|
|
10
10
|
|
11
11
|
type Options = Options$1['cspell'];
|
12
12
|
|
13
|
-
interface
|
13
|
+
interface ImportsOptions {
|
14
14
|
/**
|
15
|
-
*
|
15
|
+
* 额外的devDependencies
|
16
16
|
* @default undefined
|
17
17
|
*/
|
18
|
-
|
18
|
+
devDependencies?: string[];
|
19
19
|
/**
|
20
|
-
*
|
20
|
+
* monorepo前缀
|
21
21
|
* @default undefined
|
22
22
|
*/
|
23
|
-
|
23
|
+
monorepoScope?: string;
|
24
24
|
/**
|
25
|
-
*
|
26
|
-
* @default
|
25
|
+
* 核心模块
|
26
|
+
* @default undefiend
|
27
27
|
*/
|
28
|
-
|
28
|
+
coreModules?: string[];
|
29
|
+
/**
|
30
|
+
* 解析器
|
31
|
+
* @default 'typescript'
|
32
|
+
*/
|
33
|
+
resolver?: 'typescript' | 'oxc';
|
34
|
+
/**
|
35
|
+
* 是否允许相对路径
|
36
|
+
* @default false
|
37
|
+
*/
|
38
|
+
allowRelativePaths?: boolean;
|
29
39
|
/**
|
30
|
-
*
|
40
|
+
* 是否允许幽灵依赖
|
41
|
+
* @default false
|
42
|
+
*/
|
43
|
+
allowExtraneousDependencies?: boolean;
|
44
|
+
}
|
45
|
+
|
46
|
+
interface FactoryOptions {
|
47
|
+
/**
|
48
|
+
* Custom ESLint configuration to override or extend defaults
|
31
49
|
* @default undefined
|
32
50
|
*/
|
33
|
-
|
51
|
+
config?: Omit<FlatConfigItem, 'name' | 'files'>;
|
34
52
|
/**
|
35
|
-
*
|
53
|
+
* List of files to ignore
|
36
54
|
* @default undefined
|
37
55
|
*/
|
38
|
-
|
56
|
+
ignores?: string[];
|
39
57
|
/**
|
40
58
|
* Enable React-specific linting rules
|
41
59
|
* @default undefined
|
@@ -77,14 +95,10 @@ interface FactoryOptions {
|
|
77
95
|
*/
|
78
96
|
cspell?: Options | false;
|
79
97
|
/**
|
80
|
-
* Enable
|
98
|
+
* Enable or disable import linting rules
|
81
99
|
* @default true
|
82
100
|
*/
|
83
|
-
import?: boolean;
|
84
|
-
/**
|
85
|
-
* Flag indicating which import resolver to use
|
86
|
-
*/
|
87
|
-
importResolver?: 'typescript' | 'oxc';
|
101
|
+
import?: ImportsOptions | boolean;
|
88
102
|
}
|
89
103
|
|
90
104
|
declare function factory(root: string | ImportMeta, options?: FactoryOptions): FlatConfigItem[];
|
package/dist/index.d.ts
CHANGED
@@ -10,32 +10,50 @@ interface FlatConfigItem extends Linter.Config {
|
|
10
10
|
|
11
11
|
type Options = Options$1['cspell'];
|
12
12
|
|
13
|
-
interface
|
13
|
+
interface ImportsOptions {
|
14
14
|
/**
|
15
|
-
*
|
15
|
+
* 额外的devDependencies
|
16
16
|
* @default undefined
|
17
17
|
*/
|
18
|
-
|
18
|
+
devDependencies?: string[];
|
19
19
|
/**
|
20
|
-
*
|
20
|
+
* monorepo前缀
|
21
21
|
* @default undefined
|
22
22
|
*/
|
23
|
-
|
23
|
+
monorepoScope?: string;
|
24
24
|
/**
|
25
|
-
*
|
26
|
-
* @default
|
25
|
+
* 核心模块
|
26
|
+
* @default undefiend
|
27
27
|
*/
|
28
|
-
|
28
|
+
coreModules?: string[];
|
29
|
+
/**
|
30
|
+
* 解析器
|
31
|
+
* @default 'typescript'
|
32
|
+
*/
|
33
|
+
resolver?: 'typescript' | 'oxc';
|
34
|
+
/**
|
35
|
+
* 是否允许相对路径
|
36
|
+
* @default false
|
37
|
+
*/
|
38
|
+
allowRelativePaths?: boolean;
|
29
39
|
/**
|
30
|
-
*
|
40
|
+
* 是否允许幽灵依赖
|
41
|
+
* @default false
|
42
|
+
*/
|
43
|
+
allowExtraneousDependencies?: boolean;
|
44
|
+
}
|
45
|
+
|
46
|
+
interface FactoryOptions {
|
47
|
+
/**
|
48
|
+
* Custom ESLint configuration to override or extend defaults
|
31
49
|
* @default undefined
|
32
50
|
*/
|
33
|
-
|
51
|
+
config?: Omit<FlatConfigItem, 'name' | 'files'>;
|
34
52
|
/**
|
35
|
-
*
|
53
|
+
* List of files to ignore
|
36
54
|
* @default undefined
|
37
55
|
*/
|
38
|
-
|
56
|
+
ignores?: string[];
|
39
57
|
/**
|
40
58
|
* Enable React-specific linting rules
|
41
59
|
* @default undefined
|
@@ -77,14 +95,10 @@ interface FactoryOptions {
|
|
77
95
|
*/
|
78
96
|
cspell?: Options | false;
|
79
97
|
/**
|
80
|
-
* Enable
|
98
|
+
* Enable or disable import linting rules
|
81
99
|
* @default true
|
82
100
|
*/
|
83
|
-
import?: boolean;
|
84
|
-
/**
|
85
|
-
* Flag indicating which import resolver to use
|
86
|
-
*/
|
87
|
-
importResolver?: 'typescript' | 'oxc';
|
101
|
+
import?: ImportsOptions | boolean;
|
88
102
|
}
|
89
103
|
|
90
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.
|
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
|
41
|
-
__export(
|
40
|
+
var index_exports = {};
|
41
|
+
__export(index_exports, {
|
42
42
|
agilebot: () => factory
|
43
43
|
});
|
44
|
-
module.exports = __toCommonJS(
|
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
|
-
|
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(
|
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 ${
|
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: [
|
445
|
+
packageDir: [packageDir, tmpPkgDir, rootDir],
|
446
446
|
devDependencies: [
|
447
447
|
"test/**/*",
|
448
448
|
"tests/**/*",
|
@@ -480,10 +480,7 @@ function imports(opts) {
|
|
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.
|
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",
|
@@ -953,7 +949,7 @@ var config = {
|
|
953
949
|
useTabs: false,
|
954
950
|
arrowParens: "avoid"
|
955
951
|
};
|
956
|
-
var
|
952
|
+
var index_default = config;
|
957
953
|
|
958
954
|
// src/configs/prettier.ts
|
959
955
|
function prettier(opts) {
|
@@ -973,7 +969,7 @@ function prettier(opts) {
|
|
973
969
|
"error",
|
974
970
|
{
|
975
971
|
endOfLine: "auto",
|
976
|
-
...
|
972
|
+
...index_default,
|
977
973
|
...opts
|
978
974
|
},
|
979
975
|
{
|
@@ -1048,8 +1044,7 @@ function factory(root, options) {
|
|
1048
1044
|
prettier: true,
|
1049
1045
|
lodash: true,
|
1050
1046
|
cspell: {},
|
1051
|
-
import: true
|
1052
|
-
importResolver: "typescript"
|
1047
|
+
import: true
|
1053
1048
|
};
|
1054
1049
|
options = {
|
1055
1050
|
...defaultOptions,
|
@@ -1071,13 +1066,7 @@ function factory(root, options) {
|
|
1071
1066
|
];
|
1072
1067
|
if (options.import) {
|
1073
1068
|
commonConfigs.push(
|
1074
|
-
imports({
|
1075
|
-
packageDir: rootDir,
|
1076
|
-
devDependencies: options.devDependencies,
|
1077
|
-
monorepoScope: options.monorepoScope,
|
1078
|
-
coreModules: options.coreModules,
|
1079
|
-
resolver: options.importResolver
|
1080
|
-
})
|
1069
|
+
imports(rootDir, typeof options.import === "object" ? options.import : {})
|
1081
1070
|
);
|
1082
1071
|
}
|
1083
1072
|
if (options.prettier) {
|
@@ -1169,7 +1158,7 @@ function factory(root, options) {
|
|
1169
1158
|
config2.push(
|
1170
1159
|
agilebot({
|
1171
1160
|
root: rootDir,
|
1172
|
-
monorepoScope: options.monorepoScope
|
1161
|
+
monorepoScope: typeof options.import === "object" ? options.import?.monorepoScope : void 0
|
1173
1162
|
})
|
1174
1163
|
);
|
1175
1164
|
}
|
@@ -1203,7 +1192,7 @@ function factory(root, options) {
|
|
1203
1192
|
agilebot
|
1204
1193
|
});
|
1205
1194
|
/**
|
1206
|
-
* @license @agilebot/prettier-config v0.
|
1195
|
+
* @license @agilebot/prettier-config v0.8.0
|
1207
1196
|
*
|
1208
1197
|
* Copyright (c) Agilebot, Inc. and its affiliates.
|
1209
1198
|
*
|
package/dist/index.mjs
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license @agilebot/eslint-config v0.
|
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-
|
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
|
-
|
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(
|
311
|
+
const pkgPath = path.join(packageDir, "package.json");
|
312
312
|
if (!fs.existsSync(pkgPath)) {
|
313
|
-
throw new Error(`package.json not found in ${
|
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: [
|
370
|
+
packageDir: [packageDir, tmpPkgDir, rootDir],
|
371
371
|
devDependencies: [
|
372
372
|
"test/**/*",
|
373
373
|
"tests/**/*",
|
@@ -405,10 +405,7 @@ function imports(opts) {
|
|
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.
|
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",
|
@@ -876,7 +872,7 @@ var config = {
|
|
876
872
|
useTabs: false,
|
877
873
|
arrowParens: "avoid"
|
878
874
|
};
|
879
|
-
var
|
875
|
+
var index_default = config;
|
880
876
|
|
881
877
|
// src/configs/prettier.ts
|
882
878
|
function prettier(opts) {
|
@@ -896,7 +892,7 @@ function prettier(opts) {
|
|
896
892
|
"error",
|
897
893
|
{
|
898
894
|
endOfLine: "auto",
|
899
|
-
...
|
895
|
+
...index_default,
|
900
896
|
...opts
|
901
897
|
},
|
902
898
|
{
|
@@ -971,8 +967,7 @@ function factory(root, options) {
|
|
971
967
|
prettier: true,
|
972
968
|
lodash: true,
|
973
969
|
cspell: {},
|
974
|
-
import: true
|
975
|
-
importResolver: "typescript"
|
970
|
+
import: true
|
976
971
|
};
|
977
972
|
options = {
|
978
973
|
...defaultOptions,
|
@@ -994,13 +989,7 @@ function factory(root, options) {
|
|
994
989
|
];
|
995
990
|
if (options.import) {
|
996
991
|
commonConfigs.push(
|
997
|
-
imports({
|
998
|
-
packageDir: rootDir,
|
999
|
-
devDependencies: options.devDependencies,
|
1000
|
-
monorepoScope: options.monorepoScope,
|
1001
|
-
coreModules: options.coreModules,
|
1002
|
-
resolver: options.importResolver
|
1003
|
-
})
|
992
|
+
imports(rootDir, typeof options.import === "object" ? options.import : {})
|
1004
993
|
);
|
1005
994
|
}
|
1006
995
|
if (options.prettier) {
|
@@ -1092,7 +1081,7 @@ function factory(root, options) {
|
|
1092
1081
|
config2.push(
|
1093
1082
|
agilebot({
|
1094
1083
|
root: rootDir,
|
1095
|
-
monorepoScope: options.monorepoScope
|
1084
|
+
monorepoScope: typeof options.import === "object" ? options.import?.monorepoScope : void 0
|
1096
1085
|
})
|
1097
1086
|
);
|
1098
1087
|
}
|
@@ -1125,7 +1114,7 @@ export {
|
|
1125
1114
|
factory as agilebot
|
1126
1115
|
};
|
1127
1116
|
/**
|
1128
|
-
* @license @agilebot/prettier-config v0.
|
1117
|
+
* @license @agilebot/prettier-config v0.8.0
|
1129
1118
|
*
|
1130
1119
|
* Copyright (c) Agilebot, Inc. and its affiliates.
|
1131
1120
|
*
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@agilebot/eslint-config",
|
3
|
-
"version": "0.
|
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.
|
29
|
+
"@cspell/eslint-plugin": "^8.17.5",
|
30
30
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
|
31
|
-
"@eslint-react/eslint-plugin": "^1.
|
32
|
-
"@eslint/js": "^9.
|
33
|
-
"@stylistic/eslint-plugin": "^
|
31
|
+
"@eslint-react/eslint-plugin": "^1.29.0",
|
32
|
+
"@eslint/js": "^9.21.0",
|
33
|
+
"@stylistic/eslint-plugin": "^4.1.0",
|
34
34
|
"@typescript-eslint/eslint-plugin": "~8.25.0",
|
35
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.
|
39
|
-
"eslint-import-resolver-typescript": "^3.
|
40
|
-
"eslint-plugin-file-progress": "^
|
41
|
-
"eslint-plugin-import-x": "^4.
|
42
|
-
"eslint-plugin-jsdoc": "^50.
|
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.
|
46
|
-
"eslint-plugin-no-relative-import-paths": "^1.
|
47
|
-
"eslint-plugin-prefer-arrow-functions": "^3.
|
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
|
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.
|
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": "^
|
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.
|
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.
|
69
|
+
"@agilebot/eslint-plugin": "0.8.0"
|
70
70
|
},
|
71
71
|
"files": [
|
72
72
|
"bin",
|