@useinsider/eslint-config 1.3.0-beta.9 → 1.3.0
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 +53 -77
- package/dist/base-BQL2gY6S.cjs +1 -0
- package/dist/base-Dd7loOAV.js +29 -0
- package/dist/compat-CZyl_Sy0.cjs +1 -0
- package/dist/compat-DfBTP0AK.js +15 -0
- package/dist/configs/config/index.d.ts +1 -1
- package/dist/configs/javascript/index.d.ts +3 -0
- package/dist/configs/{dom → javascript-dom}/index.d.ts +1 -1
- package/dist/configs/{node → javascript-node}/index.d.ts +1 -1
- package/dist/configs/typescript/index.d.ts +1 -3
- package/dist/configs/typescript-dom/index.d.ts +1 -3
- package/dist/configs/typescript-node/index.d.ts +3 -0
- package/dist/configs/vue3-typescript/index.d.ts +1 -3
- package/dist/index-B45cvr6O.cjs +1 -0
- package/dist/index-BADS9AaT.js +33 -0
- package/dist/index-BNmy0szt.js +13 -0
- package/dist/index-BPS1S4-r.cjs +1 -0
- package/dist/{index-x9l2X-No.js → index-BVRhCxZ-.js} +9 -7
- package/dist/index-BhzsYT7t.js +13 -0
- package/dist/index-Bi0aTktN.js +34 -0
- package/dist/index-BnmYAvIK.js +17 -0
- package/dist/index-Brj-OnR2.cjs +1 -0
- package/dist/index-CCngt07f.cjs +1 -0
- package/dist/index-CDDb3mvA.js +54 -0
- package/dist/index-COJ71EEW.cjs +1 -0
- package/dist/index-CZG4LLz1.cjs +1 -0
- package/dist/index-C_hDS_Wu.js +13 -0
- package/dist/index-DI_UoSW4.cjs +1 -0
- package/dist/index-DLjVlGbl.cjs +1 -0
- package/dist/index-UFJ1LWlt.js +13 -0
- package/dist/index-ZUN0xFSs.cjs +1 -0
- package/dist/main.cjs +5 -1
- package/dist/main.d.ts +8 -4
- package/dist/main.js +102 -2
- package/dist/rules/core.cjs +1 -1
- package/dist/rules/core.d.ts +1 -1
- package/dist/rules/core.js +2 -28
- package/dist/rules/cspell.cjs +1 -1
- package/dist/rules/cspell.d.ts +1 -1
- package/dist/rules/cspell.js +3 -1
- package/dist/rules/importRules.cjs +1 -0
- package/dist/rules/importRules.d.ts +3 -0
- package/dist/rules/importRules.js +33 -0
- package/dist/rules/jsdoc.cjs +1 -1
- package/dist/rules/jsdoc.d.ts +1 -1
- package/dist/rules/jsdoc.js +47 -1
- package/dist/rules/stylistic.cjs +1 -1
- package/dist/rules/stylistic.d.ts +1 -1
- package/dist/rules/stylistic.js +2 -2
- package/dist/rules/typescript.cjs +1 -1
- package/dist/rules/typescript.d.ts +1 -1
- package/dist/rules/typescript.js +2 -1
- package/dist/rules/vue.d.ts +1 -1
- package/dist/rules/vue2.d.ts +1 -1
- package/dist/utils/compat.d.ts +4 -4
- package/dist/utils/ensureDependencies.d.ts +7 -0
- package/package.json +43 -31
- package/dist/base-BAede0cC.js +0 -2793
- package/dist/base-DxTgZSag.cjs +0 -1
- package/dist/compat-BMmtJ5BI.js +0 -15
- package/dist/compat-CkhpJ9YP.cjs +0 -1
- package/dist/index-Ac6Hw-uA.cjs +0 -1
- package/dist/index-B16ngeJj.js +0 -22
- package/dist/index-B9y7N-hx.js +0 -39
- package/dist/index-BNob5rb3.js +0 -34
- package/dist/index-BaFuYv5N.js +0 -22
- package/dist/index-BtHFk1z3.js +0 -41
- package/dist/index-C6lOnN-C.js +0 -32
- package/dist/index-CYJsMDkS.cjs +0 -1
- package/dist/index-FzjaDGwD.cjs +0 -1
- package/dist/index-Rmzbhrzc.cjs +0 -1
- package/dist/index-SyvyuQ5y.cjs +0 -1
- package/dist/index-TqgLVfW-.cjs +0 -1
- package/dist/index-qbptbq51.cjs +0 -1
- package/dist/main-BeBiQCVR.js +0 -63
- package/dist/main-tNBIB6QK.cjs +0 -1
package/README.md
CHANGED
|
@@ -3,71 +3,20 @@
|
|
|
3
3
|
## Table of Contents
|
|
4
4
|
- [ESLint Configurations](#eslint-configurations)
|
|
5
5
|
- [Table of Contents](#table-of-contents)
|
|
6
|
-
- [
|
|
7
|
-
- [Installation](#installation)
|
|
8
|
-
- [Examples](#examples)
|
|
6
|
+
- [Prerequisites](#prerequisites)
|
|
9
7
|
- [Available Presets](#available-presets)
|
|
10
8
|
- [Vanilla 🍦](#vanilla-)
|
|
11
9
|
- [Framework-specific](#framework-specific)
|
|
12
10
|
- [⏳ Upcoming Configurations](#-upcoming-configurations)
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
- [Examples](#examples)
|
|
12
|
+
- [Troubleshooting](#troubleshooting)
|
|
13
|
+
- [`Missing dependencies detected:`](#missing-dependencies-detected)
|
|
15
14
|
- [Contributing](#contributing)
|
|
16
15
|
|
|
17
|
-
##
|
|
18
|
-
|
|
19
|
-
To ensure consistency and prevent version conflicts, we recommend adding this
|
|
20
|
-
library as a development dependency with a fixed version. This can be achieved
|
|
21
|
-
using the `-D` and `-E` flags in your package manager commands.
|
|
22
|
-
|
|
23
|
-
### Installation
|
|
24
|
-
|
|
25
|
-
1. **Install as a Development Dependency:**
|
|
26
|
-
- For pnpm users:
|
|
27
|
-
```bash
|
|
28
|
-
pnpm add -D -E @useinsider/eslint-config
|
|
29
|
-
```
|
|
30
|
-
- For npm users:
|
|
31
|
-
```bash
|
|
32
|
-
npm install -D -E @useinsider/eslint-config
|
|
33
|
-
```
|
|
34
|
-
2. **Create an ESLint config file:**
|
|
35
|
-
You'll need an ESLint config file in your projects root directory.
|
|
36
|
-
|
|
37
|
-
You can check the official [ESLint documentation] to get more details.
|
|
38
|
-
3. **Extend the Configuration:**
|
|
39
|
-
Add the following to your `eslint.config.js` file to use the presets:
|
|
40
|
-
```js
|
|
41
|
-
import useInsider from '@useinsider/eslint-config';
|
|
42
|
-
|
|
43
|
-
/** @type {import('eslint').Linter.FlatConfig[]} */
|
|
44
|
-
export default [
|
|
45
|
-
await useInsider({
|
|
46
|
-
// See `Available Presets`
|
|
47
|
-
preset: ['dom'],
|
|
48
|
-
config: {
|
|
49
|
-
// Glob file path pattern to specify the target files of the
|
|
50
|
-
// selected presets
|
|
51
|
-
files: ['src/**/*'],
|
|
52
|
-
},
|
|
53
|
-
}),
|
|
54
|
-
await useInsider({
|
|
55
|
-
preset: ['node', 'config'],
|
|
56
|
-
config: {
|
|
57
|
-
files: ['**/eslint.config.js'],
|
|
58
|
-
},
|
|
59
|
-
}),
|
|
60
|
-
];
|
|
61
|
-
```
|
|
62
|
-
4. Adjust your `eslint.config.js` to your projects needs. Choose the right
|
|
63
|
-
preset for the right folder path
|
|
64
|
-
|
|
65
|
-
[ESLint documentation]: https://eslint.org/docs/next/use/configure/configuration-files
|
|
16
|
+
## Prerequisites
|
|
66
17
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
Checkout the [examples directory](../../examples) to see various apps with the extended ESLint
|
|
70
|
-
configuration.
|
|
18
|
+
- NodeJS 20+
|
|
19
|
+
- ESLint 8.57.1
|
|
71
20
|
|
|
72
21
|
## Available Presets
|
|
73
22
|
|
|
@@ -76,35 +25,62 @@ frameworks. Here's a list of available presets:
|
|
|
76
25
|
|
|
77
26
|
### Vanilla 🍦
|
|
78
27
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
| **Config files** | | [`config`](./src/configs/config#readme) |
|
|
28
|
+
There are additional presets for DOM (browser) and Node.js environments, beside
|
|
29
|
+
the vanilla configuration. The vanilla is suitable for general JavaScript and
|
|
30
|
+
TypeScript projects that does not have any specific environment and can be
|
|
31
|
+
configured for different environments, such as ServiceWorkers, WebWorkers, etc.
|
|
84
32
|
|
|
85
|
-
|
|
33
|
+
| Environment | Vanilla | Browser (DOM) | Node |
|
|
34
|
+
| :---------------- | :---------------------------------------------- | :------------------------------------------------------ | :-------------------------------------------------------- |
|
|
35
|
+
| **EcmaScript/JS** | [`javascript`](./src/configs/javascript#readme) | [`javascript-dom`](./src/configs/javascript-dom#readme) | [`javascript-node`](./src/configs/javascript-node#readme) |
|
|
36
|
+
| **TypeScript** | [`typescript`](./src/configs/typescript#readme) | [`typescript-dom`](./src/configs/typescript-dom#readme) | [`typescript-node`](./src/configs/typescript-node#readme) |
|
|
37
|
+
| **Config files** | [`config`](./src/configs/config#readme) | - | - |
|
|
86
38
|
|
|
87
|
-
|
|
88
|
-
| :---------- | :---------------------------------- | :-------------------------------------------------------- |
|
|
89
|
-
| **Vue 3** | [`vue3`](./src/configs/vue3#readme) | [`vue3-typescript`](./src/configs/vue3-typescript#readme) |
|
|
39
|
+
### Framework-specific
|
|
90
40
|
|
|
91
|
-
|
|
41
|
+
| Environment | JavaScript | TypeScript |
|
|
42
|
+
| :------------------------------------ | :---------------------------------- | :-------------------------------------------------------- |
|
|
43
|
+
| **Vue 3 & 2 (Setup/Composition API)** | [`vue3`](./src/configs/vue3#readme) | [`vue3-typescript`](./src/configs/vue3-typescript#readme) |
|
|
44
|
+
| **Vue 2 (Options API)** | [`vue2`](./src/configs/vue2#readme) | - |
|
|
92
45
|
|
|
93
46
|
### ⏳ Upcoming Configurations
|
|
94
47
|
|
|
95
|
-
|
|
48
|
+
Planned configurations for the next
|
|
49
|
+
|
|
50
|
+
- Legacy ES5 💀
|
|
51
|
+
|
|
52
|
+
## Examples
|
|
53
|
+
|
|
54
|
+
Checkout the [examples directory](../../examples) to see various apps with the extended ESLint
|
|
55
|
+
configuration.
|
|
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
|
+
```
|
|
96
72
|
|
|
97
|
-
|
|
73
|
+
Or you can pass `true` to the `silenceDependencyWarning` function to silence all
|
|
74
|
+
warnings.
|
|
98
75
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
| **Legacy ES5 💀** | [`legacy-dom`](./src/configs/legacy-dom#readme) | [`legacy`](./src/configs/legacy#readme) |
|
|
76
|
+
However, this is not recommended as it may cause unexpected issues while
|
|
77
|
+
maintaining the dependencies.
|
|
102
78
|
|
|
103
|
-
|
|
79
|
+
```js
|
|
80
|
+
import { useInsider, silenceDependencyWarning } from '@useinsider/eslint-config';
|
|
104
81
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
| **Vue 2** | [`vue2`](./src/configs/vue2#readme) | [`vue2-typescript`](./src/configs/vue2-typescript#readme) |
|
|
82
|
+
silenceDependencyWarning(true);
|
|
83
|
+
```
|
|
108
84
|
|
|
109
85
|
## Contributing
|
|
110
86
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const o=require("node:path"),t=require("node:url"),i=require("@eslint/eslintrc"),c=require("@eslint/js"),e=require("./main.cjs");var r=typeof document<"u"?document.currentScript:null;const s=new i.FlatCompat({baseDirectory:o.dirname(t.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:r&&r.src||new URL("base-BQL2gY6S.cjs",document.baseURI).href))});function u(n=[]){return e.merge(c.configs.recommended,e.mergeAll(s.plugins("import","@stylistic","@stylistic/migrate","@cspell",...n)))}function f(){return e.merge({languageOptions:{ecmaVersion:2022},rules:{"jsdoc/require-param":"off","jsdoc/require-jsdoc":"off","jsdoc/require-returns":"off","jsdoc/require-param-type":"off","jsdoc/check-param-names":"off"}})}exports.postConfig=f;exports.preConfig=u;
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const c=require("node:path"),o=require("node:url"),i=require("@eslint/eslintrc"),n=require("./main.cjs");var r=typeof document<"u"?document.currentScript:null;const t=new i.FlatCompat({baseDirectory:c.dirname(o.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:r&&r.src||new URL("compat-CZyl_Sy0.cjs",document.baseURI).href))}),l={extends:(...e)=>n.mergeAll(t.extends(...e)),config:e=>n.mergeAll(t.config(e)),plugins:(...e)=>n.mergeAll(t.plugins(...e)),env:e=>n.mergeAll(t.env(e))};exports.compat=l;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { dirname as m } from "node:path";
|
|
2
|
+
import { fileURLToPath as r } from "node:url";
|
|
3
|
+
import { FlatCompat as i } from "@eslint/eslintrc";
|
|
4
|
+
import { mergeAll as t } from "./main.js";
|
|
5
|
+
const e = new i({
|
|
6
|
+
baseDirectory: m(r(import.meta.url))
|
|
7
|
+
}), l = {
|
|
8
|
+
extends: (...o) => t(e.extends(...o)),
|
|
9
|
+
config: (o) => t(e.config(o)),
|
|
10
|
+
plugins: (...o) => t(e.plugins(...o)),
|
|
11
|
+
env: (o) => t(e.env(o))
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
l as c
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
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;
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("node:path"),t=require("node:url"),u=require("@eslint/eslintrc"),c=require("eslint-plugin-jsdoc"),i=require("globals"),s=require("./base-BQL2gY6S.cjs"),l=require("./rules/core.cjs"),d=require("./rules/cspell.cjs"),a=require("./rules/importRules.cjs"),m=require("./rules/jsdoc.cjs"),p=require("./rules/stylistic.cjs"),g=require("./rules/vue.cjs"),e=require("./main.cjs");var n=typeof document<"u"?document.currentScript:null;const r=new u.FlatCompat({baseDirectory:o.dirname(t.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:n&&n.src||new URL("index-BPS1S4-r.cjs",document.baseURI).href))}),f=e.merge(e.mergeAll(r.extends("airbnb-base","plugin:vue/vue3-recommended","plugin:vue-scoped-css/vue3-recommended")),c.configs["flat/recommended"],e.mergeAll(r.extends("plugin:@cspell/recommended")),s.preConfig(["vue","vue-scoped-css"]),l,a,d,p,m,g,s.postConfig(),e.mergeAll(r.config({parser:"vue-eslint-parser"})),{languageOptions:{parserOptions:{sourceType:"module",ecmaFeatures:{jsx:!0},extraFileExtensions:[".vue"]},globals:{...i.browser}}});exports.default=f;
|
|
@@ -2,16 +2,18 @@ import { dirname as r } from "node:path";
|
|
|
2
2
|
import { fileURLToPath as m } from "node:url";
|
|
3
3
|
import { FlatCompat as s } from "@eslint/eslintrc";
|
|
4
4
|
import t from "eslint-plugin-jsdoc";
|
|
5
|
-
import
|
|
6
|
-
import n from "./
|
|
5
|
+
import i from "globals";
|
|
6
|
+
import { p, a as n } from "./base-Dd7loOAV.js";
|
|
7
|
+
import a from "./rules/core.js";
|
|
7
8
|
import l from "./rules/cspell.js";
|
|
8
|
-
import c from "./rules/
|
|
9
|
+
import c from "./rules/importRules.js";
|
|
10
|
+
import f from "./rules/jsdoc.js";
|
|
9
11
|
import u from "./rules/stylistic.js";
|
|
10
|
-
import d from "./rules/
|
|
11
|
-
import {
|
|
12
|
+
import d from "./rules/vue2.js";
|
|
13
|
+
import { merge as g, mergeAll as e } from "./main.js";
|
|
12
14
|
const o = new s({
|
|
13
15
|
baseDirectory: r(m(import.meta.url))
|
|
14
|
-
}),
|
|
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({
|
|
15
17
|
parser: "vue-eslint-parser"
|
|
16
18
|
})), {
|
|
17
19
|
languageOptions: {
|
|
@@ -28,5 +30,5 @@ const o = new s({
|
|
|
28
30
|
}
|
|
29
31
|
});
|
|
30
32
|
export {
|
|
31
|
-
|
|
33
|
+
A as default
|
|
32
34
|
};
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { dirname as m } from "node:path";
|
|
2
|
+
import { fileURLToPath as t } from "node:url";
|
|
3
|
+
import { FlatCompat as e } from "@eslint/eslintrc";
|
|
4
|
+
import i from "eslint-plugin-jsdoc";
|
|
5
|
+
import { p, a as s } from "./base-Dd7loOAV.js";
|
|
6
|
+
import f from "./rules/core.js";
|
|
7
|
+
import a from "./rules/cspell.js";
|
|
8
|
+
import l from "./rules/importRules.js";
|
|
9
|
+
import n from "./rules/jsdoc.js";
|
|
10
|
+
import c from "./rules/stylistic.js";
|
|
11
|
+
import { merge as d, mergeAll as o } from "./main.js";
|
|
12
|
+
const r = new e({
|
|
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());
|
|
15
|
+
export {
|
|
16
|
+
w as default
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@eslint/js"),a=require("eslint-plugin-jsdoc"),p=require("eslint-plugin-vue"),d=require("eslint-plugin-vue-scoped-css"),m=require("globals"),s=require("typescript-eslint"),t=require("./base-BQL2gY6S.cjs"),g=require("./rules/core.cjs"),b=require("./rules/cspell.cjs"),q=require("./rules/importRules.cjs"),f=require("./rules/jsdoc.cjs"),y=require("./rules/stylistic.cjs"),_=require("./rules/typescript.cjs"),j=require("./rules/vue.cjs"),i=require("./compat-CZyl_Sy0.cjs"),e=require("./main.cjs"),u=e.merge(i.compat.extends("airbnb-base","airbnb-typescript/base"));var n,o,c;(c=(o=(n=u.languageOptions)==null?void 0:n.parserOptions)==null?void 0:o.ecmaFeatures)==null||delete c.globalReturn;const x=e.mergeAll(s.config(l.configs.recommended,u,...s.configs.recommended,...p.configs["flat/recommended"].map(r=>(delete r.files,r)),...d.configs["flat/recommended"],a.configs["flat/recommended-typescript-error"],e.merge(i.compat.extends("plugin:@cspell/recommended"),t.preConfig(),g,q,b,y,f,j,_,t.postConfig(),{languageOptions:{globals:{...m.browser},parserOptions:{parser:"@typescript-eslint/parser",sourceType:"module",ecmaFeatures:{jsx:!0},extraFileExtensions:[".vue"]}},settings:{jsdoc:{mode:"typescript",tagNamePreference:{callback:"watch",desc:"use"}}}})));exports.default=x;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@eslint/js"),l=require("eslint-plugin-jsdoc"),e=require("typescript-eslint"),s=require("./base-BQL2gY6S.cjs"),p=require("./rules/core.cjs"),a=require("./rules/cspell.cjs"),d=require("./rules/importRules.cjs"),m=require("./rules/jsdoc.cjs"),g=require("./rules/stylistic.cjs"),b=require("./rules/typescript.cjs"),n=require("./compat-CZyl_Sy0.cjs"),r=require("./main.cjs"),i=r.merge(n.compat.extends("airbnb-base","airbnb-typescript/base"));var t,c,o;(o=(c=(t=i.languageOptions)==null?void 0:t.parserOptions)==null?void 0:c.ecmaFeatures)==null||delete o.globalReturn;const q=r.mergeAll(e.config(u.configs.recommended,i,...e.configs.recommended,...e.configs.recommendedTypeChecked,l.configs["flat/recommended-typescript-error"],r.merge(n.compat.extends("plugin:@cspell/recommended"),s.preConfig(),p,d,a,g,m,b,s.postConfig(),{settings:{jsdoc:{mode:"typescript",tagNamePreference:{callback:"watch",desc:"use"}},"import/resolver":{typescript:!0,node:!0}}})));exports.default=q;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import n from "@eslint/js";
|
|
2
|
+
import a from "eslint-plugin-jsdoc";
|
|
3
|
+
import c from "eslint-plugin-vue";
|
|
4
|
+
import l from "eslint-plugin-vue-scoped-css";
|
|
5
|
+
import f from "globals";
|
|
6
|
+
import r from "typescript-eslint";
|
|
7
|
+
import { p as d, a as g } from "./base-Dd7loOAV.js";
|
|
8
|
+
import u from "./rules/core.js";
|
|
9
|
+
import b from "./rules/cspell.js";
|
|
10
|
+
import x from "./rules/importRules.js";
|
|
11
|
+
import y from "./rules/jsdoc.js";
|
|
12
|
+
import j from "./rules/stylistic.js";
|
|
13
|
+
import O from "./rules/typescript.js";
|
|
14
|
+
import P from "./rules/vue.js";
|
|
15
|
+
import { c as m } from "./compat-DfBTP0AK.js";
|
|
16
|
+
import { mergeAll as C, merge as i } from "./main.js";
|
|
17
|
+
const p = i(m.extends("airbnb-base", "airbnb-typescript/base"));
|
|
18
|
+
var o, t, s;
|
|
19
|
+
(s = (t = (o = p.languageOptions) == null ? void 0 : o.parserOptions) == null ? void 0 : t.ecmaFeatures) == null || delete s.globalReturn;
|
|
20
|
+
const G = C(r.config(
|
|
21
|
+
n.configs.recommended,
|
|
22
|
+
p,
|
|
23
|
+
...r.configs.recommended,
|
|
24
|
+
...c.configs["flat/recommended"].map((e) => (delete e.files, e)),
|
|
25
|
+
...l.configs["flat/recommended"],
|
|
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
|
|
37
|
+
},
|
|
38
|
+
extraFileExtensions: [".vue"]
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
settings: {
|
|
42
|
+
jsdoc: {
|
|
43
|
+
mode: "typescript",
|
|
44
|
+
tagNamePreference: {
|
|
45
|
+
callback: "watch",
|
|
46
|
+
desc: "use"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
})
|
|
51
|
+
));
|
|
52
|
+
export {
|
|
53
|
+
G as default
|
|
54
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("globals"),t=require("./main.cjs"),n=require("./index-CCngt07f.cjs"),o=t.merge(n.default,{languageOptions:{globals:{...e.node}}});exports.default=o;
|
|
@@ -0,0 +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 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 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("node:path"),t=require("node:url"),u=require("@eslint/eslintrc"),c=require("eslint-plugin-jsdoc"),i=require("globals"),s=require("./base-BQL2gY6S.cjs"),l=require("./rules/core.cjs"),d=require("./rules/cspell.cjs"),a=require("./rules/importRules.cjs"),m=require("./rules/jsdoc.cjs"),p=require("./rules/stylistic.cjs"),g=require("./rules/vue2.cjs"),e=require("./main.cjs");var n=typeof document<"u"?document.currentScript:null;const r=new u.FlatCompat({baseDirectory:o.dirname(t.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:n&&n.src||new URL("index-DLjVlGbl.cjs",document.baseURI).href))}),f=e.merge(e.mergeAll(r.extends("airbnb-base","plugin:vue/recommended","plugin:vue-scoped-css/recommended")),c.configs["flat/recommended"],e.mergeAll(r.extends("plugin:@cspell/recommended")),s.preConfig(["vue","vue-scoped-css"]),l,a,d,p,m,g,s.postConfig(),e.mergeAll(r.config({parser:"vue-eslint-parser"})),{languageOptions:{parserOptions:{sourceType:"module",ecmaFeatures:{jsx:!0},extraFileExtensions:[".vue"]},globals:{...i.browser}}});exports.default=f;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("globals"),r=require("./main.cjs"),t=require("./index-CCngt07f.cjs"),o=r.merge(t.default,{languageOptions:{globals:{...e.browser}}});exports.default=o;
|
package/dist/main.cjs
CHANGED
|
@@ -1 +1,5 @@
|
|
|
1
|
-
"use strict";const e=require("
|
|
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.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { Linter } from 'eslint';
|
|
2
2
|
declare const configMap: {
|
|
3
|
-
node(): Promise<typeof import("./configs/node")>;
|
|
4
3
|
config(): Promise<typeof import("./configs/config")>;
|
|
5
|
-
|
|
4
|
+
javascript(): Promise<typeof import("./configs/javascript")>;
|
|
5
|
+
'javascript-node'(): Promise<typeof import("./configs/javascript-node")>;
|
|
6
|
+
'javascript-dom'(): Promise<typeof import("./configs/javascript-dom")>;
|
|
6
7
|
typescript(): Promise<typeof import("./configs/typescript")>;
|
|
8
|
+
'typescript-node'(): Promise<typeof import("./configs/typescript-node")>;
|
|
7
9
|
'typescript-dom'(): Promise<typeof import("./configs/typescript-dom")>;
|
|
8
10
|
vue3(): Promise<typeof import("./configs/vue3")>;
|
|
9
11
|
'vue3-typescript'(): Promise<typeof import("./configs/vue3-typescript")>;
|
|
@@ -14,5 +16,7 @@ interface Config {
|
|
|
14
16
|
preset: (keyof typeof configMap)[];
|
|
15
17
|
config: Linter.FlatConfig;
|
|
16
18
|
}
|
|
17
|
-
export
|
|
18
|
-
export {};
|
|
19
|
+
export declare function useInsider(config: Config): Promise<Linter.FlatConfig>;
|
|
20
|
+
export { merge } from './utils/merge';
|
|
21
|
+
export { mergeAll } from './utils/mergeAllConfig';
|
|
22
|
+
export { silenceDependencyWarning } from './utils/ensureDependencies';
|