@agilebot/eslint-config 0.2.0 → 0.2.1

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/README.md CHANGED
@@ -1,17 +1,16 @@
1
- # @agilebot/eslint-config
2
-
3
- ### Usage
4
-
5
- ```bash
6
- npm install --save-dev eslint \
7
- @agilebot/eslint-config \
8
- @agilebot/eslint-plugin \
9
- @agilebot/eslint-utils
10
- ```
11
-
12
- ```js
13
- // .eslintrc.js
14
- const { agilebot } = require('@agilebot/eslint-utils');
15
-
16
- module.exports = agilebot(__dirname);
17
- ```
1
+ # @agilebot/eslint-config
2
+
3
+ ### Usage
4
+
5
+ ```bash
6
+ npm install --save-dev eslint \
7
+ @agilebot/eslint-config \
8
+ @agilebot/eslint-plugin
9
+ ```
10
+
11
+ ```js
12
+ // .eslintrc.js
13
+ const { agilebot } = require('@agilebot/eslint-config');
14
+
15
+ module.exports = agilebot(__dirname);
16
+ ```
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ interface FactoryOptions {
5
5
  cspellWords?: string[];
6
6
  config?: Linter.Config;
7
7
  react?: boolean;
8
+ vue?: number;
8
9
  godaddy?: boolean;
9
10
  }
10
11
  declare function factory(root: string, options?: FactoryOptions): Linter.BaseConfig;
package/dist/index.js CHANGED
@@ -180,10 +180,9 @@ function promise() {
180
180
  // src/configs/import.ts
181
181
  var import_node_path = __toESM(require("path"));
182
182
  var import_node_fs = __toESM(require("fs"));
183
- var import_find_root = require("@manypkg/find-root");
184
183
  var import_eslint_utils = require("@agilebot/eslint-utils");
185
184
  function eslintImport(packageDir, devDependencies) {
186
- const { rootDir } = (0, import_find_root.findRootSync)(__dirname);
185
+ const rootDir = (0, import_eslint_utils.findRootDir)(__dirname);
187
186
  const pkg = require(import_node_path.default.join(packageDir, "package.json"));
188
187
  const tmpPkg = {
189
188
  name: `${pkg.name}/tmp`,
@@ -192,7 +191,7 @@ function eslintImport(packageDir, devDependencies) {
192
191
  }
193
192
  };
194
193
  const tmpPkgSafeName = tmpPkg.name.replaceAll("/", "__");
195
- const cacheDir = (0, import_eslint_utils.getCacheDir)(rootDir);
194
+ const cacheDir = (0, import_eslint_utils.findCacheDir)(rootDir);
196
195
  const tmpPkgDir = import_node_path.default.join(cacheDir, "tmp-pkg", tmpPkgSafeName);
197
196
  if (!import_node_fs.default.existsSync(tmpPkgDir)) {
198
197
  import_node_fs.default.mkdirSync(tmpPkgDir, { recursive: true });
@@ -385,6 +384,15 @@ function react() {
385
384
  };
386
385
  }
387
386
 
387
+ // src/configs/vue.ts
388
+ function vue(version) {
389
+ return {
390
+ extends: [
391
+ version === 3 ? "plugin:vue/vue3-recommended" : "plugin:vue/recommended"
392
+ ]
393
+ };
394
+ }
395
+
388
396
  // src/configs/jsdoc.ts
389
397
  function jsdoc() {
390
398
  return {
@@ -470,7 +478,30 @@ function cspell(words) {
470
478
  // src/configs/agilebot.ts
471
479
  function agilebot() {
472
480
  return {
473
- extends: ["plugin:@agilebot/recommended"]
481
+ extends: ["plugin:@agilebot/recommended"],
482
+ plugins: ["react-hooks"],
483
+ rules: {
484
+ "react-hooks/exhaustive-deps": "off",
485
+ "@agilebot/react/better-exhaustive-deps": [
486
+ "warn",
487
+ {
488
+ checkMemoizedVariableIsStatic: true,
489
+ staticHooks: {
490
+ "useIpc.*": {
491
+ value: true,
492
+ regexp: true
493
+ },
494
+ useDialog: true,
495
+ useSnackbar: true,
496
+ useForm: true,
497
+ "use.*Store": {
498
+ value: true,
499
+ regexp: true
500
+ }
501
+ }
502
+ }
503
+ ]
504
+ }
474
505
  };
475
506
  }
476
507
 
@@ -536,10 +567,12 @@ function factory(root, options) {
536
567
  "*.js",
537
568
  "*.jsx",
538
569
  "*.cjs",
539
- "*.mjs"
570
+ "*.mjs",
571
+ "*.vue"
540
572
  ],
541
- parser: "@typescript-eslint/parser",
573
+ parser: !options?.vue ? "@typescript-eslint/parser" : "vue-eslint-parser",
542
574
  parserOptions: {
575
+ parser: "@typescript-eslint/parser",
543
576
  tsconfigRootDir: root
544
577
  },
545
578
  ...(0, import_eslint_utils3.mergeESLintConfig)(
@@ -550,6 +583,7 @@ function factory(root, options) {
550
583
  eslintImport(root, options?.devDependencies),
551
584
  unicorn(),
552
585
  options?.react ? react() : {},
586
+ options?.vue ? vue(options.vue) : {},
553
587
  jsdoc(),
554
588
  lodash(),
555
589
  eslint(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agilebot/eslint-config",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Agilebot's ESLint config",
5
5
  "main": "dist",
6
6
  "types": "dist/index.d.ts",
@@ -16,7 +16,6 @@
16
16
  "homepage": "https://github.com/sh-agilebot/frontend-toolkit/tree/master/packages/eslint-config#readme",
17
17
  "dependencies": {
18
18
  "@cspell/eslint-plugin": "^8.7.0",
19
- "@manypkg/find-root": "^2.2.1",
20
19
  "@stylistic/eslint-plugin": "^1.7.0",
21
20
  "@typescript-eslint/eslint-plugin": "^7.6.0",
22
21
  "@typescript-eslint/parser": "^7.6.0",
@@ -38,9 +37,10 @@
38
37
  "eslint-plugin-react-hooks": "^4.6.0",
39
38
  "eslint-plugin-react-prefer-function-component": "^3.3.0",
40
39
  "eslint-plugin-unicorn": "^52.0.0",
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.0"
43
+ "@agilebot/eslint-utils": "0.2.1"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "@agilebot/eslint-plugin": "*",