@debbl/eslint-config 1.0.0-beta.6 → 1.0.0-beta.7

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 (2) hide show
  1. package/dist/index.js +6 -28
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -1,27 +1,5 @@
1
1
  // src/factory.ts
2
2
  import process from "process";
3
-
4
- // ../../node_modules/local-pkg/index.mjs
5
- import { createRequire } from "module";
6
- var _require = createRequire(import.meta.url);
7
- function isPackageExists(name, options) {
8
- return !!resolvePackage(name, options);
9
- }
10
- function resolvePackage(name, options = {}) {
11
- try {
12
- return _require.resolve(`${name}/package.json`, options);
13
- } catch {
14
- }
15
- try {
16
- return _require.resolve(name, options);
17
- } catch (e) {
18
- if (e.code !== "MODULE_NOT_FOUND")
19
- console.error(e);
20
- return false;
21
- }
22
- }
23
-
24
- // src/factory.ts
25
3
  import {
26
4
  basic,
27
5
  comments,
@@ -60,11 +38,11 @@ function combine(...configs) {
60
38
  // src/factory.ts
61
39
  function config(options = {}, ...userConfigs) {
62
40
  const isInEditor = options.isInEditor ?? !!((process.env.VSCODE_PID || process.env.JETBRAINS_IDE) && !process.env.CI);
63
- const enableVue = options.vue ?? (isPackageExists("vue") || isPackageExists("nuxt") || isPackageExists("vitepress") || isPackageExists("@slidev/cli"));
64
- const enableReact = options.react ?? isPackageExists("react");
65
- const enableSolid = options.solid ?? isPackageExists("solid-js");
66
- const enableTailwindcss = options.tailwindcss ?? isPackageExists("tailwindcss");
67
- const enableTypeScript = options.ts ?? isPackageExists("typescript");
41
+ const enableVue = options.vue;
42
+ const enableReact = options.react;
43
+ const enableSolid = options.solid;
44
+ const enableTailwindcss = options.tailwindcss;
45
+ const enableTypeScript = options.ts;
68
46
  const configs = [
69
47
  ignores,
70
48
  js({ isInEditor }),
@@ -85,7 +63,7 @@ function config(options = {}, ...userConfigs) {
85
63
  componentExts.push("tailwindcss");
86
64
  configs.push(basic(options));
87
65
  if (enableTypeScript) {
88
- configs.push(ts({ componentExts }));
66
+ configs.push(ts({ ...options, componentExts }));
89
67
  if (typeof enableTypeScript !== "boolean") {
90
68
  configs.push(
91
69
  tsWithLanguageServer({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@debbl/eslint-config",
3
3
  "type": "module",
4
- "version": "1.0.0-beta.6",
4
+ "version": "1.0.0-beta.7",
5
5
  "description": "",
6
6
  "author": "Debbl <me@aiwan.run> (https://github.com/Debbl/)",
7
7
  "license": "MIT",
@@ -17,13 +17,13 @@
17
17
  "eslint": ">=8.24.0"
18
18
  },
19
19
  "dependencies": {
20
- "@debbl/eslint-config-prettier": "1.0.0-beta.6",
21
- "@debbl/eslint-config-solid": "1.0.0-beta.6",
22
- "@debbl/eslint-config-react": "1.0.0-beta.6",
23
- "@debbl/eslint-config-basic": "1.0.0-beta.6",
24
- "@debbl/eslint-config-tailwindcss": "1.0.0-beta.6",
25
- "@debbl/eslint-config-ts": "1.0.0-beta.6",
26
- "@debbl/eslint-config-vue": "1.0.0-beta.6"
20
+ "@debbl/eslint-config-basic": "1.0.0-beta.7",
21
+ "@debbl/eslint-config-tailwindcss": "1.0.0-beta.7",
22
+ "@debbl/eslint-config-prettier": "1.0.0-beta.7",
23
+ "@debbl/eslint-config-solid": "1.0.0-beta.7",
24
+ "@debbl/eslint-config-ts": "1.0.0-beta.7",
25
+ "@debbl/eslint-config-react": "1.0.0-beta.7",
26
+ "@debbl/eslint-config-vue": "1.0.0-beta.7"
27
27
  },
28
28
  "devDependencies": {
29
29
  "eslint": "^8.50.0"