@nemigo/configs 0.0.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/.eslint.ignore +53 -0
- package/dist/eslint.d.ts +25 -0
- package/dist/eslint.js +103 -0
- package/dist/prettier.d.ts +2 -0
- package/dist/prettier.js +26 -0
- package/dist/svelte/package.d.ts +2 -0
- package/dist/svelte/package.js +37 -0
- package/package.json +67 -0
- package/typescript.json +21 -0
package/.eslint.ignore
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# OS
|
|
2
|
+
.DS_Store
|
|
3
|
+
Thumbs.db
|
|
4
|
+
.fuse_hidden*
|
|
5
|
+
.nfs*
|
|
6
|
+
|
|
7
|
+
# IDEs
|
|
8
|
+
.idea
|
|
9
|
+
.fleet
|
|
10
|
+
.vscode
|
|
11
|
+
*.code-workspace
|
|
12
|
+
*.bak
|
|
13
|
+
*.swp
|
|
14
|
+
*.swo
|
|
15
|
+
|
|
16
|
+
# DEV
|
|
17
|
+
.git
|
|
18
|
+
drafts
|
|
19
|
+
migrations
|
|
20
|
+
node_modules
|
|
21
|
+
trash
|
|
22
|
+
|
|
23
|
+
*-lock.*
|
|
24
|
+
*.lock
|
|
25
|
+
*.lockb
|
|
26
|
+
|
|
27
|
+
# TEMP
|
|
28
|
+
.turbo
|
|
29
|
+
.svelte-kit
|
|
30
|
+
vite.config.*.timestamp-*
|
|
31
|
+
coverage
|
|
32
|
+
test-results
|
|
33
|
+
temp-*
|
|
34
|
+
logs
|
|
35
|
+
*.log
|
|
36
|
+
|
|
37
|
+
# BUILD
|
|
38
|
+
.deploy
|
|
39
|
+
.output
|
|
40
|
+
.vercel
|
|
41
|
+
.netlify
|
|
42
|
+
.wrangler
|
|
43
|
+
build
|
|
44
|
+
dist
|
|
45
|
+
|
|
46
|
+
# ETC
|
|
47
|
+
static
|
|
48
|
+
*.min.*
|
|
49
|
+
*.yaml
|
|
50
|
+
*.json
|
|
51
|
+
|
|
52
|
+
# CUSTOM
|
|
53
|
+
# ...
|
package/dist/eslint.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { includeIgnoreFile } from "@eslint/compat";
|
|
2
|
+
import type { Config } from "@sveltejs/kit";
|
|
3
|
+
import type { ConfigArray, InfiniteDepthConfigWithExtends } from "typescript-eslint";
|
|
4
|
+
export interface EslintConfigOptions {
|
|
5
|
+
svelte?: Config;
|
|
6
|
+
strict?: boolean;
|
|
7
|
+
service?: string;
|
|
8
|
+
ignore?: false | string;
|
|
9
|
+
}
|
|
10
|
+
export { includeIgnoreFile };
|
|
11
|
+
/**
|
|
12
|
+
* Универсальная сборка flat-конфига для 'eslint'.
|
|
13
|
+
* Взята из `npx sv create`
|
|
14
|
+
*
|
|
15
|
+
* Включает в себя:
|
|
16
|
+
* - .eslint.ignore
|
|
17
|
+
* - globals
|
|
18
|
+
* - javascript
|
|
19
|
+
* - typescript
|
|
20
|
+
* - prettier (отключён)
|
|
21
|
+
* - svelte (опционально)
|
|
22
|
+
*
|
|
23
|
+
* @see https://eslint.org/docs/latest/use/configure/configuration-files
|
|
24
|
+
*/
|
|
25
|
+
export declare const defineConfig: ({ ignore, svelte, service, strict }?: EslintConfigOptions, ...other: InfiniteDepthConfigWithExtends[]) => ConfigArray;
|
package/dist/eslint.js
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { includeIgnoreFile } from "@eslint/compat";
|
|
2
|
+
import jslint from "@eslint/js";
|
|
3
|
+
// import prettier from "eslint-config-prettier";
|
|
4
|
+
import { configs as svelteConfigs } from "eslint-plugin-svelte";
|
|
5
|
+
import globals from "globals";
|
|
6
|
+
import { join } from "node:path";
|
|
7
|
+
import tslint from "typescript-eslint";
|
|
8
|
+
export { includeIgnoreFile };
|
|
9
|
+
/**
|
|
10
|
+
* Универсальная сборка flat-конфига для 'eslint'.
|
|
11
|
+
* Взята из `npx sv create`
|
|
12
|
+
*
|
|
13
|
+
* Включает в себя:
|
|
14
|
+
* - .eslint.ignore
|
|
15
|
+
* - globals
|
|
16
|
+
* - javascript
|
|
17
|
+
* - typescript
|
|
18
|
+
* - prettier (отключён)
|
|
19
|
+
* - svelte (опционально)
|
|
20
|
+
*
|
|
21
|
+
* @see https://eslint.org/docs/latest/use/configure/configuration-files
|
|
22
|
+
*/
|
|
23
|
+
export const defineConfig = ({ ignore, svelte, service, strict } = {}, ...other) => tslint.config(ignore === false ? {} : includeIgnoreFile(ignore || join(import.meta.dirname, "../.eslint.ignore")), jslint.configs.recommended, ...(strict
|
|
24
|
+
? service
|
|
25
|
+
? tslint.configs.strictTypeChecked
|
|
26
|
+
: tslint.configs.strict
|
|
27
|
+
: service
|
|
28
|
+
? tslint.configs.recommendedTypeChecked
|
|
29
|
+
: tslint.configs.recommended), ...(svelte ? svelteConfigs["flat/recommended"] : []),
|
|
30
|
+
// prettier,
|
|
31
|
+
// ...(svelte ? svelteConfigs["flat/prettier"] : []),
|
|
32
|
+
service
|
|
33
|
+
? {
|
|
34
|
+
languageOptions: {
|
|
35
|
+
parserOptions: {
|
|
36
|
+
projectService: true,
|
|
37
|
+
tsconfigRootDir: service,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
}
|
|
41
|
+
: {}, {
|
|
42
|
+
languageOptions: {
|
|
43
|
+
globals: {
|
|
44
|
+
...globals.browser,
|
|
45
|
+
...globals.node,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
}, svelte
|
|
49
|
+
? {
|
|
50
|
+
files: [
|
|
51
|
+
"./**/*.svelte",
|
|
52
|
+
"./**/*.svelte.{ts,js}",
|
|
53
|
+
"./**/*.svelte.{test,spec}.{ts,js}",
|
|
54
|
+
],
|
|
55
|
+
languageOptions: {
|
|
56
|
+
parserOptions: {
|
|
57
|
+
projectService: true,
|
|
58
|
+
extraFileExtensions: [".svelte"],
|
|
59
|
+
parser: tslint.parser,
|
|
60
|
+
svelteConfig: svelte,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
rules: {
|
|
64
|
+
"svelte/no-at-html-tags": 0,
|
|
65
|
+
"svelte/no-navigation-without-resolve": 0,
|
|
66
|
+
"svelte/prefer-svelte-reactivity": 0,
|
|
67
|
+
},
|
|
68
|
+
}
|
|
69
|
+
: {}, {
|
|
70
|
+
rules: {
|
|
71
|
+
"@typescript-eslint/no-confusing-void-expression": 0,
|
|
72
|
+
"@typescript-eslint/no-duplicate-type-constituents": 0,
|
|
73
|
+
"@typescript-eslint/no-dynamic-delete": 0,
|
|
74
|
+
"@typescript-eslint/no-empty-object-type": 0,
|
|
75
|
+
"@typescript-eslint/no-explicit-any": 0,
|
|
76
|
+
"@typescript-eslint/no-non-null-asserted-optional-chain": 0,
|
|
77
|
+
"@typescript-eslint/no-non-null-assertion": 0,
|
|
78
|
+
"@typescript-eslint/no-redundant-type-constituents": 0,
|
|
79
|
+
"@typescript-eslint/no-this-alias": 0,
|
|
80
|
+
"@typescript-eslint/no-unnecessary-type-parameters": 0,
|
|
81
|
+
"@typescript-eslint/no-unsafe-argument": 0,
|
|
82
|
+
"@typescript-eslint/no-unsafe-assignment": 0,
|
|
83
|
+
"@typescript-eslint/no-unsafe-call": 0,
|
|
84
|
+
"@typescript-eslint/no-unsafe-member-access": 0,
|
|
85
|
+
"@typescript-eslint/no-unsafe-return": 0,
|
|
86
|
+
"@typescript-eslint/no-unused-expressions": 0,
|
|
87
|
+
"@typescript-eslint/no-unused-vars": [
|
|
88
|
+
"error",
|
|
89
|
+
{
|
|
90
|
+
args: "all",
|
|
91
|
+
argsIgnorePattern: "^_",
|
|
92
|
+
caughtErrors: "all",
|
|
93
|
+
caughtErrorsIgnorePattern: "^_",
|
|
94
|
+
destructuredArrayIgnorePattern: "^_",
|
|
95
|
+
varsIgnorePattern: "^_",
|
|
96
|
+
ignoreRestSiblings: true,
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
"@typescript-eslint/restrict-plus-operands": 0,
|
|
100
|
+
"@typescript-eslint/restrict-template-expressions": 0,
|
|
101
|
+
"no-import-assign": 0,
|
|
102
|
+
},
|
|
103
|
+
}, ...other);
|
package/dist/prettier.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as svelte from "prettier-plugin-svelte";
|
|
2
|
+
import * as css from "prettier-plugin-css-order";
|
|
3
|
+
import * as arrays from "prettier-plugin-multiline-arrays";
|
|
4
|
+
import * as tailwind from "prettier-plugin-tailwindcss";
|
|
5
|
+
export const defineConfig = () => ({
|
|
6
|
+
tabWidth: 2,
|
|
7
|
+
useTabs: true,
|
|
8
|
+
printWidth: 150,
|
|
9
|
+
singleQuote: false,
|
|
10
|
+
trailingComma: "es5",
|
|
11
|
+
bracketSameLine: true,
|
|
12
|
+
experimentalTernaries: false,
|
|
13
|
+
multilineArraysWrapThreshold: 3,
|
|
14
|
+
plugins: [
|
|
15
|
+
svelte,
|
|
16
|
+
css,
|
|
17
|
+
arrays,
|
|
18
|
+
tailwind,
|
|
19
|
+
],
|
|
20
|
+
overrides: [
|
|
21
|
+
{
|
|
22
|
+
files: "*.svelte",
|
|
23
|
+
options: { parser: "svelte" },
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
|
|
2
|
+
export const definePackageConfig = (runes = true) => ({
|
|
3
|
+
/**
|
|
4
|
+
* Настройки поведения svelte-компилятора
|
|
5
|
+
*
|
|
6
|
+
* @see https://svelte.dev/docs/svelte/svelte-compiler#CompileOptions
|
|
7
|
+
*/
|
|
8
|
+
compilerOptions: {
|
|
9
|
+
/**
|
|
10
|
+
* Только руны
|
|
11
|
+
*
|
|
12
|
+
* @see https://svelte.dev/docs/svelte/what-are-runes
|
|
13
|
+
*/
|
|
14
|
+
runes,
|
|
15
|
+
/**
|
|
16
|
+
* Использование современного AST
|
|
17
|
+
*/
|
|
18
|
+
modernAst: true,
|
|
19
|
+
},
|
|
20
|
+
/**
|
|
21
|
+
* Расширение поддержки всякого в svelte (в т.ч. и полной для typescript)
|
|
22
|
+
*
|
|
23
|
+
* @see https://svelte.dev/docs/kit/integrations
|
|
24
|
+
*/
|
|
25
|
+
preprocess: vitePreprocess({ script: true }),
|
|
26
|
+
/**
|
|
27
|
+
* Алиас корня пакета и его путь
|
|
28
|
+
*/
|
|
29
|
+
kit: {
|
|
30
|
+
files: {
|
|
31
|
+
lib: "src",
|
|
32
|
+
},
|
|
33
|
+
alias: {
|
|
34
|
+
"#": "src",
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nemigo/configs",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": false,
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Vlad Logvin",
|
|
7
|
+
"email": "vlad.logvin84@gmail.com"
|
|
8
|
+
},
|
|
9
|
+
"type": "module",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "svelte-package && rimraf .svelte-kit",
|
|
12
|
+
"format": "prettier --write ./"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
".eslint.ignore",
|
|
17
|
+
"typescript.json"
|
|
18
|
+
],
|
|
19
|
+
"exports": {
|
|
20
|
+
"./eslint": {
|
|
21
|
+
"types": "./dist/eslint.d.ts",
|
|
22
|
+
"default": "./dist/eslint.js"
|
|
23
|
+
},
|
|
24
|
+
"./prettier": {
|
|
25
|
+
"types": "./dist/prettier.d.ts",
|
|
26
|
+
"default": "./dist/prettier.js"
|
|
27
|
+
},
|
|
28
|
+
"./svelte/package": {
|
|
29
|
+
"types": "./dist/svelte/package.d.ts",
|
|
30
|
+
"default": "./dist/svelte/package.js"
|
|
31
|
+
},
|
|
32
|
+
"./typescript.json": {
|
|
33
|
+
"default": "./typescript.json"
|
|
34
|
+
},
|
|
35
|
+
"./.eslint.ignore": {
|
|
36
|
+
"default": "./.eslint.ignore"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"@sveltejs/vite-plugin-svelte": ">=6.0.0",
|
|
41
|
+
"eslint": ">=9.0.0",
|
|
42
|
+
"prettier": ">=3.6.0",
|
|
43
|
+
"svelte": ">=5.0.0",
|
|
44
|
+
"typescript": ">=5.8.0"
|
|
45
|
+
},
|
|
46
|
+
"peerDependenciesMeta": {
|
|
47
|
+
"@sveltejs/vite-plugin-svelte": {
|
|
48
|
+
"optional": true
|
|
49
|
+
},
|
|
50
|
+
"svelte": {
|
|
51
|
+
"optional": true
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"@eslint/compat": "1.3.2",
|
|
56
|
+
"@eslint/js": "9.35.0",
|
|
57
|
+
"@types/eslint": "9.6.1",
|
|
58
|
+
"eslint-config-prettier": "10.1.8",
|
|
59
|
+
"eslint-plugin-svelte": "3.12.3",
|
|
60
|
+
"globals": "16.4.0",
|
|
61
|
+
"prettier-plugin-css-order": "2.1.2",
|
|
62
|
+
"prettier-plugin-multiline-arrays": "4.0.3",
|
|
63
|
+
"prettier-plugin-svelte": "3.4.0",
|
|
64
|
+
"prettier-plugin-tailwindcss": "0.6.14",
|
|
65
|
+
"typescript-eslint": "8.44.0"
|
|
66
|
+
}
|
|
67
|
+
}
|
package/typescript.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"allowJs": true,
|
|
5
|
+
"checkJs": true,
|
|
6
|
+
"target": "ES2023",
|
|
7
|
+
"module": "NodeNext",
|
|
8
|
+
"moduleResolution": "NodeNext",
|
|
9
|
+
"noEmit": true,
|
|
10
|
+
"strict": true,
|
|
11
|
+
"noImplicitAny": false,
|
|
12
|
+
"isolatedModules": true,
|
|
13
|
+
"esModuleInterop": true,
|
|
14
|
+
"allowSyntheticDefaultImports": true,
|
|
15
|
+
"verbatimModuleSyntax": true,
|
|
16
|
+
"resolveJsonModule": true,
|
|
17
|
+
"skipLibCheck": true,
|
|
18
|
+
"disableSizeLimit": true,
|
|
19
|
+
"erasableSyntaxOnly": true
|
|
20
|
+
}
|
|
21
|
+
}
|