@agilebot/eslint-config 0.7.2 → 0.7.3
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/README.md +95 -6
- package/dist/{chunk-R26PCKQR.mjs → chunk-CGJVNMKG.mjs} +1 -1
- package/dist/cli.js +13 -1
- package/dist/cli.mjs +14 -2
- package/dist/index.d.mts +13 -13
- package/dist/index.d.ts +13 -13
- package/dist/index.js +1 -1
- package/dist/index.mjs +2 -2
- package/package.json +3 -3
package/README.md
CHANGED
@@ -2,23 +2,31 @@
|
|
2
2
|
|
3
3
|
[](https://npmjs.com/package/@agilebot/eslint-config)
|
4
4
|
|
5
|
-
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
### Manual Install
|
6
8
|
|
7
9
|
```bash
|
8
10
|
npm install --save-dev eslint \
|
9
11
|
@agilebot/eslint-config
|
10
12
|
```
|
11
13
|
|
12
|
-
|
14
|
+
And create `eslint.config.mjs` in your project root:
|
13
15
|
|
14
16
|
```js
|
15
|
-
// eslint.config.
|
16
|
-
|
17
|
+
// eslint.config.mjs
|
18
|
+
import { agilebot } from '@agilebot/eslint-config';
|
17
19
|
|
18
|
-
|
20
|
+
export default agilebot(import.meta);
|
19
21
|
```
|
20
22
|
|
21
|
-
|
23
|
+
## Customization
|
24
|
+
|
25
|
+
The `agilebot` preset provides a streamlined way to configure your ESLint setup. Here’s how you can use it and customize it based on your needs.
|
26
|
+
|
27
|
+
### Basic Usage
|
28
|
+
|
29
|
+
To get started, import the `agilebot` preset:
|
22
30
|
|
23
31
|
```js
|
24
32
|
// eslint.config.mjs
|
@@ -26,3 +34,84 @@ import { agilebot } from '@agilebot/eslint-config';
|
|
26
34
|
|
27
35
|
export default agilebot(import.meta);
|
28
36
|
```
|
37
|
+
|
38
|
+
This will automatically apply the default configurations provided by `agilebot`.
|
39
|
+
|
40
|
+
### Advanced Customization
|
41
|
+
|
42
|
+
If you want more control, you can customize individual integrations using the `FactoryOptions` interface. For example:
|
43
|
+
|
44
|
+
```js
|
45
|
+
// eslint.config.mjs
|
46
|
+
import { agilebot } from '@agilebot/eslint-config';
|
47
|
+
|
48
|
+
export default agilebot(import.meta, {
|
49
|
+
// Replace `.eslintignore` with the `ignores` option
|
50
|
+
ignores: [
|
51
|
+
'**/fixtures'
|
52
|
+
// Add more glob patterns as needed
|
53
|
+
],
|
54
|
+
|
55
|
+
// List of files or directories where development dependencies are allowed
|
56
|
+
// Accepts glob patterns, e.g., '**/scripts/**', '**/test/**'
|
57
|
+
devDependencies: ['**/scripts/**', '**/test/**'],
|
58
|
+
|
59
|
+
// List of modules to be treated as built-in
|
60
|
+
// Accepts an array of module names, e.g., ['electron']
|
61
|
+
coreModules: ['electron'],
|
62
|
+
|
63
|
+
// Enable React-specific linting rules
|
64
|
+
// Accepts `true`, `false`, or a specific version string, e.g., '17.0.0'
|
65
|
+
react: true,
|
66
|
+
|
67
|
+
// Specify the Vue.js version for linting
|
68
|
+
// Accepts a number, e.g., 2 or 3
|
69
|
+
vue: 3,
|
70
|
+
|
71
|
+
// Enable imports-related configurations
|
72
|
+
import: true,
|
73
|
+
|
74
|
+
// Specify the import resolver to use
|
75
|
+
// Accepts 'typescript' or 'oxc'
|
76
|
+
importResolver: 'typescript',
|
77
|
+
|
78
|
+
// Enable Lodash-specific linting rules
|
79
|
+
// Accepts `true` or `false`
|
80
|
+
lodash: true,
|
81
|
+
|
82
|
+
// Enable Prettier for code formatting
|
83
|
+
// Accepts `true` or `false`
|
84
|
+
prettier: true,
|
85
|
+
|
86
|
+
// Enable or disable JSDoc linting rules
|
87
|
+
// Accepts `true` or `false`
|
88
|
+
jsdoc: false,
|
89
|
+
|
90
|
+
// Enable ES module linting rules
|
91
|
+
// Accepts `true` or `false`
|
92
|
+
module: true,
|
93
|
+
|
94
|
+
// Apply specific monorepo configurations
|
95
|
+
// Accepts a string representing the monorepo scope, e.g., '@my-app'
|
96
|
+
monorepoScope: '@my-app',
|
97
|
+
|
98
|
+
// Custom spelling configurations for CSpell
|
99
|
+
// Accepts a configuration object or `false` to disable CSpell
|
100
|
+
cspell: {
|
101
|
+
words: ['agilebot', 'eslint'],
|
102
|
+
ignorePaths: ['**/node_modules']
|
103
|
+
},
|
104
|
+
|
105
|
+
// Enable GoDaddy-specific linting configurations
|
106
|
+
// Accepts `true`, `false`, or 'typescript' for TypeScript-specific rules
|
107
|
+
godaddy: 'typescript',
|
108
|
+
|
109
|
+
// Custom ESLint configuration to override or extend defaults
|
110
|
+
config: {
|
111
|
+
rules: {
|
112
|
+
'no-console': 'warn',
|
113
|
+
'prefer-const': 'error'
|
114
|
+
}
|
115
|
+
}
|
116
|
+
});
|
117
|
+
```
|
package/dist/cli.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license @agilebot/eslint-config v0.7.
|
2
|
+
* @license @agilebot/eslint-config v0.7.3
|
3
3
|
*
|
4
4
|
* Copyright (c) Agilebot, Inc. and its affiliates.
|
5
5
|
*
|
@@ -52,6 +52,17 @@ var CLI_NAME = "eslint-agilebot";
|
|
52
52
|
|
53
53
|
// src/cli/stages/eslint.ts
|
54
54
|
var import_node_path = __toESM(require("path"));
|
55
|
+
function patch() {
|
56
|
+
if (console?.error) {
|
57
|
+
const origConsoleError = console.error;
|
58
|
+
console.error = (...args) => {
|
59
|
+
if (args?.[0]?.includes("React version not specified")) {
|
60
|
+
return;
|
61
|
+
}
|
62
|
+
origConsoleError(...args);
|
63
|
+
};
|
64
|
+
}
|
65
|
+
}
|
55
66
|
function runBinary() {
|
56
67
|
const pkg = require.resolve("eslint/package.json");
|
57
68
|
const bin = import_node_path.default.join(pkg, "..", "bin", "eslint.js");
|
@@ -60,6 +71,7 @@ function runBinary() {
|
|
60
71
|
|
61
72
|
// src/cli/index.ts
|
62
73
|
function cli() {
|
74
|
+
patch();
|
63
75
|
const argv = (0, import_yargs.default)((0, import_helpers.hideBin)(process.argv)).scriptName(CLI_NAME).usage(`${CLI_NAME} [options] file.js [file.js] [dir]`).options({
|
64
76
|
config: {
|
65
77
|
alias: "c",
|
package/dist/cli.mjs
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license @agilebot/eslint-config v0.7.
|
2
|
+
* @license @agilebot/eslint-config v0.7.3
|
3
3
|
*
|
4
4
|
* Copyright (c) Agilebot, Inc. and its affiliates.
|
5
5
|
*
|
@@ -10,7 +10,7 @@
|
|
10
10
|
import {
|
11
11
|
CLI_NAME,
|
12
12
|
__require
|
13
|
-
} from "./chunk-
|
13
|
+
} from "./chunk-CGJVNMKG.mjs";
|
14
14
|
|
15
15
|
// src/cli/index.ts
|
16
16
|
import { isCI } from "@agilebot/eslint-utils";
|
@@ -20,6 +20,17 @@ import pc from "picocolors";
|
|
20
20
|
|
21
21
|
// src/cli/stages/eslint.ts
|
22
22
|
import path from "node:path";
|
23
|
+
function patch() {
|
24
|
+
if (console?.error) {
|
25
|
+
const origConsoleError = console.error;
|
26
|
+
console.error = (...args) => {
|
27
|
+
if (args?.[0]?.includes("React version not specified")) {
|
28
|
+
return;
|
29
|
+
}
|
30
|
+
origConsoleError(...args);
|
31
|
+
};
|
32
|
+
}
|
33
|
+
}
|
23
34
|
function runBinary() {
|
24
35
|
const pkg = __require.resolve("eslint/package.json");
|
25
36
|
const bin = path.join(pkg, "..", "bin", "eslint.js");
|
@@ -28,6 +39,7 @@ function runBinary() {
|
|
28
39
|
|
29
40
|
// src/cli/index.ts
|
30
41
|
function cli() {
|
42
|
+
patch();
|
31
43
|
const argv = yargs(hideBin(process.argv)).scriptName(CLI_NAME).usage(`${CLI_NAME} [options] file.js [file.js] [dir]`).options({
|
32
44
|
config: {
|
33
45
|
alias: "c",
|
package/dist/index.d.mts
CHANGED
@@ -11,7 +11,7 @@ type Options = Options$1['cspell'];
|
|
11
11
|
|
12
12
|
interface FactoryOptions {
|
13
13
|
/**
|
14
|
-
* ESLint configuration
|
14
|
+
* Custom ESLint configuration to override or extend defaults
|
15
15
|
* @default undefined
|
16
16
|
*/
|
17
17
|
config?: Omit<FlatConfigItem, 'name' | 'files'>;
|
@@ -21,62 +21,62 @@ interface FactoryOptions {
|
|
21
21
|
*/
|
22
22
|
ignores?: string[];
|
23
23
|
/**
|
24
|
-
* List of development dependencies
|
24
|
+
* List of files or directories where development dependencies are allowed
|
25
25
|
* @default undefined
|
26
26
|
*/
|
27
27
|
devDependencies?: string[];
|
28
28
|
/**
|
29
|
-
* List of
|
29
|
+
* List of modules to be treated as built-in
|
30
30
|
* @default undefined
|
31
31
|
*/
|
32
32
|
coreModules?: string[];
|
33
33
|
/**
|
34
|
-
*
|
34
|
+
* Specific monorepo scope to apply configurations for
|
35
35
|
* @default undefined
|
36
36
|
*/
|
37
37
|
monorepoScope?: string;
|
38
38
|
/**
|
39
|
-
*
|
39
|
+
* Enable React-specific linting rules
|
40
40
|
* @default undefined
|
41
41
|
*/
|
42
42
|
react?: boolean | string;
|
43
43
|
/**
|
44
|
-
*
|
44
|
+
* Specify the Vue.js version for linting
|
45
45
|
* @default undefined
|
46
46
|
*/
|
47
47
|
vue?: number;
|
48
48
|
/**
|
49
|
-
*
|
49
|
+
* Enable ES module linting rules
|
50
50
|
* @default undefined
|
51
51
|
*/
|
52
52
|
module?: boolean;
|
53
53
|
/**
|
54
|
-
*
|
54
|
+
* Enable GoDaddy-specific linting configurations
|
55
55
|
* @default undefined
|
56
56
|
*/
|
57
57
|
godaddy?: boolean | 'typescript';
|
58
58
|
/**
|
59
|
-
*
|
59
|
+
* Enable or disable JSDoc linting rules
|
60
60
|
* @default true
|
61
61
|
*/
|
62
62
|
jsdoc?: boolean;
|
63
63
|
/**
|
64
|
-
*
|
64
|
+
* Enable Prettier for code formatting
|
65
65
|
* @default true
|
66
66
|
*/
|
67
67
|
prettier?: boolean;
|
68
68
|
/**
|
69
|
-
*
|
69
|
+
* Enable Lodash-specific linting rules
|
70
70
|
* @default true
|
71
71
|
*/
|
72
72
|
lodash?: boolean;
|
73
73
|
/**
|
74
|
-
*
|
74
|
+
* Custom spelling configurations for CSpell
|
75
75
|
* @default {}
|
76
76
|
*/
|
77
77
|
cspell?: Options | false;
|
78
78
|
/**
|
79
|
-
*
|
79
|
+
* Enable imports-related linting configurations
|
80
80
|
* @default true
|
81
81
|
*/
|
82
82
|
import?: boolean;
|
package/dist/index.d.ts
CHANGED
@@ -11,7 +11,7 @@ type Options = Options$1['cspell'];
|
|
11
11
|
|
12
12
|
interface FactoryOptions {
|
13
13
|
/**
|
14
|
-
* ESLint configuration
|
14
|
+
* Custom ESLint configuration to override or extend defaults
|
15
15
|
* @default undefined
|
16
16
|
*/
|
17
17
|
config?: Omit<FlatConfigItem, 'name' | 'files'>;
|
@@ -21,62 +21,62 @@ interface FactoryOptions {
|
|
21
21
|
*/
|
22
22
|
ignores?: string[];
|
23
23
|
/**
|
24
|
-
* List of development dependencies
|
24
|
+
* List of files or directories where development dependencies are allowed
|
25
25
|
* @default undefined
|
26
26
|
*/
|
27
27
|
devDependencies?: string[];
|
28
28
|
/**
|
29
|
-
* List of
|
29
|
+
* List of modules to be treated as built-in
|
30
30
|
* @default undefined
|
31
31
|
*/
|
32
32
|
coreModules?: string[];
|
33
33
|
/**
|
34
|
-
*
|
34
|
+
* Specific monorepo scope to apply configurations for
|
35
35
|
* @default undefined
|
36
36
|
*/
|
37
37
|
monorepoScope?: string;
|
38
38
|
/**
|
39
|
-
*
|
39
|
+
* Enable React-specific linting rules
|
40
40
|
* @default undefined
|
41
41
|
*/
|
42
42
|
react?: boolean | string;
|
43
43
|
/**
|
44
|
-
*
|
44
|
+
* Specify the Vue.js version for linting
|
45
45
|
* @default undefined
|
46
46
|
*/
|
47
47
|
vue?: number;
|
48
48
|
/**
|
49
|
-
*
|
49
|
+
* Enable ES module linting rules
|
50
50
|
* @default undefined
|
51
51
|
*/
|
52
52
|
module?: boolean;
|
53
53
|
/**
|
54
|
-
*
|
54
|
+
* Enable GoDaddy-specific linting configurations
|
55
55
|
* @default undefined
|
56
56
|
*/
|
57
57
|
godaddy?: boolean | 'typescript';
|
58
58
|
/**
|
59
|
-
*
|
59
|
+
* Enable or disable JSDoc linting rules
|
60
60
|
* @default true
|
61
61
|
*/
|
62
62
|
jsdoc?: boolean;
|
63
63
|
/**
|
64
|
-
*
|
64
|
+
* Enable Prettier for code formatting
|
65
65
|
* @default true
|
66
66
|
*/
|
67
67
|
prettier?: boolean;
|
68
68
|
/**
|
69
|
-
*
|
69
|
+
* Enable Lodash-specific linting rules
|
70
70
|
* @default true
|
71
71
|
*/
|
72
72
|
lodash?: boolean;
|
73
73
|
/**
|
74
|
-
*
|
74
|
+
* Custom spelling configurations for CSpell
|
75
75
|
* @default {}
|
76
76
|
*/
|
77
77
|
cspell?: Options | false;
|
78
78
|
/**
|
79
|
-
*
|
79
|
+
* Enable imports-related linting configurations
|
80
80
|
* @default true
|
81
81
|
*/
|
82
82
|
import?: boolean;
|
package/dist/index.js
CHANGED
package/dist/index.mjs
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license @agilebot/eslint-config v0.7.
|
2
|
+
* @license @agilebot/eslint-config v0.7.3
|
3
3
|
*
|
4
4
|
* Copyright (c) Agilebot, Inc. and its affiliates.
|
5
5
|
*
|
@@ -16,7 +16,7 @@ import {
|
|
16
16
|
VUE_GLOBS,
|
17
17
|
__dirname,
|
18
18
|
define_STANDARD_RULES_default
|
19
|
-
} from "./chunk-
|
19
|
+
} from "./chunk-CGJVNMKG.mjs";
|
20
20
|
|
21
21
|
// src/factory/index.ts
|
22
22
|
import assert from "node:assert";
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@agilebot/eslint-config",
|
3
|
-
"version": "0.7.
|
3
|
+
"version": "0.7.3",
|
4
4
|
"description": "Agilebot's ESLint config",
|
5
5
|
"bin": {
|
6
6
|
"eslint-agilebot": "bin/eslint-agilebot"
|
@@ -58,7 +58,7 @@
|
|
58
58
|
"picocolors": "^1.1.0",
|
59
59
|
"vue-eslint-parser": "^9.4.3",
|
60
60
|
"yargs": "^17.7.2",
|
61
|
-
"@agilebot/eslint-utils": "0.7.
|
61
|
+
"@agilebot/eslint-utils": "0.7.3"
|
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.
|
69
|
+
"@agilebot/eslint-plugin": "0.7.3"
|
70
70
|
},
|
71
71
|
"files": [
|
72
72
|
"bin",
|