@useinsider/eslint-config 1.3.0-beta.24 → 1.3.0-beta.26

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.
Files changed (52) hide show
  1. package/README.md +30 -0
  2. package/dist/base-CNvBr0N7.js +34 -0
  3. package/dist/{compat-DfBTP0AK.js → compat-yCMrjVqu.js} +3 -1
  4. package/dist/index-6mED1zHB.js +51 -0
  5. package/dist/{index-CjloOm7h.cjs → index-B45cvr6O.cjs} +1 -1
  6. package/dist/{index-CDDb3mvA.js → index-B9Z6BE0D.js} +34 -22
  7. package/dist/index-BETnCAUK.js +16 -0
  8. package/dist/index-BNkSVzD-.js +16 -0
  9. package/dist/index-BaDx6evv.js +52 -0
  10. package/dist/{index-BRXTBIK6.cjs → index-COJ71EEW.cjs} +1 -1
  11. package/dist/{index-B5FZUBe8.cjs → index-DI_UoSW4.cjs} +1 -1
  12. package/dist/index-DS5J-V91.js +16 -0
  13. package/dist/index-DbqrYKOt.js +52 -0
  14. package/dist/{index-BnmYAvIK.js → index-DzDN3h2z.js} +13 -2
  15. package/dist/index-GOHntk83.js +16 -0
  16. package/dist/main.cjs +5 -1
  17. package/dist/main.js +84 -21
  18. package/dist/rules/typescript.cjs +1 -1
  19. package/dist/rules/typescript.js +2 -1
  20. package/dist/{main.d.ts → src/main.d.ts} +1 -0
  21. package/dist/src/utils/ensureDependencies.d.ts +9 -0
  22. package/package.json +1 -23
  23. package/dist/base-Dd7loOAV.js +0 -29
  24. package/dist/index-BADS9AaT.js +0 -33
  25. package/dist/index-BNmy0szt.js +0 -13
  26. package/dist/index-BVRhCxZ-.js +0 -34
  27. package/dist/index-BhzsYT7t.js +0 -13
  28. package/dist/index-Bi0aTktN.js +0 -34
  29. package/dist/index-C_hDS_Wu.js +0 -13
  30. package/dist/index-UFJ1LWlt.js +0 -13
  31. /package/dist/{base.d.ts → src/base.d.ts} +0 -0
  32. /package/dist/{configs → src/configs}/config/index.d.ts +0 -0
  33. /package/dist/{configs → src/configs}/javascript/index.d.ts +0 -0
  34. /package/dist/{configs → src/configs}/javascript-dom/index.d.ts +0 -0
  35. /package/dist/{configs → src/configs}/javascript-node/index.d.ts +0 -0
  36. /package/dist/{configs → src/configs}/typescript/index.d.ts +0 -0
  37. /package/dist/{configs → src/configs}/typescript-dom/index.d.ts +0 -0
  38. /package/dist/{configs → src/configs}/typescript-node/index.d.ts +0 -0
  39. /package/dist/{configs → src/configs}/vue2/index.d.ts +0 -0
  40. /package/dist/{configs → src/configs}/vue3/index.d.ts +0 -0
  41. /package/dist/{configs → src/configs}/vue3-typescript/index.d.ts +0 -0
  42. /package/dist/{rules → src/rules}/core.d.ts +0 -0
  43. /package/dist/{rules → src/rules}/cspell.d.ts +0 -0
  44. /package/dist/{rules → src/rules}/importRules.d.ts +0 -0
  45. /package/dist/{rules → src/rules}/jsdoc.d.ts +0 -0
  46. /package/dist/{rules → src/rules}/stylistic.d.ts +0 -0
  47. /package/dist/{rules → src/rules}/typescript.d.ts +0 -0
  48. /package/dist/{rules → src/rules}/vue.d.ts +0 -0
  49. /package/dist/{rules → src/rules}/vue2.d.ts +0 -0
  50. /package/dist/{utils → src/utils}/compat.d.ts +0 -0
  51. /package/dist/{utils → src/utils}/merge.d.ts +0 -0
  52. /package/dist/{utils → src/utils}/mergeAllConfig.d.ts +0 -0
package/README.md CHANGED
@@ -9,6 +9,8 @@
9
9
  - [Framework-specific](#framework-specific)
10
10
  - [⏳ Upcoming Configurations](#-upcoming-configurations)
11
11
  - [Examples](#examples)
12
+ - [Troubleshooting](#troubleshooting)
13
+ - [`Missing dependencies detected:`](#missing-dependencies-detected)
12
14
  - [Contributing](#contributing)
13
15
 
14
16
  ## Prerequisites
@@ -52,6 +54,34 @@ Planned configurations for the next
52
54
  Checkout the [examples directory](../../examples) to see various apps with the extended ESLint
53
55
  configuration.
54
56
 
57
+ ## Troubleshooting
58
+
59
+ ### `Missing dependencies detected:`
60
+ If you see this error, it means that the configuration you are trying to use
61
+ has some dependencies that are not installed in your project. You can install
62
+ them by running the command that it provides.
63
+
64
+ If you want to silence the warning, you can add the following code to your
65
+ ESLint config file.
66
+
67
+ ```js
68
+ import { useInsider, silenceDependencyWarning } from '@useinsider/eslint-config';
69
+
70
+ silenceDependencyWarning(['@eslint/eslintrc', '@stylistic/eslint-plugin']);
71
+ ```
72
+
73
+ Or you can pass `true` to the `silenceDependencyWarning` function to silence all
74
+ warnings.
75
+
76
+ However, this is not recommended as it may cause unexpected issues while
77
+ maintaining the dependencies.
78
+
79
+ ```js
80
+ import { useInsider, silenceDependencyWarning } from '@useinsider/eslint-config';
81
+
82
+ silenceDependencyWarning(true);
83
+ ```
84
+
55
85
  ## Contributing
56
86
 
57
87
  Please refer to the [CONTRIBUTING.md](CONTRIBUTING.md) file for guidelines on
@@ -0,0 +1,34 @@
1
+ import { dirname as e } from "node:path";
2
+ import { fileURLToPath as t } from "node:url";
3
+ import { FlatCompat as i } from "@eslint/eslintrc";
4
+ import m from "@eslint/js";
5
+ import { merge as r, mergeAll as s } from "./main.js";
6
+ const a = new i({
7
+ baseDirectory: e(t(import.meta.url))
8
+ });
9
+ function l(o = []) {
10
+ return r(
11
+ m.configs.recommended,
12
+ s(a.plugins("import", "@stylistic", "@stylistic/migrate", "@cspell", ...o))
13
+ );
14
+ }
15
+ function d() {
16
+ return r(
17
+ {
18
+ languageOptions: {
19
+ ecmaVersion: 2022
20
+ },
21
+ rules: {
22
+ "jsdoc/require-param": "off",
23
+ "jsdoc/require-jsdoc": "off",
24
+ "jsdoc/require-returns": "off",
25
+ "jsdoc/require-param-type": "off",
26
+ "jsdoc/check-param-names": "off"
27
+ }
28
+ }
29
+ );
30
+ }
31
+ export {
32
+ l as a,
33
+ d as p
34
+ };
@@ -5,7 +5,9 @@ import { mergeAll as t } from "./main.js";
5
5
  const e = new i({
6
6
  baseDirectory: m(r(import.meta.url))
7
7
  }), l = {
8
- extends: (...o) => t(e.extends(...o)),
8
+ extends: (...o) => t(
9
+ e.extends(...o)
10
+ ),
9
11
  config: (o) => t(e.config(o)),
10
12
  plugins: (...o) => t(e.plugins(...o)),
11
13
  env: (o) => t(e.env(o))
@@ -0,0 +1,51 @@
1
+ import i from "@eslint/js";
2
+ import c from "eslint-plugin-jsdoc";
3
+ import e from "typescript-eslint";
4
+ import { p as n, a } from "./base-CNvBr0N7.js";
5
+ import f from "./rules/core.js";
6
+ import d from "./rules/cspell.js";
7
+ import l from "./rules/importRules.js";
8
+ import g from "./rules/jsdoc.js";
9
+ import b from "./rules/stylistic.js";
10
+ import u from "./rules/typescript.js";
11
+ import { c as m } from "./compat-yCMrjVqu.js";
12
+ import { mergeAll as y, merge as s } from "./main.js";
13
+ const p = s(m.extends("airbnb-base", "airbnb-typescript/base"));
14
+ var r, o, t;
15
+ (t = (o = (r = p.languageOptions) == null ? void 0 : r.parserOptions) == null ? void 0 : o.ecmaFeatures) == null || delete t.globalReturn;
16
+ const N = y(e.config(
17
+ i.configs.recommended,
18
+ p,
19
+ ...e.configs.recommended,
20
+ ...e.configs.recommendedTypeChecked,
21
+ c.configs["flat/recommended-typescript-error"],
22
+ s(
23
+ m.extends("plugin:@cspell/recommended"),
24
+ a(),
25
+ f,
26
+ l,
27
+ d,
28
+ b,
29
+ g,
30
+ u,
31
+ n(),
32
+ {
33
+ settings: {
34
+ jsdoc: {
35
+ mode: "typescript",
36
+ tagNamePreference: {
37
+ callback: "watch",
38
+ desc: "use"
39
+ }
40
+ },
41
+ "import/resolver": {
42
+ typescript: !0,
43
+ node: !0
44
+ }
45
+ }
46
+ }
47
+ )
48
+ ));
49
+ export {
50
+ N as default
51
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("globals"),r=require("./main.cjs"),t=require("./index-B5FZUBe8.cjs"),o=r.merge(t.default,{languageOptions:{globals:{...e.browser}}});exports.default=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("globals"),r=require("./main.cjs"),t=require("./index-DI_UoSW4.cjs"),o=r.merge(t.default,{languageOptions:{globals:{...e.browser}}});exports.default=o;
@@ -4,7 +4,7 @@ import c from "eslint-plugin-vue";
4
4
  import l from "eslint-plugin-vue-scoped-css";
5
5
  import f from "globals";
6
6
  import r from "typescript-eslint";
7
- import { p as d, a as g } from "./base-Dd7loOAV.js";
7
+ import { p as d, a as g } from "./base-CNvBr0N7.js";
8
8
  import u from "./rules/core.js";
9
9
  import b from "./rules/cspell.js";
10
10
  import x from "./rules/importRules.js";
@@ -12,7 +12,7 @@ import y from "./rules/jsdoc.js";
12
12
  import j from "./rules/stylistic.js";
13
13
  import O from "./rules/typescript.js";
14
14
  import P from "./rules/vue.js";
15
- import { c as m } from "./compat-DfBTP0AK.js";
15
+ import { c as m } from "./compat-yCMrjVqu.js";
16
16
  import { mergeAll as C, merge as i } from "./main.js";
17
17
  const p = i(m.extends("airbnb-base", "airbnb-typescript/base"));
18
18
  var o, t, s;
@@ -24,30 +24,42 @@ const G = C(r.config(
24
24
  ...c.configs["flat/recommended"].map((e) => (delete e.files, e)),
25
25
  ...l.configs["flat/recommended"],
26
26
  a.configs["flat/recommended-typescript-error"],
27
- i(m.extends("plugin:@cspell/recommended"), g(), u, x, b, j, y, P, O, d(), {
28
- languageOptions: {
29
- globals: {
30
- ...f.browser
31
- },
32
- parserOptions: {
33
- parser: "@typescript-eslint/parser",
34
- sourceType: "module",
35
- ecmaFeatures: {
36
- jsx: !0
27
+ i(
28
+ m.extends("plugin:@cspell/recommended"),
29
+ g(),
30
+ u,
31
+ x,
32
+ b,
33
+ j,
34
+ y,
35
+ P,
36
+ O,
37
+ d(),
38
+ {
39
+ languageOptions: {
40
+ globals: {
41
+ ...f.browser
37
42
  },
38
- extraFileExtensions: [".vue"]
39
- }
40
- },
41
- settings: {
42
- jsdoc: {
43
- mode: "typescript",
44
- tagNamePreference: {
45
- callback: "watch",
46
- desc: "use"
43
+ parserOptions: {
44
+ parser: "@typescript-eslint/parser",
45
+ sourceType: "module",
46
+ ecmaFeatures: {
47
+ jsx: !0
48
+ },
49
+ extraFileExtensions: [".vue"]
50
+ }
51
+ },
52
+ settings: {
53
+ jsdoc: {
54
+ mode: "typescript",
55
+ tagNamePreference: {
56
+ callback: "watch",
57
+ desc: "use"
58
+ }
47
59
  }
48
60
  }
49
61
  }
50
- })
62
+ )
51
63
  ));
52
64
  export {
53
65
  G as default
@@ -0,0 +1,16 @@
1
+ import o from "globals";
2
+ import { merge as r } from "./main.js";
3
+ import t from "./index-6mED1zHB.js";
4
+ const s = r(
5
+ t,
6
+ {
7
+ languageOptions: {
8
+ globals: {
9
+ ...o.browser
10
+ }
11
+ }
12
+ }
13
+ );
14
+ export {
15
+ s as default
16
+ };
@@ -0,0 +1,16 @@
1
+ import o from "globals";
2
+ import { merge as r } from "./main.js";
3
+ import t from "./index-6mED1zHB.js";
4
+ const a = r(
5
+ t,
6
+ {
7
+ languageOptions: {
8
+ globals: {
9
+ ...o.node
10
+ }
11
+ }
12
+ }
13
+ );
14
+ export {
15
+ a as default
16
+ };
@@ -0,0 +1,52 @@
1
+ import { dirname as r } from "node:path";
2
+ import { fileURLToPath as m } from "node:url";
3
+ import { FlatCompat as s } from "@eslint/eslintrc";
4
+ import t from "eslint-plugin-jsdoc";
5
+ import i from "globals";
6
+ import { p, a as n } from "./base-CNvBr0N7.js";
7
+ import a from "./rules/core.js";
8
+ import l from "./rules/cspell.js";
9
+ import c from "./rules/importRules.js";
10
+ import f from "./rules/jsdoc.js";
11
+ import u from "./rules/stylistic.js";
12
+ import d from "./rules/vue2.js";
13
+ import { merge as g, mergeAll as e } from "./main.js";
14
+ const o = new s({
15
+ baseDirectory: r(m(import.meta.url))
16
+ }), A = g(
17
+ e(o.extends(
18
+ "airbnb-base",
19
+ "plugin:vue/recommended",
20
+ "plugin:vue-scoped-css/recommended"
21
+ )),
22
+ t.configs["flat/recommended"],
23
+ e(o.extends("plugin:@cspell/recommended")),
24
+ n(["vue", "vue-scoped-css"]),
25
+ a,
26
+ c,
27
+ l,
28
+ u,
29
+ f,
30
+ d,
31
+ p(),
32
+ e(o.config({
33
+ parser: "vue-eslint-parser"
34
+ })),
35
+ {
36
+ languageOptions: {
37
+ parserOptions: {
38
+ sourceType: "module",
39
+ ecmaFeatures: {
40
+ jsx: !0
41
+ },
42
+ extraFileExtensions: [".vue"]
43
+ },
44
+ globals: {
45
+ ...i.browser
46
+ }
47
+ }
48
+ }
49
+ );
50
+ export {
51
+ A as default
52
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("globals"),t=require("./main.cjs"),n=require("./index-B5FZUBe8.cjs"),o=t.merge(n.default,{languageOptions:{globals:{...e.node}}});exports.default=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("globals"),t=require("./main.cjs"),n=require("./index-DI_UoSW4.cjs"),o=t.merge(n.default,{languageOptions:{globals:{...e.node}}});exports.default=o;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("node:path"),s=require("node:url"),c=require("@eslint/eslintrc"),i=require("eslint-plugin-jsdoc"),r=require("./base-BQL2gY6S.cjs"),u=require("./rules/core.cjs"),l=require("./rules/cspell.cjs"),d=require("./rules/importRules.cjs"),a=require("./rules/jsdoc.cjs"),m=require("./rules/stylistic.cjs"),e=require("./main.cjs");var n=typeof document<"u"?document.currentScript:null;const t=new c.FlatCompat({baseDirectory:o.dirname(s.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:n&&n.src||new URL("index-B5FZUBe8.cjs",document.baseURI).href))}),p=e.merge(e.mergeAll(t.extends("eslint-config-airbnb-base")),i.configs["flat/recommended"],e.mergeAll(t.extends("plugin:@cspell/recommended")),r.preConfig(),u,d,l,m,a,r.postConfig());exports.default=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("node:path"),s=require("node:url"),c=require("@eslint/eslintrc"),i=require("eslint-plugin-jsdoc"),r=require("./base-BQL2gY6S.cjs"),u=require("./rules/core.cjs"),l=require("./rules/cspell.cjs"),d=require("./rules/importRules.cjs"),a=require("./rules/jsdoc.cjs"),m=require("./rules/stylistic.cjs"),e=require("./main.cjs");var t=typeof document<"u"?document.currentScript:null;const n=new c.FlatCompat({baseDirectory:o.dirname(s.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:t&&t.src||new URL("index-DI_UoSW4.cjs",document.baseURI).href))}),p=e.merge(e.mergeAll(n.extends("eslint-config-airbnb-base")),i.configs["flat/recommended"],e.mergeAll(n.extends("plugin:@cspell/recommended")),r.preConfig(),u,d,l,m,a,r.postConfig());exports.default=p;
@@ -0,0 +1,16 @@
1
+ import o from "globals";
2
+ import { merge as r } from "./main.js";
3
+ import a from "./index-DzDN3h2z.js";
4
+ const i = r(
5
+ a,
6
+ {
7
+ languageOptions: {
8
+ globals: {
9
+ ...o.node
10
+ }
11
+ }
12
+ }
13
+ );
14
+ export {
15
+ i as default
16
+ };
@@ -0,0 +1,52 @@
1
+ import { dirname as r } from "node:path";
2
+ import { fileURLToPath as m } from "node:url";
3
+ import { FlatCompat as s } from "@eslint/eslintrc";
4
+ import t from "eslint-plugin-jsdoc";
5
+ import i from "globals";
6
+ import { p, a as n } from "./base-CNvBr0N7.js";
7
+ import a from "./rules/core.js";
8
+ import l from "./rules/cspell.js";
9
+ import c from "./rules/importRules.js";
10
+ import u from "./rules/jsdoc.js";
11
+ import f from "./rules/stylistic.js";
12
+ import d from "./rules/vue.js";
13
+ import { merge as g, mergeAll as e } from "./main.js";
14
+ const o = new s({
15
+ baseDirectory: r(m(import.meta.url))
16
+ }), A = g(
17
+ e(o.extends(
18
+ "airbnb-base",
19
+ "plugin:vue/vue3-recommended",
20
+ "plugin:vue-scoped-css/vue3-recommended"
21
+ )),
22
+ t.configs["flat/recommended"],
23
+ e(o.extends("plugin:@cspell/recommended")),
24
+ n(["vue", "vue-scoped-css"]),
25
+ a,
26
+ c,
27
+ l,
28
+ f,
29
+ u,
30
+ d,
31
+ p(),
32
+ e(o.config({
33
+ parser: "vue-eslint-parser"
34
+ })),
35
+ {
36
+ languageOptions: {
37
+ parserOptions: {
38
+ sourceType: "module",
39
+ ecmaFeatures: {
40
+ jsx: !0
41
+ },
42
+ extraFileExtensions: [".vue"]
43
+ },
44
+ globals: {
45
+ ...i.browser
46
+ }
47
+ }
48
+ }
49
+ );
50
+ export {
51
+ A as default
52
+ };
@@ -2,7 +2,7 @@ import { dirname as m } from "node:path";
2
2
  import { fileURLToPath as t } from "node:url";
3
3
  import { FlatCompat as e } from "@eslint/eslintrc";
4
4
  import i from "eslint-plugin-jsdoc";
5
- import { p, a as s } from "./base-Dd7loOAV.js";
5
+ import { p, a as s } from "./base-CNvBr0N7.js";
6
6
  import f from "./rules/core.js";
7
7
  import a from "./rules/cspell.js";
8
8
  import l from "./rules/importRules.js";
@@ -11,7 +11,18 @@ import c from "./rules/stylistic.js";
11
11
  import { merge as d, mergeAll as o } from "./main.js";
12
12
  const r = new e({
13
13
  baseDirectory: m(t(import.meta.url))
14
- }), w = d(o(r.extends("eslint-config-airbnb-base")), i.configs["flat/recommended"], o(r.extends("plugin:@cspell/recommended")), s(), f, l, a, c, n, p());
14
+ }), w = d(
15
+ o(r.extends("eslint-config-airbnb-base")),
16
+ i.configs["flat/recommended"],
17
+ o(r.extends("plugin:@cspell/recommended")),
18
+ s(),
19
+ f,
20
+ l,
21
+ a,
22
+ c,
23
+ n,
24
+ p()
25
+ );
15
26
  export {
16
27
  w as default
17
28
  };
@@ -0,0 +1,16 @@
1
+ import o from "globals";
2
+ import { merge as r } from "./main.js";
3
+ import a from "./index-DzDN3h2z.js";
4
+ const s = r(
5
+ a,
6
+ {
7
+ languageOptions: {
8
+ globals: {
9
+ ...o.browser
10
+ }
11
+ }
12
+ }
13
+ );
14
+ export {
15
+ s as default
16
+ };
package/dist/main.cjs CHANGED
@@ -1 +1,5 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("ts-deepmerge");function n(...e){return c.merge.withOptions({mergeArrays:!1},...e)}function a(...e){return e.flat().reduce((t,s)=>n(t,s),{})}const i={async config(){return Promise.resolve().then(()=>require("./index-CAuGyIr4.cjs"))},async javascript(){return Promise.resolve().then(()=>require("./index-B5FZUBe8.cjs"))},async"javascript-node"(){return Promise.resolve().then(()=>require("./index-BRXTBIK6.cjs"))},async"javascript-dom"(){return Promise.resolve().then(()=>require("./index-CjloOm7h.cjs"))},async typescript(){return Promise.resolve().then(()=>require("./index-CCngt07f.cjs"))},async"typescript-node"(){return Promise.resolve().then(()=>require("./index-CZG4LLz1.cjs"))},async"typescript-dom"(){return Promise.resolve().then(()=>require("./index-ZUN0xFSs.cjs"))},async vue3(){return Promise.resolve().then(()=>require("./index-BPS1S4-r.cjs"))},async"vue3-typescript"(){return Promise.resolve().then(()=>require("./index-Brj-OnR2.cjs"))},async vue2(){return Promise.resolve().then(()=>require("./index-DLjVlGbl.cjs"))}};async function l(e){const t=e.preset.map(async r=>typeof i[r]=="function"&&(await i[r]()).default).filter(Boolean),s=await Promise.all(t),o=n(s.reduce((r,u)=>n(r,u),{}),e.config);return o||Promise.reject(new Error("No config found"))}exports.merge=n;exports.mergeAll=a;exports.useInsider=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("node:fs"),m=require("node:path"),g=require("node:url"),y=require("ts-deepmerge");var c=typeof document<"u"?document.currentScript:null;let p=!1;const d=new Set;function l(e){const r=m.resolve(e,"package.json"),t=f.readFileSync(r,"utf8");if(!t)throw new Error(`Unable to locate package.json: ${r}`);return JSON.parse(t)}function v(){const e=l(process.cwd());return{...e.dependencies,...e.devDependencies}}function h(){return l(g.fileURLToPath(new URL("../",typeof document>"u"?require("url").pathToFileURL(__filename).href:c&&c.src||new URL("main.cjs",document.baseURI).href))).dependencies}const a={yarn:"yarn add --exact --dev",pnpm:"pnpm add -E -D",npm:"npm i -E -D"};function q(){const e=(process.env.npm_config_user_agent||"").replace(/\W.*/,"");return a[e]||a.npm}function P(){if(p)return;const e=v(),t=Object.entries(h()).filter(([n,o])=>!d.has(n)&&(!e[n]||e[n]!==o));if(!t.length)return;const s=t.map(([n,o])=>`${n}@${o.replace(/^\W+/,"")}`);console.info("Missing dependencies detected:"),console.info(s.map(n=>` - ${n}`).join(`
2
+ `)),console.info(`
3
+ Copy the following command and install the dependencies manually:`),console.info(`
4
+ ${q()} ${s.join(" ")}
5
+ `),process.exit(1)}function D(e){if(typeof e=="boolean"){p=!0;return}e.forEach(r=>d.add(String(r)))}function i(...e){return y.merge.withOptions({mergeArrays:!1},...e)}function j(...e){return e.flat().reduce((r,t)=>i(r,t),{})}const u={async config(){return Promise.resolve().then(()=>require("./index-CAuGyIr4.cjs"))},async javascript(){return Promise.resolve().then(()=>require("./index-DI_UoSW4.cjs"))},async"javascript-node"(){return Promise.resolve().then(()=>require("./index-COJ71EEW.cjs"))},async"javascript-dom"(){return Promise.resolve().then(()=>require("./index-B45cvr6O.cjs"))},async typescript(){return Promise.resolve().then(()=>require("./index-CCngt07f.cjs"))},async"typescript-node"(){return Promise.resolve().then(()=>require("./index-CZG4LLz1.cjs"))},async"typescript-dom"(){return Promise.resolve().then(()=>require("./index-ZUN0xFSs.cjs"))},async vue3(){return Promise.resolve().then(()=>require("./index-BPS1S4-r.cjs"))},async"vue3-typescript"(){return Promise.resolve().then(()=>require("./index-Brj-OnR2.cjs"))},async vue2(){return Promise.resolve().then(()=>require("./index-DLjVlGbl.cjs"))}};async function w(e){P();const r=e.preset.map(async n=>typeof u[n]=="function"&&(await u[n]()).default).filter(Boolean),t=await Promise.all(r),s=i(t.reduce((n,o)=>i(n,o),{}),e.config);return s||Promise.reject(new Error("No config found"))}exports.merge=i;exports.mergeAll=j;exports.silenceDependencyWarning=D;exports.useInsider=w;
package/dist/main.js CHANGED
@@ -1,48 +1,111 @@
1
- import { merge as a } from "ts-deepmerge";
2
- function o(...r) {
3
- return a.withOptions({ mergeArrays: !1 }, ...r);
1
+ import f from "node:fs";
2
+ import u from "node:path";
3
+ import { fileURLToPath as l } from "node:url";
4
+ import { merge as g } from "ts-deepmerge";
5
+ let p = !1;
6
+ const m = /* @__PURE__ */ new Set();
7
+ function d(e) {
8
+ const t = u.resolve(e, "package.json"), r = f.readFileSync(t, "utf8");
9
+ if (!r)
10
+ throw new Error(`Unable to locate package.json: ${t}`);
11
+ return JSON.parse(r);
4
12
  }
5
- function u(...r) {
6
- return r.flat().reduce((t, n) => o(t, n), {});
13
+ function y() {
14
+ const e = d(process.cwd());
15
+ return {
16
+ ...e.dependencies,
17
+ ...e.devDependencies
18
+ };
7
19
  }
8
- const s = {
20
+ function D() {
21
+ return d(
22
+ l(new URL(
23
+ /* @vite-ignore */
24
+ "../",
25
+ import.meta.url
26
+ ))
27
+ ).dependencies;
28
+ }
29
+ const i = {
30
+ yarn: "yarn add --exact --dev",
31
+ pnpm: "pnpm add -E -D",
32
+ npm: "npm i -E -D"
33
+ };
34
+ function v() {
35
+ const e = (process.env.npm_config_user_agent || "").replace(/\W.*/, "");
36
+ return i[e] || i.npm;
37
+ }
38
+ function w() {
39
+ if (p)
40
+ return;
41
+ const e = y(), r = Object.entries(D()).filter(
42
+ ([n, c]) => !m.has(n) && (!e[n] || e[n] !== c)
43
+ );
44
+ if (!r.length)
45
+ return;
46
+ const o = r.map(([n, c]) => `${n}@${c.replace(/^\W+/, "")}`);
47
+ console.info("Missing dependencies detected:"), console.info(o.map((n) => ` - ${n}`).join(`
48
+ `)), console.info(`
49
+ Copy the following command and install the dependencies manually:`), console.info(`
50
+ ${v()} ${o.join(" ")}
51
+ `), process.exit(1);
52
+ }
53
+ function $(e) {
54
+ if (typeof e == "boolean") {
55
+ p = !0;
56
+ return;
57
+ }
58
+ e.forEach((t) => m.add(String(t)));
59
+ }
60
+ function s(...e) {
61
+ return g.withOptions({ mergeArrays: !1 }, ...e);
62
+ }
63
+ function x(...e) {
64
+ return e.flat().reduce((t, r) => s(t, r), {});
65
+ }
66
+ const a = {
9
67
  async config() {
10
68
  return import("./index-CixUmpPQ.js");
11
69
  },
12
70
  async javascript() {
13
- return import("./index-BnmYAvIK.js");
71
+ return import("./index-DzDN3h2z.js");
14
72
  },
15
73
  async "javascript-node"() {
16
- return import("./index-BhzsYT7t.js");
74
+ return import("./index-DS5J-V91.js");
17
75
  },
18
76
  async "javascript-dom"() {
19
- return import("./index-BNmy0szt.js");
77
+ return import("./index-GOHntk83.js");
20
78
  },
21
79
  async typescript() {
22
- return import("./index-BADS9AaT.js");
80
+ return import("./index-6mED1zHB.js");
23
81
  },
24
82
  async "typescript-node"() {
25
- return import("./index-C_hDS_Wu.js");
83
+ return import("./index-BNkSVzD-.js");
26
84
  },
27
85
  async "typescript-dom"() {
28
- return import("./index-UFJ1LWlt.js");
86
+ return import("./index-BETnCAUK.js");
29
87
  },
30
88
  async vue3() {
31
- return import("./index-Bi0aTktN.js");
89
+ return import("./index-DbqrYKOt.js");
32
90
  },
33
91
  async "vue3-typescript"() {
34
- return import("./index-CDDb3mvA.js");
92
+ return import("./index-B9Z6BE0D.js");
35
93
  },
36
94
  async vue2() {
37
- return import("./index-BVRhCxZ-.js");
95
+ return import("./index-BaDx6evv.js");
38
96
  }
39
97
  };
40
- async function m(r) {
41
- const t = r.preset.map(async (e) => typeof s[e] == "function" && (await s[e]()).default).filter(Boolean), n = await Promise.all(t), i = o(n.reduce((e, c) => o(e, c), {}), r.config);
42
- return i || Promise.reject(new Error("No config found"));
98
+ async function J(e) {
99
+ w();
100
+ const t = e.preset.map(async (n) => typeof a[n] == "function" && (await a[n]()).default).filter(Boolean), r = await Promise.all(t), o = s(
101
+ r.reduce((n, c) => s(n, c), {}),
102
+ e.config
103
+ );
104
+ return o || Promise.reject(new Error("No config found"));
43
105
  }
44
106
  export {
45
- o as merge,
46
- u as mergeAll,
47
- m as useInsider
107
+ s as merge,
108
+ x as mergeAll,
109
+ $ as silenceDependencyWarning,
110
+ J as useInsider
48
111
  };
@@ -1 +1 @@
1
- "use strict";const e={indent:"off","no-undef":"off","no-shadow":"off","@typescript-eslint/comma-dangle":"off","no-extra-parens":"off","@typescript-eslint/no-extra-parens":"off","@typescript-eslint/space-before-function-paren":"off","no-unused-vars":"off","no-useless-constructor":"off","@typescript-eslint/indent":"off",semi:"off","@typescript-eslint/semi":"off","react/jsx-filename-extension":"off","no-use-before-define":"off","@typescript-eslint/lines-between-class-members":"off","@typescript-eslint/comma-spacing":"off","@typescript-eslint/space-before-blocks":"off","@typescript-eslint/object-curly-spacing":"off"},s={rules:{...e,"@typescript-eslint/no-shadow":"error","@typescript-eslint/no-unused-vars":["error"],"@typescript-eslint/no-useless-constructor":["error"],"@typescript-eslint/array-type":["error",{default:"array",readonly:"array"}],"@typescript-eslint/no-misused-promises":["error",{checksVoidReturn:{arguments:!1}}],"@typescript-eslint/no-use-before-define":["error"]}};module.exports=s;
1
+ "use strict";const e={indent:"off","no-undef":"off","no-shadow":"off","@typescript-eslint/comma-dangle":"off","no-extra-parens":"off","@typescript-eslint/no-extra-parens":"off","@typescript-eslint/space-before-function-paren":"off","no-unused-vars":"off","no-useless-constructor":"off","@typescript-eslint/indent":"off",semi:"off","@typescript-eslint/semi":"off","react/jsx-filename-extension":"off","no-use-before-define":"off","@typescript-eslint/lines-between-class-members":"off","@typescript-eslint/comma-spacing":"off","@typescript-eslint/space-before-blocks":"off","@typescript-eslint/object-curly-spacing":"off","no-redeclare":"off"},s={rules:{...e,"@typescript-eslint/no-shadow":"error","@typescript-eslint/no-unused-vars":["error"],"@typescript-eslint/no-useless-constructor":["error"],"@typescript-eslint/array-type":["error",{default:"array",readonly:"array"}],"@typescript-eslint/no-misused-promises":["error",{checksVoidReturn:{arguments:!1}}],"@typescript-eslint/no-use-before-define":["error"]}};module.exports=s;
@@ -16,7 +16,8 @@ const e = {
16
16
  "@typescript-eslint/lines-between-class-members": "off",
17
17
  "@typescript-eslint/comma-spacing": "off",
18
18
  "@typescript-eslint/space-before-blocks": "off",
19
- "@typescript-eslint/object-curly-spacing": "off"
19
+ "@typescript-eslint/object-curly-spacing": "off",
20
+ "no-redeclare": "off"
20
21
  }, s = {
21
22
  rules: {
22
23
  ...e,
@@ -19,3 +19,4 @@ interface Config {
19
19
  export declare function useInsider(config: Config): Promise<Linter.FlatConfig>;
20
20
  export { merge } from './utils/merge';
21
21
  export { mergeAll } from './utils/mergeAllConfig';
22
+ export { silenceDependencyWarning } from './utils/ensureDependencies';
@@ -0,0 +1,9 @@
1
+ export declare function ensureDependencies(): void;
2
+ type Dependencies = (keyof typeof import('../package.json')['dependencies'])[];
3
+ export declare function silenceDependencyWarning(
4
+ /**
5
+ * Pass `true` to silence all dependency warnings.
6
+ */
7
+ all: boolean): void;
8
+ export declare function silenceDependencyWarning(dependencies: Dependencies): void;
9
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@useinsider/eslint-config",
3
3
  "type": "module",
4
- "version": "1.3.0-beta.24",
4
+ "version": "1.3.0-beta.26",
5
5
  "description": "A collection of ESLint configurations provided by @useinsider, offering support for various environments including Vanilla JS, TypeScript, and framework-specific setups such as Vue 3.",
6
6
  "keywords": [
7
7
  "useinsider",
@@ -111,28 +111,6 @@
111
111
  "vue": "3.5.13",
112
112
  "vue-eslint-parser": "9.4.3"
113
113
  },
114
- "peerDependencies": {
115
- "@cspell/eslint-plugin": "8.16.0",
116
- "@eslint/eslintrc": "3.2.0",
117
- "@eslint/js": "8.57.1",
118
- "@stylistic/eslint-plugin": "2.10.1",
119
- "@stylistic/eslint-plugin-migrate": "2.10.1",
120
- "@types/eslint": "8.56.12",
121
- "@types/eslint__eslintrc": "2.1.2",
122
- "@types/eslint__js": "8.42.3",
123
- "@typescript-eslint/eslint-plugin": "7.18.0",
124
- "@typescript-eslint/parser": "7.18.0",
125
- "eslint": "8.57.1",
126
- "eslint-config-airbnb-base": "15.0.0",
127
- "eslint-config-airbnb-typescript": "18.0.0",
128
- "eslint-import-resolver-typescript": "3.6.3",
129
- "eslint-plugin-import": "2.31.0",
130
- "eslint-plugin-jsdoc": "50.5.0",
131
- "globals": "15.14.0",
132
- "ts-deepmerge": "7.0.1",
133
- "typescript": "5.6.2",
134
- "typescript-eslint": "8.14.0"
135
- },
136
114
  "optionalDependencies": {
137
115
  "@rushstack/eslint-patch": ">=1.10.4",
138
116
  "@vue/eslint-config-typescript": "13.0.0",
@@ -1,29 +0,0 @@
1
- import { dirname as e } from "node:path";
2
- import { fileURLToPath as t } from "node:url";
3
- import { FlatCompat as i } from "@eslint/eslintrc";
4
- import m from "@eslint/js";
5
- import { merge as r, mergeAll as s } from "./main.js";
6
- const a = new i({
7
- baseDirectory: e(t(import.meta.url))
8
- });
9
- function l(o = []) {
10
- return r(m.configs.recommended, s(a.plugins("import", "@stylistic", "@stylistic/migrate", "@cspell", ...o)));
11
- }
12
- function d() {
13
- return r({
14
- languageOptions: {
15
- ecmaVersion: 2022
16
- },
17
- rules: {
18
- "jsdoc/require-param": "off",
19
- "jsdoc/require-jsdoc": "off",
20
- "jsdoc/require-returns": "off",
21
- "jsdoc/require-param-type": "off",
22
- "jsdoc/check-param-names": "off"
23
- }
24
- });
25
- }
26
- export {
27
- l as a,
28
- d as p
29
- };
@@ -1,33 +0,0 @@
1
- import i from "@eslint/js";
2
- import c from "eslint-plugin-jsdoc";
3
- import e from "typescript-eslint";
4
- import { p as n, a } from "./base-Dd7loOAV.js";
5
- import f from "./rules/core.js";
6
- import d from "./rules/cspell.js";
7
- import l from "./rules/importRules.js";
8
- import g from "./rules/jsdoc.js";
9
- import b from "./rules/stylistic.js";
10
- import u from "./rules/typescript.js";
11
- import { c as m } from "./compat-DfBTP0AK.js";
12
- import { mergeAll as y, merge as s } from "./main.js";
13
- const p = s(m.extends("airbnb-base", "airbnb-typescript/base"));
14
- var r, o, t;
15
- (t = (o = (r = p.languageOptions) == null ? void 0 : r.parserOptions) == null ? void 0 : o.ecmaFeatures) == null || delete t.globalReturn;
16
- const N = y(e.config(i.configs.recommended, p, ...e.configs.recommended, ...e.configs.recommendedTypeChecked, c.configs["flat/recommended-typescript-error"], s(m.extends("plugin:@cspell/recommended"), a(), f, l, d, b, g, u, n(), {
17
- settings: {
18
- jsdoc: {
19
- mode: "typescript",
20
- tagNamePreference: {
21
- callback: "watch",
22
- desc: "use"
23
- }
24
- },
25
- "import/resolver": {
26
- typescript: !0,
27
- node: !0
28
- }
29
- }
30
- })));
31
- export {
32
- N as default
33
- };
@@ -1,13 +0,0 @@
1
- import o from "globals";
2
- import { merge as r } from "./main.js";
3
- import a from "./index-BnmYAvIK.js";
4
- const s = r(a, {
5
- languageOptions: {
6
- globals: {
7
- ...o.browser
8
- }
9
- }
10
- });
11
- export {
12
- s as default
13
- };
@@ -1,34 +0,0 @@
1
- import { dirname as r } from "node:path";
2
- import { fileURLToPath as m } from "node:url";
3
- import { FlatCompat as s } from "@eslint/eslintrc";
4
- import t from "eslint-plugin-jsdoc";
5
- import i from "globals";
6
- import { p, a as n } from "./base-Dd7loOAV.js";
7
- import a from "./rules/core.js";
8
- import l from "./rules/cspell.js";
9
- import c from "./rules/importRules.js";
10
- import f from "./rules/jsdoc.js";
11
- import u from "./rules/stylistic.js";
12
- import d from "./rules/vue2.js";
13
- import { merge as g, mergeAll as e } from "./main.js";
14
- const o = new s({
15
- baseDirectory: r(m(import.meta.url))
16
- }), A = g(e(o.extends("airbnb-base", "plugin:vue/recommended", "plugin:vue-scoped-css/recommended")), t.configs["flat/recommended"], e(o.extends("plugin:@cspell/recommended")), n(["vue", "vue-scoped-css"]), a, c, l, u, f, d, p(), e(o.config({
17
- parser: "vue-eslint-parser"
18
- })), {
19
- languageOptions: {
20
- parserOptions: {
21
- sourceType: "module",
22
- ecmaFeatures: {
23
- jsx: !0
24
- },
25
- extraFileExtensions: [".vue"]
26
- },
27
- globals: {
28
- ...i.browser
29
- }
30
- }
31
- });
32
- export {
33
- A as default
34
- };
@@ -1,13 +0,0 @@
1
- import o from "globals";
2
- import { merge as r } from "./main.js";
3
- import a from "./index-BnmYAvIK.js";
4
- const i = r(a, {
5
- languageOptions: {
6
- globals: {
7
- ...o.node
8
- }
9
- }
10
- });
11
- export {
12
- i as default
13
- };
@@ -1,34 +0,0 @@
1
- import { dirname as r } from "node:path";
2
- import { fileURLToPath as m } from "node:url";
3
- import { FlatCompat as s } from "@eslint/eslintrc";
4
- import t from "eslint-plugin-jsdoc";
5
- import i from "globals";
6
- import { p, a as n } from "./base-Dd7loOAV.js";
7
- import a from "./rules/core.js";
8
- import l from "./rules/cspell.js";
9
- import c from "./rules/importRules.js";
10
- import u from "./rules/jsdoc.js";
11
- import f from "./rules/stylistic.js";
12
- import d from "./rules/vue.js";
13
- import { merge as g, mergeAll as e } from "./main.js";
14
- const o = new s({
15
- baseDirectory: r(m(import.meta.url))
16
- }), A = g(e(o.extends("airbnb-base", "plugin:vue/vue3-recommended", "plugin:vue-scoped-css/vue3-recommended")), t.configs["flat/recommended"], e(o.extends("plugin:@cspell/recommended")), n(["vue", "vue-scoped-css"]), a, c, l, f, u, d, p(), e(o.config({
17
- parser: "vue-eslint-parser"
18
- })), {
19
- languageOptions: {
20
- parserOptions: {
21
- sourceType: "module",
22
- ecmaFeatures: {
23
- jsx: !0
24
- },
25
- extraFileExtensions: [".vue"]
26
- },
27
- globals: {
28
- ...i.browser
29
- }
30
- }
31
- });
32
- export {
33
- A as default
34
- };
@@ -1,13 +0,0 @@
1
- import o from "globals";
2
- import { merge as r } from "./main.js";
3
- import t from "./index-BADS9AaT.js";
4
- const a = r(t, {
5
- languageOptions: {
6
- globals: {
7
- ...o.node
8
- }
9
- }
10
- });
11
- export {
12
- a as default
13
- };
@@ -1,13 +0,0 @@
1
- import o from "globals";
2
- import { merge as r } from "./main.js";
3
- import t from "./index-BADS9AaT.js";
4
- const s = r(t, {
5
- languageOptions: {
6
- globals: {
7
- ...o.browser
8
- }
9
- }
10
- });
11
- export {
12
- s as default
13
- };
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes