@nemigo/configs 1.5.1 → 2.0.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/.eslint.ignore CHANGED
@@ -32,7 +32,7 @@ coverage
32
32
  test-results
33
33
  temp-*
34
34
  logs
35
- *.log
35
+ *.log*
36
36
 
37
37
  # BUILD
38
38
  .deploy
@@ -1,7 +1,7 @@
1
- import type { ConfigWithExtendsArray } from "../types.js";
2
1
  import { convertIgnorePatternToMinimatch, includeIgnoreFile } from "@eslint/compat";
2
+ import type { ConfigObject } from "@eslint/core";
3
3
  import type { Config } from "@sveltejs/kit";
4
- import type { Linter } from "eslint";
4
+ import type { ConfigWithExtendsArray } from "./types.js";
5
5
  export { includeIgnoreFile, convertIgnorePatternToMinimatch as convertIgnorePattern };
6
6
  /**
7
7
  * Опции создания конфигураций для {@link defineEslintConfig}
@@ -67,4 +67,4 @@ export interface EslintConfigOptions {
67
67
  * });
68
68
  * ```
69
69
  */
70
- export declare const defineEslintConfig: (options?: EslintConfigOptions, ...rest: ConfigWithExtendsArray) => Linter.Config[];
70
+ export declare const defineEslintConfig: (options?: EslintConfigOptions, ...rest: ConfigWithExtendsArray) => ConfigObject[];
@@ -1,9 +1,9 @@
1
+ import { join } from "node:path";
1
2
  import { convertIgnorePatternToMinimatch, includeIgnoreFile } from "@eslint/compat";
2
3
  import jslint from "@eslint/js";
3
- import { configs as svelteConfigs } from "eslint-plugin-svelte";
4
4
  import { defineConfig } from "eslint/config";
5
+ import { configs as svelteConfigs } from "eslint-plugin-svelte";
5
6
  import globals from "globals";
6
- import { join } from "node:path";
7
7
  import tslint from "typescript-eslint";
8
8
  export { includeIgnoreFile, convertIgnorePatternToMinimatch as convertIgnorePattern };
9
9
  /**
@@ -75,13 +75,10 @@ export const defineEslintConfig = (options, ...rest) => {
75
75
  });
76
76
  }
77
77
  if (options?.svelte) {
78
+ // @ts-expect-error <eslint-plugin-svelte со старыми типами>
78
79
  acc.push(svelteConfigs["flat/recommended"]);
79
80
  acc.push({
80
- files: [
81
- "**/*.svelte",
82
- "**/*.svelte.ts",
83
- "**/*.svelte.js",
84
- ],
81
+ files: ["**/*.svelte", "**/*.svelte.ts", "**/*.svelte.js"],
85
82
  languageOptions: {
86
83
  parserOptions: {
87
84
  projectService: true,
@@ -1,13 +1,13 @@
1
- import type { Linter } from "eslint";
1
+ import type { ConfigObject } from "@eslint/core";
2
2
  export type InfiniteArray<T> = T | InfiniteArray<T>[];
3
- export type SimpleExtendsElement = string | Linter.Config;
4
- export type ExtendsElement = SimpleExtendsElement | InfiniteArray<Linter.Config>;
5
- export interface ConfigWithExtends extends Linter.Config {
3
+ export type SimpleExtendsElement = string | ConfigObject;
4
+ export type ExtendsElement = SimpleExtendsElement | InfiniteArray<ConfigObject>;
5
+ export interface ConfigWithExtends extends ConfigObject {
6
6
  extends?: ExtendsElement[];
7
7
  }
8
8
  /**
9
9
  * Массив конфигов для {@link defineConfig} из {@link https://www.npmjs.com/package/eslint/config eslint/config}
10
10
  *
11
- * @remarks Взято из {@link https://www.npmjs.com/package/@eslint/config-helpers @eslint/config-helpers/types (0.3.1)}, т.к. этот тип не экспортируется
11
+ * @remarks Взято из {@link https://www.npmjs.com/package/@eslint/config-helpers @eslint/config-helpers/types (0.4.2)}, т.к. этот тип не экспортируется
12
12
  */
13
13
  export type ConfigWithExtendsArray = InfiniteArray<ConfigWithExtends>[];
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { defineEslintConfig, convertIgnorePattern, includeIgnoreFile } from "./eslint/index.js";
1
+ export { convertIgnorePattern, defineEslintConfig, includeIgnoreFile } from "./eslint/index.js";
2
2
  export { definePrettierConfig, pretty } from "./prettier/index.js";
3
3
  export { defineSvelteConfig } from "./svelte/index.js";
4
4
  export { defineSveltePackageConfig } from "./svelte/package.js";
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { defineEslintConfig, convertIgnorePattern, includeIgnoreFile } from "./eslint/index.js";
1
+ export { convertIgnorePattern, defineEslintConfig, includeIgnoreFile } from "./eslint/index.js";
2
2
  export { definePrettierConfig, pretty } from "./prettier/index.js";
3
3
  export { defineSvelteConfig } from "./svelte/index.js";
4
4
  export { defineSveltePackageConfig } from "./svelte/package.js";
@@ -1,4 +1,4 @@
1
- import type { Config as PrettierConfig, Options } from "prettier";
1
+ import type { Options, Config as PrettierConfig } from "prettier";
2
2
  import type { CssOrderPrettierConfig } from "prettier-plugin-css-order";
3
3
  import type { MultilineArrayOptions } from "prettier-plugin-multiline-arrays";
4
4
  import type { PluginConfig as SveltePrettierConfig } from "prettier-plugin-svelte";
@@ -38,12 +38,7 @@ export const definePrettierConfig = (options) => ({
38
38
  trailingComma: "es5",
39
39
  bracketSameLine: true,
40
40
  multilineArraysWrapThreshold: options?.arraysWrapThreshold ?? 3,
41
- plugins: [
42
- svelte,
43
- css,
44
- arrays,
45
- tailwind,
46
- ],
41
+ plugins: [svelte, css, arrays, tailwind],
47
42
  overrides: [
48
43
  {
49
44
  files: "*.svelte",
@@ -51,14 +51,14 @@ export const defineSvelteConfig = (options) => ({
51
51
  */
52
52
  typescript: {
53
53
  config: (config) => {
54
- config["compilerOptions"] = {
55
- ...getOptionalObject(config["compilerOptions"]),
54
+ config.compilerOptions = {
55
+ ...getOptionalObject(config.compilerOptions),
56
56
  allowJs: true,
57
57
  checkJs: true,
58
58
  target: "ES2023", // override
59
59
  module: "NodeNext", // override
60
60
  moduleResolution: "NodeNext", // override
61
- // noEmit: true,
61
+ // noemit: true,
62
62
  strict: true,
63
63
  noImplicitAny: false,
64
64
  // isolatedModules: true,
@@ -69,14 +69,9 @@ export const defineSvelteConfig = (options) => ({
69
69
  skipLibCheck: true,
70
70
  disableSizeLimit: true,
71
71
  };
72
- config["exclude"] = setifyArray([
73
- ...getOptionalArray(config["exclude"]),
74
- "../**/trash/**",
75
- "../**/drafts/**",
76
- ...(options.exclude ?? []),
77
- ]);
78
- config["include"] = setifyArray([
79
- ...getOptionalArray(config["include"]),
72
+ config.exclude = setifyArray([...getOptionalArray(config.exclude), "../**/trash/**", "../**/drafts/**", ...(options.exclude ?? [])]);
73
+ config.include = setifyArray([
74
+ ...getOptionalArray(config.include),
80
75
  "../scripts",
81
76
  "../types",
82
77
  "../*.ts",
package/dist/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export type { EslintConfigOptions } from "./eslint/index.js";
2
2
  export type { ConfigWithExtendsArray } from "./eslint/types.js";
3
- export type { PrettierConfigOptions, PrettierExtraConfig, MultilineArrayPrettierConfig, CssOrderPrettierConfig, SveltePrettierConfig, PrettierConfig, TailwindPrettierConfig, } from "./prettier/index.js";
3
+ export type { CssOrderPrettierConfig, MultilineArrayPrettierConfig, PrettierConfig, PrettierConfigOptions, PrettierExtraConfig, SveltePrettierConfig, TailwindPrettierConfig, } from "./prettier/index.js";
4
4
  export type { SvelteConfigOptions } from "./svelte/index.js";
5
5
  export type { SveltePackageConfigOptions } from "./svelte/package.js";
6
6
  export type { ViteConfigOptions } from "./vite/index.js";
package/package.json CHANGED
@@ -1,20 +1,21 @@
1
1
  {
2
2
  "name": "@nemigo/configs",
3
- "version": "1.5.1",
3
+ "version": "2.0.0",
4
4
  "private": false,
5
5
  "author": {
6
6
  "name": "Vlad Logvin",
7
7
  "email": "vlad.logvin84@gmail.com"
8
8
  },
9
9
  "type": "module",
10
- "engines": {
11
- "node": ">=22"
12
- },
13
10
  "scripts": {
14
11
  "build": "svelte-package && rimraf .svelte-kit",
15
12
  "check": "tsc --noemit",
16
- "lint": "eslint ./",
17
- "format": "prettier --write ./"
13
+ "eslint": "eslint ./",
14
+ "eslint:fix": "eslint --fix ./",
15
+ "lint": "biome lint",
16
+ "lint:fix": "biome lint --fix --unsafe",
17
+ "lint:fix:unsafe": "biome lint --fix --unsafe",
18
+ "format": "biome check --write --linter-enabled=false"
18
19
  },
19
20
  "files": [
20
21
  "dist",
@@ -70,7 +71,8 @@
70
71
  "eslint": ">=9.0.0",
71
72
  "prettier": ">=3.6.0",
72
73
  "svelte": ">=5.0.0",
73
- "typescript": ">=5.8.0"
74
+ "typescript": ">=5.8.0",
75
+ "vitest": ">=4.0.0"
74
76
  },
75
77
  "peerDependenciesMeta": {
76
78
  "@sveltejs/vite-plugin-svelte": {
@@ -78,21 +80,24 @@
78
80
  },
79
81
  "svelte": {
80
82
  "optional": true
83
+ },
84
+ "vitest": {
85
+ "optional": true
81
86
  }
82
87
  },
83
88
  "dependencies": {
84
- "@eslint/compat": "1.4.0",
89
+ "@eslint/compat": "1.4.1",
90
+ "@eslint/config-helpers": "0.4.2",
91
+ "@eslint/core": "0.17.0",
85
92
  "@eslint/js": "9.38.0",
86
93
  "@types/eslint": "9.6.1",
87
- "eslint-plugin-svelte": "3.12.5",
88
- "globals": "16.4.0",
94
+ "eslint-plugin-svelte": "3.13.0",
95
+ "globals": "16.5.0",
89
96
  "prettier-plugin-css-order": "2.1.2",
90
97
  "prettier-plugin-multiline-arrays": "4.0.3",
91
98
  "prettier-plugin-svelte": "3.4.0",
92
99
  "prettier-plugin-tailwindcss": "0.7.1",
93
- "typescript-eslint": "8.46.2"
94
- },
95
- "devDependencies": {
96
- "@nemigo/configs": "1.5.1"
100
+ "typescript-eslint": "8.46.3",
101
+ "vitest": "4.0.6"
97
102
  }
98
103
  }