@agilebot/eslint-config 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
package/LICENSE CHANGED
@@ -1,9 +1,9 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2024 Agilebot, Inc.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
-
7
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
-
9
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 Agilebot, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ import { Linter } from 'eslint';
3
3
  interface FactoryOptions {
4
4
  devDependencies?: string[];
5
5
  cspellWords?: string[];
6
+ monorepoScope?: string;
6
7
  config?: Linter.Config;
7
8
  react?: boolean;
8
9
  vue?: number;
package/dist/index.js CHANGED
@@ -280,7 +280,8 @@ function eslintImport(opts) {
280
280
  typescript: {
281
281
  alwaysTryTypes: true
282
282
  }
283
- }
283
+ },
284
+ "import/internal-regex": opts.monorepoScope ? `^${opts.monorepoScope.replaceAll("/", "")}/` : void 0
284
285
  }
285
286
  };
286
287
  }
@@ -292,7 +293,7 @@ function unicorn(opts) {
292
293
  extends: ["plugin:unicorn/recommended"],
293
294
  rules: {
294
295
  "unicorn/prefer-module": opts.module ? "error" : "off",
295
- "unicorn/prefer-top-level-await": opts.module ? "error" : "off",
296
+ "unicorn/prefer-top-level-await": "off",
296
297
  "unicorn/filename-case": "off",
297
298
  "unicorn/import-style": "off",
298
299
  "unicorn/prefer-at": "off",
@@ -479,7 +480,7 @@ function cspell(opts) {
479
480
  }
480
481
 
481
482
  // src/configs/agilebot.ts
482
- function agilebot() {
483
+ function agilebot(opts) {
483
484
  return {
484
485
  extends: ["plugin:@agilebot/recommended"],
485
486
  plugins: ["react-hooks"],
@@ -504,6 +505,10 @@ function agilebot() {
504
505
  }
505
506
  }
506
507
  ]
508
+ },
509
+ settings: {
510
+ "agilebot/project-root": opts.root,
511
+ "agilebot/monorepo-scope": opts.monorepoScope ? opts.monorepoScope.replaceAll("/", "") : void 0
507
512
  }
508
513
  };
509
514
  }
@@ -556,7 +561,8 @@ function factory(root, options) {
556
561
  eslint(),
557
562
  eslintImport({
558
563
  packageDir: root,
559
- devDependencies: options?.devDependencies
564
+ devDependencies: options?.devDependencies,
565
+ monorepoScope: options?.monorepoScope
560
566
  }),
561
567
  prettier()
562
568
  ];
@@ -602,7 +608,10 @@ function factory(root, options) {
602
608
  words: options?.cspellWords ?? []
603
609
  }),
604
610
  ...commonConfigs,
605
- agilebot(),
611
+ agilebot({
612
+ root,
613
+ monorepoScope: options?.monorepoScope
614
+ }),
606
615
  options?.config ?? {}
607
616
  )
608
617
  },
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@agilebot/eslint-config",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Agilebot's ESLint config",
5
- "main": "dist",
5
+ "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "MIT",
8
8
  "keywords": [
@@ -40,7 +40,7 @@
40
40
  "eslint-plugin-vue": "^9.25.0",
41
41
  "eslint-plugin-you-dont-need-lodash-underscore": "^6.13.0",
42
42
  "fast-glob": "^3.3.2",
43
- "@agilebot/eslint-utils": "0.2.2"
43
+ "@agilebot/eslint-utils": "0.2.3"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "@agilebot/eslint-plugin": "*",