@leexi/shared 0.2.1 → 0.3.1
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 +143 -0
- package/dist/eslint/{vue.d.ts → base.eslint.config.d.ts} +62 -27
- package/dist/eslint/base.eslint.config.mjs +123 -0
- package/dist/eslint/{base.d.ts → vue.eslint.config.d.ts} +101 -5
- package/dist/eslint/vue.eslint.config.mjs +48 -0
- package/dist/module.d.mts +11 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +39 -0
- package/dist/runtime/composables/index.d.ts +1 -0
- package/dist/runtime/composables/index.js +1 -0
- package/dist/{composables → runtime/composables}/useLocalStorage.d.ts +4 -3
- package/dist/runtime/composables/useLocalStorage.js +12 -0
- package/dist/runtime/utils/index.d.ts +3 -0
- package/dist/runtime/utils/index.js +3 -0
- package/dist/{utils → runtime/utils}/objects/deepDup.d.ts +0 -3
- package/dist/runtime/utils/objects/deepDup.js +17 -0
- package/dist/runtime/utils/objects/index.js +2 -0
- package/dist/{utils → runtime/utils}/objects/isSame.d.ts +0 -4
- package/dist/runtime/utils/objects/isSame.js +1 -0
- package/dist/runtime/utils/records/index.d.ts +1 -0
- package/dist/runtime/utils/records/index.js +1 -0
- package/dist/runtime/utils/records/set.d.ts +19 -0
- package/dist/runtime/utils/records/set.js +5 -0
- package/dist/runtime/utils/strings/capitalize.d.ts +7 -0
- package/dist/runtime/utils/strings/capitalize.js +1 -0
- package/dist/runtime/utils/strings/index.d.ts +1 -0
- package/dist/runtime/utils/strings/index.js +1 -0
- package/dist/types.d.mts +7 -0
- package/package.json +33 -19
- package/dist/composables/index.d.ts +0 -1
- package/dist/composables/index.js +0 -1
- package/dist/composables/useLocalStorage.js +0 -27
- package/dist/eslint/base.js +0 -110
- package/dist/eslint/vue.js +0 -43
- package/dist/module.d.ts +0 -8
- package/dist/module.js +0 -36
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.js +0 -1
- package/dist/utils/objects/deepDup.js +0 -28
- package/dist/utils/objects/index.js +0 -2
- package/dist/utils/objects/isSame.js +0 -12
- /package/dist/{utils → runtime/utils}/objects/index.d.ts +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
<p align="center"><img src="https://github.com/user-attachments/assets/581a8322-430f-4912-bc11-60fc0ca099f4" width="500"></p><br><br><br>
|
|
2
|
+
|
|
3
|
+
`@leexi/shared` is a collection of config files and utility functions for JavaScript or TypeScript based repositories as well as composables and components for Vue based repositores of the [Leexi-ai](https://github.com/Leexi-ai) organisation.
|
|
4
|
+
|
|
5
|
+
# Installation
|
|
6
|
+
```bash
|
|
7
|
+
yarn add -D @leexi/shared
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
# Usage
|
|
11
|
+
## esLint
|
|
12
|
+
There are 2 available esLint configs.
|
|
13
|
+
- **[base](https://github.com/Leexi-ai/shared/blob/master/src/eslint/base.eslint.config.ts)**: for JavaScript/TypeScript based repositories
|
|
14
|
+
- **[vue](https://github.com/Leexi-ai/shared/blob/master/src/eslint/vue.eslint.config.ts)**: for Vue based repositories
|
|
15
|
+
```js
|
|
16
|
+
// eslint.config.js
|
|
17
|
+
import base from '@leexi/shared/eslint/base';
|
|
18
|
+
|
|
19
|
+
export default [
|
|
20
|
+
...base,
|
|
21
|
+
{
|
|
22
|
+
// add custom config here
|
|
23
|
+
}
|
|
24
|
+
];
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Utils
|
|
28
|
+
```js
|
|
29
|
+
import { deepDup, isSame, set } from '@leexi/shared/utils';
|
|
30
|
+
|
|
31
|
+
const foo = { foo: 'bar' };
|
|
32
|
+
const dup = deepDup(foo);
|
|
33
|
+
if (isSame(foo, dup)) {
|
|
34
|
+
set(foo, ['foo'], 'fiz');
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Composables
|
|
39
|
+
```vue
|
|
40
|
+
<script setup>
|
|
41
|
+
import { useLocalStorage } from '@leexi/shared/composables'
|
|
42
|
+
|
|
43
|
+
const mode = useLocalStorage('mode', 'dark')
|
|
44
|
+
</script>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Nuxt
|
|
48
|
+
This package provides a module for Nuxt to auto import every component, composable and util in a Nuxt based repository
|
|
49
|
+
```js
|
|
50
|
+
// nuxt.config.ts
|
|
51
|
+
export default defineNuxtConfig({
|
|
52
|
+
modules: [
|
|
53
|
+
'@leexi/shared'
|
|
54
|
+
],
|
|
55
|
+
|
|
56
|
+
leexi: {
|
|
57
|
+
composables: true, // whether composables should be auto-imported. Defaults to true
|
|
58
|
+
utils: true, // whether utils should be auto-imported. Defaults to true
|
|
59
|
+
}
|
|
60
|
+
})
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
# API
|
|
64
|
+
- [Composables](#composables)
|
|
65
|
+
- [useLocalStorage](#uselocalstorage)
|
|
66
|
+
- [Utils](#utils)
|
|
67
|
+
- [Records](#records)
|
|
68
|
+
- [set](#set)
|
|
69
|
+
- [Strings](#strings)
|
|
70
|
+
- [capitalize](#capitalize)
|
|
71
|
+
- [Objects](#objects)
|
|
72
|
+
- [deepDup](#deepdup)
|
|
73
|
+
- [isSame](#issame)
|
|
74
|
+
|
|
75
|
+
## Composables
|
|
76
|
+
### useLocalStorage
|
|
77
|
+
Creates a reactive pointer to a specific localStorage value.
|
|
78
|
+
The value is stored in the localStorage as a JSON stringified data to enable parsing primitives and objects
|
|
79
|
+
- Type
|
|
80
|
+
```ts
|
|
81
|
+
const useLocalStorage: <T>(key: string, defaultValue?: T) => Ref<undefined | T>;
|
|
82
|
+
```
|
|
83
|
+
- Example
|
|
84
|
+
```ts
|
|
85
|
+
const fooOne = useLocalStorage('foo')
|
|
86
|
+
const fooTwo = useLocalStorage('foo', 'bar')
|
|
87
|
+
fooOne.value // => 'bar'
|
|
88
|
+
localStorage.foo // => '"bar"'
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Utils
|
|
92
|
+
### Records
|
|
93
|
+
#### set
|
|
94
|
+
Deeply sets an attribute at a specified path within a nested object.
|
|
95
|
+
**This method is destructive.**
|
|
96
|
+
- Type
|
|
97
|
+
```ts
|
|
98
|
+
const set: <T extends Record<string, unknown>, const P extends string[], V>(record: T, path: P, value: V) => SetRecord<T, P, V>;
|
|
99
|
+
```
|
|
100
|
+
- Example
|
|
101
|
+
```ts
|
|
102
|
+
const foo = {}
|
|
103
|
+
set(foo, ['bar', 'biz'], 'fiz')
|
|
104
|
+
foo // => { bar: { biz: 'fiz' } }
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Strings
|
|
108
|
+
#### capitalize
|
|
109
|
+
Capitalizes a string
|
|
110
|
+
- Type
|
|
111
|
+
```ts
|
|
112
|
+
const capitalize: (string?: string) => string;
|
|
113
|
+
```
|
|
114
|
+
- Example
|
|
115
|
+
```ts
|
|
116
|
+
capitalize('foo') // => 'Foo'
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Objects
|
|
120
|
+
#### deepDup
|
|
121
|
+
Deeply duplicates an object.
|
|
122
|
+
- Type
|
|
123
|
+
```ts
|
|
124
|
+
const deepDup: <T extends object>(object: T) => T;
|
|
125
|
+
```
|
|
126
|
+
- Example
|
|
127
|
+
```ts
|
|
128
|
+
const object = [{ foo: 'bar' }]
|
|
129
|
+
const dup = deepDup(object) // => `[{ foo: 'bar' }]`
|
|
130
|
+
object === dup // => `false`
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
#### isSame
|
|
134
|
+
Compares whether two objects are identical.
|
|
135
|
+
- Type
|
|
136
|
+
```ts
|
|
137
|
+
const isSame: (a: object, b: object) => boolean;
|
|
138
|
+
```
|
|
139
|
+
- Example
|
|
140
|
+
```ts
|
|
141
|
+
isSame([{ foo: 'bar' }], [{ foo: 'bar' }]) // => `true`
|
|
142
|
+
isSame([{ foo: 'bar' }], [{ bar: 'foo' }]) // => `false`
|
|
143
|
+
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const _default: ({
|
|
2
2
|
readonly rules: Readonly<import("eslint").Linter.RulesRecord>;
|
|
3
|
-
} | import("@typescript-eslint/utils/ts-eslint").FlatConfig.Config |
|
|
3
|
+
} | import("@typescript-eslint/utils/ts-eslint").FlatConfig.Config | {
|
|
4
4
|
languageOptions: {
|
|
5
5
|
globals: {
|
|
6
6
|
__dirname: false;
|
|
@@ -1162,6 +1162,7 @@ declare const _default: ({
|
|
|
1162
1162
|
'arrow-body-style': string[];
|
|
1163
1163
|
eqeqeq: string[];
|
|
1164
1164
|
'no-console': string;
|
|
1165
|
+
'no-nested-ternary': string;
|
|
1165
1166
|
'no-unused-vars': (string | {
|
|
1166
1167
|
argsIgnorePattern: string;
|
|
1167
1168
|
destructuredArrayIgnorePattern: string;
|
|
@@ -1172,6 +1173,7 @@ declare const _default: ({
|
|
|
1172
1173
|
})[];
|
|
1173
1174
|
'prefer-template': string;
|
|
1174
1175
|
'@stylistic/js/array-bracket-spacing': string[];
|
|
1176
|
+
'@stylistic/js/arrow-parens': string[];
|
|
1175
1177
|
'@stylistic/js/comma-dangle': string[];
|
|
1176
1178
|
'@stylistic/js/comma-spacing': string;
|
|
1177
1179
|
'@stylistic/js/eol-last': string[];
|
|
@@ -1180,14 +1182,15 @@ declare const _default: ({
|
|
|
1180
1182
|
})[];
|
|
1181
1183
|
'@stylistic/js/key-spacing': string;
|
|
1182
1184
|
'@stylistic/js/keyword-spacing': string;
|
|
1185
|
+
'@stylistic/js/multiline-ternary': string[];
|
|
1183
1186
|
'@stylistic/js/no-multi-spaces': string;
|
|
1184
1187
|
'@stylistic/js/no-multiple-empty-lines': (string | {
|
|
1185
1188
|
max: number;
|
|
1186
1189
|
})[];
|
|
1187
1190
|
'@stylistic/js/no-trailing-spaces': string;
|
|
1188
1191
|
'@stylistic/js/object-curly-spacing': string[];
|
|
1189
|
-
'@stylistic/js/quotes': string[];
|
|
1190
1192
|
'@stylistic/js/quote-props': string[];
|
|
1193
|
+
'@stylistic/js/quotes': string[];
|
|
1191
1194
|
'@stylistic/js/semi': string[];
|
|
1192
1195
|
'@stylistic/js/semi-spacing': string;
|
|
1193
1196
|
'@stylistic/js/space-before-blocks': string[];
|
|
@@ -1208,12 +1211,13 @@ declare const _default: ({
|
|
|
1208
1211
|
'@stylistic/ts/key-spacing'?: undefined;
|
|
1209
1212
|
'@stylistic/ts/keyword-spacing'?: undefined;
|
|
1210
1213
|
'@stylistic/ts/object-curly-spacing'?: undefined;
|
|
1211
|
-
'@stylistic/ts/quotes'?: undefined;
|
|
1212
1214
|
'@stylistic/ts/quote-props'?: undefined;
|
|
1215
|
+
'@stylistic/ts/quotes'?: undefined;
|
|
1213
1216
|
'@stylistic/ts/semi'?: undefined;
|
|
1214
1217
|
'@stylistic/ts/space-before-blocks'?: undefined;
|
|
1215
1218
|
'@stylistic/ts/space-before-function-paren'?: undefined;
|
|
1216
1219
|
'@stylistic/ts/space-infix-ops'?: undefined;
|
|
1220
|
+
'sort-keys'?: undefined;
|
|
1217
1221
|
};
|
|
1218
1222
|
files?: undefined;
|
|
1219
1223
|
} | {
|
|
@@ -1236,8 +1240,8 @@ declare const _default: ({
|
|
|
1236
1240
|
'@stylistic/js/key-spacing': string;
|
|
1237
1241
|
'@stylistic/js/keyword-spacing': string;
|
|
1238
1242
|
'@stylistic/js/object-curly-spacing': string;
|
|
1239
|
-
'@stylistic/js/quotes': string;
|
|
1240
1243
|
'@stylistic/js/quote-props': string;
|
|
1244
|
+
'@stylistic/js/quotes': string;
|
|
1241
1245
|
'@stylistic/js/semi': string;
|
|
1242
1246
|
'@stylistic/js/space-before-blocks': string;
|
|
1243
1247
|
'@stylistic/js/space-before-function-paren': string;
|
|
@@ -1250,8 +1254,8 @@ declare const _default: ({
|
|
|
1250
1254
|
'@stylistic/ts/key-spacing': string;
|
|
1251
1255
|
'@stylistic/ts/keyword-spacing': string;
|
|
1252
1256
|
'@stylistic/ts/object-curly-spacing': string[];
|
|
1253
|
-
'@stylistic/ts/quotes': string[];
|
|
1254
1257
|
'@stylistic/ts/quote-props': string[];
|
|
1258
|
+
'@stylistic/ts/quotes': string[];
|
|
1255
1259
|
'@stylistic/ts/semi': string[];
|
|
1256
1260
|
'@stylistic/ts/space-before-blocks': string[];
|
|
1257
1261
|
'@stylistic/ts/space-before-function-paren': string[];
|
|
@@ -1259,11 +1263,14 @@ declare const _default: ({
|
|
|
1259
1263
|
'arrow-body-style'?: undefined;
|
|
1260
1264
|
eqeqeq?: undefined;
|
|
1261
1265
|
'no-console'?: undefined;
|
|
1266
|
+
'no-nested-ternary'?: undefined;
|
|
1262
1267
|
'no-unused-vars'?: undefined;
|
|
1263
1268
|
'prefer-const'?: undefined;
|
|
1264
1269
|
'prefer-template'?: undefined;
|
|
1265
1270
|
'@stylistic/js/array-bracket-spacing'?: undefined;
|
|
1271
|
+
'@stylistic/js/arrow-parens'?: undefined;
|
|
1266
1272
|
'@stylistic/js/eol-last'?: undefined;
|
|
1273
|
+
'@stylistic/js/multiline-ternary'?: undefined;
|
|
1267
1274
|
'@stylistic/js/no-multi-spaces'?: undefined;
|
|
1268
1275
|
'@stylistic/js/no-multiple-empty-lines'?: undefined;
|
|
1269
1276
|
'@stylistic/js/no-trailing-spaces'?: undefined;
|
|
@@ -1273,34 +1280,62 @@ declare const _default: ({
|
|
|
1273
1280
|
'@stylistic/js/template-curly-spacing'?: undefined;
|
|
1274
1281
|
'@typescript-eslint/no-unused-expressions'?: undefined;
|
|
1275
1282
|
'@typescript-eslint/no-unused-vars'?: undefined;
|
|
1283
|
+
'sort-keys'?: undefined;
|
|
1276
1284
|
};
|
|
1277
1285
|
languageOptions?: undefined;
|
|
1278
1286
|
} | {
|
|
1279
1287
|
files: string[];
|
|
1280
1288
|
rules: {
|
|
1281
|
-
'
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
'vue/attributes-order': (string | {
|
|
1285
|
-
alphabetical: boolean;
|
|
1286
|
-
})[];
|
|
1287
|
-
'vue/component-name-in-template-casing': (string | {
|
|
1288
|
-
registeredComponentsOnly: boolean;
|
|
1289
|
+
'sort-keys': (string | {
|
|
1290
|
+
allowLineSeparatedGroups: boolean;
|
|
1291
|
+
natural: boolean;
|
|
1289
1292
|
})[];
|
|
1290
|
-
'
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
'
|
|
1294
|
-
'
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
'
|
|
1298
|
-
'
|
|
1299
|
-
'
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
'
|
|
1293
|
+
'arrow-body-style'?: undefined;
|
|
1294
|
+
eqeqeq?: undefined;
|
|
1295
|
+
'no-console'?: undefined;
|
|
1296
|
+
'no-nested-ternary'?: undefined;
|
|
1297
|
+
'no-unused-vars'?: undefined;
|
|
1298
|
+
'prefer-const'?: undefined;
|
|
1299
|
+
'prefer-template'?: undefined;
|
|
1300
|
+
'@stylistic/js/array-bracket-spacing'?: undefined;
|
|
1301
|
+
'@stylistic/js/arrow-parens'?: undefined;
|
|
1302
|
+
'@stylistic/js/comma-dangle'?: undefined;
|
|
1303
|
+
'@stylistic/js/comma-spacing'?: undefined;
|
|
1304
|
+
'@stylistic/js/eol-last'?: undefined;
|
|
1305
|
+
'@stylistic/js/indent'?: undefined;
|
|
1306
|
+
'@stylistic/js/key-spacing'?: undefined;
|
|
1307
|
+
'@stylistic/js/keyword-spacing'?: undefined;
|
|
1308
|
+
'@stylistic/js/multiline-ternary'?: undefined;
|
|
1309
|
+
'@stylistic/js/no-multi-spaces'?: undefined;
|
|
1310
|
+
'@stylistic/js/no-multiple-empty-lines'?: undefined;
|
|
1311
|
+
'@stylistic/js/no-trailing-spaces'?: undefined;
|
|
1312
|
+
'@stylistic/js/object-curly-spacing'?: undefined;
|
|
1313
|
+
'@stylistic/js/quote-props'?: undefined;
|
|
1314
|
+
'@stylistic/js/quotes'?: undefined;
|
|
1315
|
+
'@stylistic/js/semi'?: undefined;
|
|
1316
|
+
'@stylistic/js/semi-spacing'?: undefined;
|
|
1317
|
+
'@stylistic/js/space-before-blocks'?: undefined;
|
|
1318
|
+
'@stylistic/js/space-before-function-paren'?: undefined;
|
|
1319
|
+
'@stylistic/js/space-in-parens'?: undefined;
|
|
1320
|
+
'@stylistic/js/space-infix-ops'?: undefined;
|
|
1321
|
+
'@stylistic/js/spaced-comment'?: undefined;
|
|
1322
|
+
'@stylistic/js/template-curly-spacing'?: undefined;
|
|
1323
|
+
'@typescript-eslint/no-unused-expressions'?: undefined;
|
|
1324
|
+
'@typescript-eslint/no-unused-vars'?: undefined;
|
|
1325
|
+
'@stylistic/ts/comma-dangle'?: undefined;
|
|
1326
|
+
'@stylistic/ts/comma-spacing'?: undefined;
|
|
1327
|
+
'@stylistic/ts/indent'?: undefined;
|
|
1328
|
+
'@stylistic/ts/key-spacing'?: undefined;
|
|
1329
|
+
'@stylistic/ts/keyword-spacing'?: undefined;
|
|
1330
|
+
'@stylistic/ts/object-curly-spacing'?: undefined;
|
|
1331
|
+
'@stylistic/ts/quote-props'?: undefined;
|
|
1332
|
+
'@stylistic/ts/quotes'?: undefined;
|
|
1333
|
+
'@stylistic/ts/semi'?: undefined;
|
|
1334
|
+
'@stylistic/ts/space-before-blocks'?: undefined;
|
|
1335
|
+
'@stylistic/ts/space-before-function-paren'?: undefined;
|
|
1336
|
+
'@stylistic/ts/space-infix-ops'?: undefined;
|
|
1304
1337
|
};
|
|
1338
|
+
languageOptions?: undefined;
|
|
1339
|
+
plugins?: undefined;
|
|
1305
1340
|
})[];
|
|
1306
1341
|
export default _default;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import js from "@eslint/js";
|
|
2
|
+
import stylisticJS from "@stylistic/eslint-plugin-js";
|
|
3
|
+
import stylisticTS from "@stylistic/eslint-plugin-ts";
|
|
4
|
+
import globals from "globals";
|
|
5
|
+
import tseslint from "typescript-eslint";
|
|
6
|
+
export default [
|
|
7
|
+
js.configs.recommended,
|
|
8
|
+
...tseslint.configs.recommended,
|
|
9
|
+
// base config
|
|
10
|
+
{
|
|
11
|
+
languageOptions: {
|
|
12
|
+
globals: {
|
|
13
|
+
...globals.browser,
|
|
14
|
+
...globals.node
|
|
15
|
+
},
|
|
16
|
+
parserOptions: {
|
|
17
|
+
ecmaVersion: "latest",
|
|
18
|
+
sourceType: "module"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
plugins: {
|
|
22
|
+
"@stylistic/js": stylisticJS
|
|
23
|
+
},
|
|
24
|
+
rules: {
|
|
25
|
+
"arrow-body-style": ["error", "as-needed"],
|
|
26
|
+
"eqeqeq": ["error", "smart"],
|
|
27
|
+
"no-console": "error",
|
|
28
|
+
"no-nested-ternary": "error",
|
|
29
|
+
"no-unused-vars": ["error", {
|
|
30
|
+
argsIgnorePattern: "^_",
|
|
31
|
+
destructuredArrayIgnorePattern: "^_",
|
|
32
|
+
ignoreRestSiblings: true
|
|
33
|
+
}],
|
|
34
|
+
"prefer-const": ["error", {
|
|
35
|
+
destructuring: "all"
|
|
36
|
+
}],
|
|
37
|
+
"prefer-template": "error",
|
|
38
|
+
"@stylistic/js/array-bracket-spacing": ["error", "never"],
|
|
39
|
+
"@stylistic/js/arrow-parens": ["error", "as-needed"],
|
|
40
|
+
"@stylistic/js/comma-dangle": ["error", "always-multiline"],
|
|
41
|
+
"@stylistic/js/comma-spacing": "error",
|
|
42
|
+
"@stylistic/js/eol-last": ["error", "always"],
|
|
43
|
+
"@stylistic/js/indent": ["error", 2, {
|
|
44
|
+
SwitchCase: 1
|
|
45
|
+
}],
|
|
46
|
+
"@stylistic/js/key-spacing": "error",
|
|
47
|
+
"@stylistic/js/keyword-spacing": "error",
|
|
48
|
+
"@stylistic/js/multiline-ternary": ["error", "never"],
|
|
49
|
+
"@stylistic/js/no-multi-spaces": "error",
|
|
50
|
+
"@stylistic/js/no-multiple-empty-lines": ["error", {
|
|
51
|
+
max: 1
|
|
52
|
+
}],
|
|
53
|
+
"@stylistic/js/no-trailing-spaces": "error",
|
|
54
|
+
"@stylistic/js/object-curly-spacing": ["error", "always"],
|
|
55
|
+
"@stylistic/js/quote-props": ["error", "consistent-as-needed"],
|
|
56
|
+
"@stylistic/js/quotes": ["error", "single"],
|
|
57
|
+
"@stylistic/js/semi": ["error", "always"],
|
|
58
|
+
"@stylistic/js/semi-spacing": "error",
|
|
59
|
+
"@stylistic/js/space-before-blocks": ["error", "always"],
|
|
60
|
+
"@stylistic/js/space-before-function-paren": ["error", "always"],
|
|
61
|
+
"@stylistic/js/space-in-parens": ["error", "never"],
|
|
62
|
+
"@stylistic/js/space-infix-ops": "error",
|
|
63
|
+
"@stylistic/js/spaced-comment": "error",
|
|
64
|
+
"@stylistic/js/template-curly-spacing": ["error", "never"],
|
|
65
|
+
"@typescript-eslint/no-unused-expressions": "off",
|
|
66
|
+
"@typescript-eslint/no-unused-vars": ["error", {
|
|
67
|
+
argsIgnorePattern: "^_",
|
|
68
|
+
destructuredArrayIgnorePattern: "^_",
|
|
69
|
+
ignoreRestSiblings: true
|
|
70
|
+
}]
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
// typescript
|
|
74
|
+
{
|
|
75
|
+
files: ["**/*.ts", "**/*.vue"],
|
|
76
|
+
plugins: {
|
|
77
|
+
"@stylistic/ts": stylisticTS
|
|
78
|
+
},
|
|
79
|
+
rules: {
|
|
80
|
+
"@stylistic/js/comma-dangle": "off",
|
|
81
|
+
"@stylistic/js/comma-spacing": "off",
|
|
82
|
+
"@stylistic/js/indent": "off",
|
|
83
|
+
"@stylistic/js/key-spacing": "off",
|
|
84
|
+
"@stylistic/js/keyword-spacing": "off",
|
|
85
|
+
"@stylistic/js/object-curly-spacing": "off",
|
|
86
|
+
"@stylistic/js/quote-props": "off",
|
|
87
|
+
"@stylistic/js/quotes": "off",
|
|
88
|
+
"@stylistic/js/semi": "off",
|
|
89
|
+
"@stylistic/js/space-before-blocks": "off",
|
|
90
|
+
"@stylistic/js/space-before-function-paren": "off",
|
|
91
|
+
"@stylistic/js/space-infix-ops": "off",
|
|
92
|
+
"@stylistic/ts/comma-dangle": ["error", "always-multiline"],
|
|
93
|
+
"@stylistic/ts/comma-spacing": "error",
|
|
94
|
+
"@stylistic/ts/indent": ["error", 2, {
|
|
95
|
+
SwitchCase: 1
|
|
96
|
+
}],
|
|
97
|
+
"@stylistic/ts/key-spacing": "error",
|
|
98
|
+
"@stylistic/ts/keyword-spacing": "error",
|
|
99
|
+
"@stylistic/ts/object-curly-spacing": ["error", "always"],
|
|
100
|
+
"@stylistic/ts/quote-props": ["error", "consistent-as-needed"],
|
|
101
|
+
"@stylistic/ts/quotes": ["error", "single"],
|
|
102
|
+
"@stylistic/ts/semi": ["error", "always"],
|
|
103
|
+
"@stylistic/ts/space-before-blocks": ["error", "always"],
|
|
104
|
+
"@stylistic/ts/space-before-function-paren": ["error", "always"],
|
|
105
|
+
"@stylistic/ts/space-infix-ops": "error"
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
// sort-keys
|
|
109
|
+
{
|
|
110
|
+
files: ["**/*.config.{js,ts}", "**/locales/**/*.js"],
|
|
111
|
+
rules: {
|
|
112
|
+
"sort-keys": ["error", "asc", {
|
|
113
|
+
allowLineSeparatedGroups: true,
|
|
114
|
+
natural: true
|
|
115
|
+
}]
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
ignores: [
|
|
120
|
+
"node_modules/"
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const _default: ({
|
|
2
2
|
readonly rules: Readonly<import("eslint").Linter.RulesRecord>;
|
|
3
|
-
} | import("@typescript-eslint/utils/ts-eslint").FlatConfig.Config | {
|
|
3
|
+
} | import("@typescript-eslint/utils/ts-eslint").FlatConfig.Config | import("eslint").Linter.Config<import("eslint").Linter.RulesRecord> | {
|
|
4
4
|
languageOptions: {
|
|
5
5
|
globals: {
|
|
6
6
|
__dirname: false;
|
|
@@ -1162,6 +1162,7 @@ declare const _default: ({
|
|
|
1162
1162
|
'arrow-body-style': string[];
|
|
1163
1163
|
eqeqeq: string[];
|
|
1164
1164
|
'no-console': string;
|
|
1165
|
+
'no-nested-ternary': string;
|
|
1165
1166
|
'no-unused-vars': (string | {
|
|
1166
1167
|
argsIgnorePattern: string;
|
|
1167
1168
|
destructuredArrayIgnorePattern: string;
|
|
@@ -1172,6 +1173,7 @@ declare const _default: ({
|
|
|
1172
1173
|
})[];
|
|
1173
1174
|
'prefer-template': string;
|
|
1174
1175
|
'@stylistic/js/array-bracket-spacing': string[];
|
|
1176
|
+
'@stylistic/js/arrow-parens': string[];
|
|
1175
1177
|
'@stylistic/js/comma-dangle': string[];
|
|
1176
1178
|
'@stylistic/js/comma-spacing': string;
|
|
1177
1179
|
'@stylistic/js/eol-last': string[];
|
|
@@ -1180,14 +1182,15 @@ declare const _default: ({
|
|
|
1180
1182
|
})[];
|
|
1181
1183
|
'@stylistic/js/key-spacing': string;
|
|
1182
1184
|
'@stylistic/js/keyword-spacing': string;
|
|
1185
|
+
'@stylistic/js/multiline-ternary': string[];
|
|
1183
1186
|
'@stylistic/js/no-multi-spaces': string;
|
|
1184
1187
|
'@stylistic/js/no-multiple-empty-lines': (string | {
|
|
1185
1188
|
max: number;
|
|
1186
1189
|
})[];
|
|
1187
1190
|
'@stylistic/js/no-trailing-spaces': string;
|
|
1188
1191
|
'@stylistic/js/object-curly-spacing': string[];
|
|
1189
|
-
'@stylistic/js/quotes': string[];
|
|
1190
1192
|
'@stylistic/js/quote-props': string[];
|
|
1193
|
+
'@stylistic/js/quotes': string[];
|
|
1191
1194
|
'@stylistic/js/semi': string[];
|
|
1192
1195
|
'@stylistic/js/semi-spacing': string;
|
|
1193
1196
|
'@stylistic/js/space-before-blocks': string[];
|
|
@@ -1208,12 +1211,13 @@ declare const _default: ({
|
|
|
1208
1211
|
'@stylistic/ts/key-spacing'?: undefined;
|
|
1209
1212
|
'@stylistic/ts/keyword-spacing'?: undefined;
|
|
1210
1213
|
'@stylistic/ts/object-curly-spacing'?: undefined;
|
|
1211
|
-
'@stylistic/ts/quotes'?: undefined;
|
|
1212
1214
|
'@stylistic/ts/quote-props'?: undefined;
|
|
1215
|
+
'@stylistic/ts/quotes'?: undefined;
|
|
1213
1216
|
'@stylistic/ts/semi'?: undefined;
|
|
1214
1217
|
'@stylistic/ts/space-before-blocks'?: undefined;
|
|
1215
1218
|
'@stylistic/ts/space-before-function-paren'?: undefined;
|
|
1216
1219
|
'@stylistic/ts/space-infix-ops'?: undefined;
|
|
1220
|
+
'sort-keys'?: undefined;
|
|
1217
1221
|
};
|
|
1218
1222
|
files?: undefined;
|
|
1219
1223
|
} | {
|
|
@@ -1236,8 +1240,8 @@ declare const _default: ({
|
|
|
1236
1240
|
'@stylistic/js/key-spacing': string;
|
|
1237
1241
|
'@stylistic/js/keyword-spacing': string;
|
|
1238
1242
|
'@stylistic/js/object-curly-spacing': string;
|
|
1239
|
-
'@stylistic/js/quotes': string;
|
|
1240
1243
|
'@stylistic/js/quote-props': string;
|
|
1244
|
+
'@stylistic/js/quotes': string;
|
|
1241
1245
|
'@stylistic/js/semi': string;
|
|
1242
1246
|
'@stylistic/js/space-before-blocks': string;
|
|
1243
1247
|
'@stylistic/js/space-before-function-paren': string;
|
|
@@ -1250,8 +1254,8 @@ declare const _default: ({
|
|
|
1250
1254
|
'@stylistic/ts/key-spacing': string;
|
|
1251
1255
|
'@stylistic/ts/keyword-spacing': string;
|
|
1252
1256
|
'@stylistic/ts/object-curly-spacing': string[];
|
|
1253
|
-
'@stylistic/ts/quotes': string[];
|
|
1254
1257
|
'@stylistic/ts/quote-props': string[];
|
|
1258
|
+
'@stylistic/ts/quotes': string[];
|
|
1255
1259
|
'@stylistic/ts/semi': string[];
|
|
1256
1260
|
'@stylistic/ts/space-before-blocks': string[];
|
|
1257
1261
|
'@stylistic/ts/space-before-function-paren': string[];
|
|
@@ -1259,21 +1263,113 @@ declare const _default: ({
|
|
|
1259
1263
|
'arrow-body-style'?: undefined;
|
|
1260
1264
|
eqeqeq?: undefined;
|
|
1261
1265
|
'no-console'?: undefined;
|
|
1266
|
+
'no-nested-ternary'?: undefined;
|
|
1267
|
+
'no-unused-vars'?: undefined;
|
|
1268
|
+
'prefer-const'?: undefined;
|
|
1269
|
+
'prefer-template'?: undefined;
|
|
1270
|
+
'@stylistic/js/array-bracket-spacing'?: undefined;
|
|
1271
|
+
'@stylistic/js/arrow-parens'?: undefined;
|
|
1272
|
+
'@stylistic/js/eol-last'?: undefined;
|
|
1273
|
+
'@stylistic/js/multiline-ternary'?: undefined;
|
|
1274
|
+
'@stylistic/js/no-multi-spaces'?: undefined;
|
|
1275
|
+
'@stylistic/js/no-multiple-empty-lines'?: undefined;
|
|
1276
|
+
'@stylistic/js/no-trailing-spaces'?: undefined;
|
|
1277
|
+
'@stylistic/js/semi-spacing'?: undefined;
|
|
1278
|
+
'@stylistic/js/space-in-parens'?: undefined;
|
|
1279
|
+
'@stylistic/js/spaced-comment'?: undefined;
|
|
1280
|
+
'@stylistic/js/template-curly-spacing'?: undefined;
|
|
1281
|
+
'@typescript-eslint/no-unused-expressions'?: undefined;
|
|
1282
|
+
'@typescript-eslint/no-unused-vars'?: undefined;
|
|
1283
|
+
'sort-keys'?: undefined;
|
|
1284
|
+
};
|
|
1285
|
+
languageOptions?: undefined;
|
|
1286
|
+
} | {
|
|
1287
|
+
files: string[];
|
|
1288
|
+
rules: {
|
|
1289
|
+
'sort-keys': (string | {
|
|
1290
|
+
allowLineSeparatedGroups: boolean;
|
|
1291
|
+
natural: boolean;
|
|
1292
|
+
})[];
|
|
1293
|
+
'arrow-body-style'?: undefined;
|
|
1294
|
+
eqeqeq?: undefined;
|
|
1295
|
+
'no-console'?: undefined;
|
|
1296
|
+
'no-nested-ternary'?: undefined;
|
|
1262
1297
|
'no-unused-vars'?: undefined;
|
|
1263
1298
|
'prefer-const'?: undefined;
|
|
1264
1299
|
'prefer-template'?: undefined;
|
|
1265
1300
|
'@stylistic/js/array-bracket-spacing'?: undefined;
|
|
1301
|
+
'@stylistic/js/arrow-parens'?: undefined;
|
|
1302
|
+
'@stylistic/js/comma-dangle'?: undefined;
|
|
1303
|
+
'@stylistic/js/comma-spacing'?: undefined;
|
|
1266
1304
|
'@stylistic/js/eol-last'?: undefined;
|
|
1305
|
+
'@stylistic/js/indent'?: undefined;
|
|
1306
|
+
'@stylistic/js/key-spacing'?: undefined;
|
|
1307
|
+
'@stylistic/js/keyword-spacing'?: undefined;
|
|
1308
|
+
'@stylistic/js/multiline-ternary'?: undefined;
|
|
1267
1309
|
'@stylistic/js/no-multi-spaces'?: undefined;
|
|
1268
1310
|
'@stylistic/js/no-multiple-empty-lines'?: undefined;
|
|
1269
1311
|
'@stylistic/js/no-trailing-spaces'?: undefined;
|
|
1312
|
+
'@stylistic/js/object-curly-spacing'?: undefined;
|
|
1313
|
+
'@stylistic/js/quote-props'?: undefined;
|
|
1314
|
+
'@stylistic/js/quotes'?: undefined;
|
|
1315
|
+
'@stylistic/js/semi'?: undefined;
|
|
1270
1316
|
'@stylistic/js/semi-spacing'?: undefined;
|
|
1317
|
+
'@stylistic/js/space-before-blocks'?: undefined;
|
|
1318
|
+
'@stylistic/js/space-before-function-paren'?: undefined;
|
|
1271
1319
|
'@stylistic/js/space-in-parens'?: undefined;
|
|
1320
|
+
'@stylistic/js/space-infix-ops'?: undefined;
|
|
1272
1321
|
'@stylistic/js/spaced-comment'?: undefined;
|
|
1273
1322
|
'@stylistic/js/template-curly-spacing'?: undefined;
|
|
1274
1323
|
'@typescript-eslint/no-unused-expressions'?: undefined;
|
|
1275
1324
|
'@typescript-eslint/no-unused-vars'?: undefined;
|
|
1325
|
+
'@stylistic/ts/comma-dangle'?: undefined;
|
|
1326
|
+
'@stylistic/ts/comma-spacing'?: undefined;
|
|
1327
|
+
'@stylistic/ts/indent'?: undefined;
|
|
1328
|
+
'@stylistic/ts/key-spacing'?: undefined;
|
|
1329
|
+
'@stylistic/ts/keyword-spacing'?: undefined;
|
|
1330
|
+
'@stylistic/ts/object-curly-spacing'?: undefined;
|
|
1331
|
+
'@stylistic/ts/quote-props'?: undefined;
|
|
1332
|
+
'@stylistic/ts/quotes'?: undefined;
|
|
1333
|
+
'@stylistic/ts/semi'?: undefined;
|
|
1334
|
+
'@stylistic/ts/space-before-blocks'?: undefined;
|
|
1335
|
+
'@stylistic/ts/space-before-function-paren'?: undefined;
|
|
1336
|
+
'@stylistic/ts/space-infix-ops'?: undefined;
|
|
1276
1337
|
};
|
|
1277
1338
|
languageOptions?: undefined;
|
|
1339
|
+
plugins?: undefined;
|
|
1340
|
+
} | {
|
|
1341
|
+
files: string[];
|
|
1342
|
+
languageOptions: {
|
|
1343
|
+
parserOptions: {
|
|
1344
|
+
parser: {
|
|
1345
|
+
meta?: { [K in keyof import("@typescript-eslint/utils/ts-eslint").Parser.ParserMeta]?: import("@typescript-eslint/utils/ts-eslint").Parser.ParserMeta[K] | undefined; };
|
|
1346
|
+
parseForESLint(text: string, options?: unknown): { [k in keyof import("@typescript-eslint/utils/ts-eslint").Parser.ParseResult]: unknown; };
|
|
1347
|
+
};
|
|
1348
|
+
};
|
|
1349
|
+
};
|
|
1350
|
+
rules: {
|
|
1351
|
+
'@stylistic/js/indent': string;
|
|
1352
|
+
'@stylistic/js/object-curly-spacing': string;
|
|
1353
|
+
'@stylistic/ts/indent': string;
|
|
1354
|
+
'tailwindcss/no-custom-classname': string;
|
|
1355
|
+
'vue/attributes-order': (string | {
|
|
1356
|
+
alphabetical: boolean;
|
|
1357
|
+
})[];
|
|
1358
|
+
'vue/component-name-in-template-casing': (string | {
|
|
1359
|
+
registeredComponentsOnly: boolean;
|
|
1360
|
+
})[];
|
|
1361
|
+
'vue/first-attribute-linebreak': (string | {
|
|
1362
|
+
singleline: string;
|
|
1363
|
+
})[];
|
|
1364
|
+
'vue/multi-word-component-names': string;
|
|
1365
|
+
'vue/no-bare-strings-in-template': string;
|
|
1366
|
+
'vue/object-curly-spacing': string[];
|
|
1367
|
+
'vue/prefer-template': string;
|
|
1368
|
+
'vue/require-default-prop': string;
|
|
1369
|
+
'vue/script-indent': (string | number | {
|
|
1370
|
+
switchCase: number;
|
|
1371
|
+
})[];
|
|
1372
|
+
'vue/template-curly-spacing': string[];
|
|
1373
|
+
};
|
|
1278
1374
|
})[];
|
|
1279
1375
|
export default _default;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import tailwind from "eslint-plugin-tailwindcss";
|
|
2
|
+
import tseslint from "typescript-eslint";
|
|
3
|
+
import vue from "eslint-plugin-vue";
|
|
4
|
+
import base from "./base.eslint.config.mjs";
|
|
5
|
+
export default [
|
|
6
|
+
...base,
|
|
7
|
+
...tailwind.configs["flat/recommended"],
|
|
8
|
+
...vue.configs["flat/recommended"],
|
|
9
|
+
{
|
|
10
|
+
files: ["**/*.vue"],
|
|
11
|
+
languageOptions: {
|
|
12
|
+
parserOptions: {
|
|
13
|
+
parser: tseslint.parser
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
rules: {
|
|
17
|
+
"@stylistic/js/indent": "off",
|
|
18
|
+
"@stylistic/js/object-curly-spacing": "off",
|
|
19
|
+
"@stylistic/ts/indent": "off",
|
|
20
|
+
"tailwindcss/no-custom-classname": "error",
|
|
21
|
+
"vue/attributes-order": ["error", {
|
|
22
|
+
alphabetical: true
|
|
23
|
+
}],
|
|
24
|
+
"vue/component-name-in-template-casing": ["error", "PascalCase", {
|
|
25
|
+
registeredComponentsOnly: false
|
|
26
|
+
}],
|
|
27
|
+
"vue/first-attribute-linebreak": ["error", {
|
|
28
|
+
singleline: "beside"
|
|
29
|
+
}],
|
|
30
|
+
"vue/multi-word-component-names": "off",
|
|
31
|
+
"vue/no-bare-strings-in-template": "error",
|
|
32
|
+
"vue/object-curly-spacing": ["error", "always"],
|
|
33
|
+
"vue/prefer-template": "error",
|
|
34
|
+
"vue/require-default-prop": "off",
|
|
35
|
+
"vue/script-indent": ["error", 2, {
|
|
36
|
+
switchCase: 1
|
|
37
|
+
}],
|
|
38
|
+
"vue/template-curly-spacing": ["error", "never"]
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
ignores: [
|
|
43
|
+
"**/.nuxt/",
|
|
44
|
+
"**/.output/",
|
|
45
|
+
"**/dist/"
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
];
|