@dpuse/eslint-config-dpuse 1.0.103 → 1.0.105
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/dist/index.d.ts +13 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -17
- package/dist/index.js.map +1 -1
- package/package.json +14 -2
- package/.editorconfig +0 -13
- package/.gitattributes +0 -4
- package/.markdownlint.json +0 -6
- package/.ncurc.json +0 -1
- package/SECURITY.md +0 -22
- package/config.json +0 -4
- package/eslint.config.js +0 -9
- package/src/index.ts +0 -108
- package/tsconfig.build.json +0 -27
- package/tsconfig.json +0 -26
- package/tsconfig.scripts.json +0 -11
package/dist/index.d.ts
CHANGED
|
@@ -1,19 +1,26 @@
|
|
|
1
1
|
import type { Linter } from 'eslint';
|
|
2
|
-
/** Options accepted by the shared DPUse ESLint configuration
|
|
3
|
-
export interface
|
|
4
|
-
/** Glob patterns for the files to
|
|
5
|
-
files
|
|
2
|
+
/** Options accepted by the shared DPUse base ESLint configuration, common to every DPUse project regardless of framework. */
|
|
3
|
+
export interface DPUseBaseESLintConfigOptions {
|
|
4
|
+
/** Glob patterns for the files to lint. */
|
|
5
|
+
files: string[];
|
|
6
6
|
/** Extra glob patterns to ignore, on top of the standard DPUse build/report directories. */
|
|
7
7
|
ignores?: string[];
|
|
8
|
-
/** Module specifiers that `import-x` should treat as resolvable core modules (e.g. `cloudflare:workers`). */
|
|
9
|
-
importCoreModules?: string[];
|
|
10
8
|
/** Project-specific rule overrides, applied last so they take precedence over the shared defaults. */
|
|
11
9
|
rules?: Linter.RulesRecord;
|
|
10
|
+
}
|
|
11
|
+
/** Options accepted by the shared DPUse TypeScript ESLint configuration factory. */
|
|
12
|
+
export interface DPUseESLintConfigOptions extends Omit<DPUseBaseESLintConfigOptions, 'files'> {
|
|
13
|
+
/** Glob patterns for the files to type-check. Defaults to the common DPUse project layout. */
|
|
14
|
+
files?: string[];
|
|
15
|
+
/** Module specifiers that `import-x` should treat as resolvable core modules (e.g. `cloudflare:workers`). */
|
|
16
|
+
importCoreModules?: string[];
|
|
12
17
|
/** Path to the consuming project's `tsconfig.json`. Defaults to `./tsconfig.json`, used by every DPUse project. */
|
|
13
18
|
tsconfigPath?: string;
|
|
14
19
|
/** The consuming project's root directory. Defaults to `process.cwd()`, correct as long as ESLint is run from the project root. */
|
|
15
20
|
tsconfigRootDir?: string;
|
|
16
21
|
}
|
|
22
|
+
/** The rules, plugins, and ignores shared by every DPUse project, TypeScript or otherwise (e.g. dpuse-app's Vue setup). */
|
|
23
|
+
export declare function dpuseBaseESLintConfig(options: DPUseBaseESLintConfigOptions): Linter.Config[];
|
|
17
24
|
export declare function dpuseESLintConfig(options: DPUseESLintConfigOptions): Linter.Config[];
|
|
18
25
|
export default dpuseESLintConfig;
|
|
19
26
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAcrC,6HAA6H;AAC7H,MAAM,WAAW,4BAA4B;IACzC,2CAA2C;IAC3C,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,4FAA4F;IAC5F,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,sGAAsG;IACtG,KAAK,CAAC,EAAE,MAAM,CAAC,WAAW,CAAC;CAC9B;AAED,oFAAoF;AACpF,MAAM,WAAW,wBAAyB,SAAQ,IAAI,CAAC,4BAA4B,EAAE,OAAO,CAAC;IACzF,8FAA8F;IAC9F,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,6GAA6G;IAC7G,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,mHAAmH;IACnH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mIAAmI;IACnI,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B;AAID,2HAA2H;AAC3H,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,4BAA4B,GAAG,MAAM,CAAC,MAAM,EAAE,CA0D5F;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,MAAM,CAAC,MAAM,EAAE,CA4BpF;AAED,eAAe,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import pluginComments from '@eslint-community/eslint-plugin-eslint-comments';
|
|
2
2
|
import { flatConfigs as pluginImportFlatConfigs } from 'eslint-plugin-import-x';
|
|
3
|
+
import pluginN from 'eslint-plugin-n';
|
|
3
4
|
import { configs as pluginRegexpConfigs } from 'eslint-plugin-regexp';
|
|
4
5
|
import pluginSecurity from 'eslint-plugin-security';
|
|
5
6
|
import pluginSonarJS from 'eslint-plugin-sonarjs';
|
|
@@ -8,23 +9,10 @@ import skipFormatting from 'eslint-config-prettier';
|
|
|
8
9
|
import tseslint from 'typescript-eslint';
|
|
9
10
|
import { defineConfig, globalIgnores } from 'eslint/config';
|
|
10
11
|
// ── ESLint Configuration ─────────────────────────────────────────────────────────────────────────────────────────────
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
/** The rules, plugins, and ignores shared by every DPUse project, TypeScript or otherwise (e.g. dpuse-app's Vue setup). */
|
|
13
|
+
export function dpuseBaseESLintConfig(options) {
|
|
14
|
+
const { files, ignores = [], rules = {} } = options;
|
|
13
15
|
return defineConfig(
|
|
14
|
-
// Linting scope, strict TypeScript type-checking, and module resolver.
|
|
15
|
-
{
|
|
16
|
-
files,
|
|
17
|
-
extends: [...tseslint.configs.strictTypeChecked, ...tseslint.configs.stylisticTypeChecked],
|
|
18
|
-
languageOptions: {
|
|
19
|
-
parserOptions: { project: tsconfigPath, tsconfigRootDir: tsconfigRootDirectory }
|
|
20
|
-
},
|
|
21
|
-
settings: {
|
|
22
|
-
'import-x/core-modules': importCoreModules,
|
|
23
|
-
'import-x/resolver': {
|
|
24
|
-
typescript: { project: [tsconfigPath] }
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
16
|
// Ignores.
|
|
29
17
|
globalIgnores(['bundle-analysis-reports/**', 'dependency-check-bin/**', 'dependency-check-reports/**', 'dist/**', 'licenses/**', ...ignores]),
|
|
30
18
|
// Plugin configurations.
|
|
@@ -38,7 +26,13 @@ export function dpuseESLintConfig(options) {
|
|
|
38
26
|
'@eslint-community/eslint-comments/no-unlimited-disable': 'error',
|
|
39
27
|
'@eslint-community/eslint-comments/no-unused-enable': 'error'
|
|
40
28
|
}
|
|
41
|
-
}, pluginImportFlatConfigs.recommended,
|
|
29
|
+
}, pluginImportFlatConfigs.recommended, {
|
|
30
|
+
plugins: { n: pluginN },
|
|
31
|
+
rules: {
|
|
32
|
+
'n/no-unsupported-features/es-syntax': ['error', { ignores: ['modules'] }],
|
|
33
|
+
'n/no-unsupported-features/node-builtins': 'error'
|
|
34
|
+
}
|
|
35
|
+
}, pluginRegexpConfigs['flat/recommended'], pluginSecurity.configs.recommended, pluginSonarJS.configs.recommended, pluginUnicorn.configs.recommended, skipFormatting,
|
|
42
36
|
// Rule overrides.
|
|
43
37
|
{
|
|
44
38
|
files,
|
|
@@ -58,5 +52,23 @@ export function dpuseESLintConfig(options) {
|
|
|
58
52
|
}
|
|
59
53
|
});
|
|
60
54
|
}
|
|
55
|
+
export function dpuseESLintConfig(options) {
|
|
56
|
+
const { files = ['eslint.config.js', 'src/**/*.ts', 'vite.config.ts', 'vitest.config.ts'], ignores = [], importCoreModules = [], rules = {}, tsconfigPath = './tsconfig.json', tsconfigRootDir: tsconfigRootDirectory = process.cwd() } = options;
|
|
57
|
+
return defineConfig(
|
|
58
|
+
// Linting scope, strict TypeScript type-checking, and module resolver.
|
|
59
|
+
{
|
|
60
|
+
files,
|
|
61
|
+
extends: [...tseslint.configs.strictTypeChecked, ...tseslint.configs.stylisticTypeChecked],
|
|
62
|
+
languageOptions: {
|
|
63
|
+
parserOptions: { project: tsconfigPath, tsconfigRootDir: tsconfigRootDirectory }
|
|
64
|
+
},
|
|
65
|
+
settings: {
|
|
66
|
+
'import-x/core-modules': importCoreModules,
|
|
67
|
+
'import-x/resolver': {
|
|
68
|
+
typescript: { project: [tsconfigPath] }
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}, ...dpuseBaseESLintConfig({ files, ignores, rules }));
|
|
72
|
+
}
|
|
61
73
|
export default dpuseESLintConfig;
|
|
62
74
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,cAAc,MAAM,iDAAiD,CAAC;AAC7E,OAAO,EAAE,WAAW,IAAI,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,cAAc,MAAM,wBAAwB,CAAC;AACpD,OAAO,aAAa,MAAM,uBAAuB,CAAC;AAClD,OAAO,aAAa,MAAM,uBAAuB,CAAC;AAClD,OAAO,cAAc,MAAM,wBAAwB,CAAC;AACpD,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,cAAc,MAAM,iDAAiD,CAAC;AAC7E,OAAO,EAAE,WAAW,IAAI,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,OAAO,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAE,OAAO,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,eAAe,EAAE,qBAAqB,EAAE;SACnF;QACD,QAAQ,EAAE;YACN,uBAAuB,EAAE,iBAAiB;YAC1C,mBAAmB,EAAE;gBACjB,UAAU,EAAE,EAAE,OAAO,EAAE,CAAC,YAAY,CAAC,EAAE;aAC1C;SACJ;KACJ,EAED,GAAG,qBAAqB,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CACtD,CAAC;AACN,CAAC;AAED,eAAe,iBAAiB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dpuse/eslint-config-dpuse",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.105",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Common ESLint configuration used in most DPUse projects.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Jonathan Terrell <terrell.jm@gmail.com>",
|
|
8
|
+
"homepage": "https://www.dpuse.app",
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/dpuse/eslint-config-dpuse/issues"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/dpuse/eslint-config-dpuse.git"
|
|
15
|
+
},
|
|
8
16
|
"type": "module",
|
|
9
17
|
"sideEffects": false,
|
|
10
18
|
"main": "dist/index.js",
|
|
11
19
|
"types": "dist/index.d.ts",
|
|
20
|
+
"files": [
|
|
21
|
+
"dist"
|
|
22
|
+
],
|
|
12
23
|
"engines": {
|
|
13
24
|
"node": ">=22",
|
|
14
25
|
"npm": ">=11"
|
|
@@ -38,6 +49,7 @@
|
|
|
38
49
|
"eslint-config-prettier": "^10.1.8",
|
|
39
50
|
"eslint-import-resolver-typescript": "^4.4.5",
|
|
40
51
|
"eslint-plugin-import-x": "^4.17.1",
|
|
52
|
+
"eslint-plugin-n": "^18.2.1",
|
|
41
53
|
"eslint-plugin-regexp": "^3.1.1",
|
|
42
54
|
"eslint-plugin-security": "^4.0.1",
|
|
43
55
|
"eslint-plugin-sonarjs": "^4.1.0",
|
|
@@ -45,7 +57,7 @@
|
|
|
45
57
|
"typescript-eslint": "^8.62.1"
|
|
46
58
|
},
|
|
47
59
|
"devDependencies": {
|
|
48
|
-
"@dpuse/dpuse-development": "^0.3.
|
|
60
|
+
"@dpuse/dpuse-development": "^0.3.660",
|
|
49
61
|
"@types/eslint-plugin-security": "^3.0.1",
|
|
50
62
|
"@types/node": "^26.1.0",
|
|
51
63
|
"eslint": "^10.6.0",
|
package/.editorconfig
DELETED
package/.gitattributes
DELETED
package/.markdownlint.json
DELETED
package/.ncurc.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{ "reject": [] }
|
package/SECURITY.md
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# Security Policy
|
|
2
|
-
|
|
3
|
-
## Supported Versions
|
|
4
|
-
|
|
5
|
-
Only the latest released version of this connector is actively maintained and receives security fixes.
|
|
6
|
-
|
|
7
|
-
## Reporting a Vulnerability
|
|
8
|
-
|
|
9
|
-
Please do not report security vulnerabilities through public GitHub issues.
|
|
10
|
-
|
|
11
|
-
Instead, use one of the following:
|
|
12
|
-
|
|
13
|
-
- [Report a vulnerability](https://github.com/dpuse/dpuse-connector-file-store-emulator/security/advisories/new) via GitHub private vulnerability reporting
|
|
14
|
-
- Email [terrell.jm@gmail.com](mailto:terrell.jm@gmail.com) with the subject line `[SECURITY] dpuse-connector-file-store-emulator`
|
|
15
|
-
|
|
16
|
-
Include:
|
|
17
|
-
|
|
18
|
-
- A description of the vulnerability and its potential impact
|
|
19
|
-
- Steps to reproduce or a proof-of-concept
|
|
20
|
-
- Any suggested remediation if known
|
|
21
|
-
|
|
22
|
-
You can expect an acknowledgement within **7 days** and a resolution or status update within **30 days**.
|
package/config.json
DELETED
package/eslint.config.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// ── Local (DPUse ESLint) Framework
|
|
2
|
-
import { dpuseESLintConfig } from './src/index.ts';
|
|
3
|
-
|
|
4
|
-
// ── DPUse ESLint Configuration ───────────────────────────────────────────────────────────────────────────────────────
|
|
5
|
-
|
|
6
|
-
/** @type {import('eslint').Linter.Config[]} */
|
|
7
|
-
const config = dpuseESLintConfig({});
|
|
8
|
-
|
|
9
|
-
export default config;
|
package/src/index.ts
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
// ── External Dependencies & Registrations
|
|
2
|
-
import type { Linter } from 'eslint';
|
|
3
|
-
import pluginComments from '@eslint-community/eslint-plugin-eslint-comments';
|
|
4
|
-
import { flatConfigs as pluginImportFlatConfigs } from 'eslint-plugin-import-x';
|
|
5
|
-
import { configs as pluginRegexpConfigs } from 'eslint-plugin-regexp';
|
|
6
|
-
import pluginSecurity from 'eslint-plugin-security';
|
|
7
|
-
import pluginSonarJS from 'eslint-plugin-sonarjs';
|
|
8
|
-
import pluginUnicorn from 'eslint-plugin-unicorn';
|
|
9
|
-
import skipFormatting from 'eslint-config-prettier';
|
|
10
|
-
import tseslint from 'typescript-eslint';
|
|
11
|
-
import { defineConfig, globalIgnores } from 'eslint/config';
|
|
12
|
-
|
|
13
|
-
// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
14
|
-
|
|
15
|
-
/** Options accepted by the shared DPUse ESLint configuration factory. */
|
|
16
|
-
export interface DPUseESLintConfigOptions {
|
|
17
|
-
/** Glob patterns for the files to type-check. Defaults to the common DPUse project layout. */
|
|
18
|
-
files?: string[];
|
|
19
|
-
/** Extra glob patterns to ignore, on top of the standard DPUse build/report directories. */
|
|
20
|
-
ignores?: string[];
|
|
21
|
-
/** Module specifiers that `import-x` should treat as resolvable core modules (e.g. `cloudflare:workers`). */
|
|
22
|
-
importCoreModules?: string[];
|
|
23
|
-
/** Project-specific rule overrides, applied last so they take precedence over the shared defaults. */
|
|
24
|
-
rules?: Linter.RulesRecord;
|
|
25
|
-
/** Path to the consuming project's `tsconfig.json`. Defaults to `./tsconfig.json`, used by every DPUse project. */
|
|
26
|
-
tsconfigPath?: string;
|
|
27
|
-
/** The consuming project's root directory. Defaults to `process.cwd()`, correct as long as ESLint is run from the project root. */
|
|
28
|
-
tsconfigRootDir?: string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// ── ESLint Configuration ─────────────────────────────────────────────────────────────────────────────────────────────
|
|
32
|
-
|
|
33
|
-
export function dpuseESLintConfig(options: DPUseESLintConfigOptions): Linter.Config[] {
|
|
34
|
-
const {
|
|
35
|
-
files = ['eslint.config.js', 'src/**/*.ts', 'vite.config.ts', 'vitest.config.ts'],
|
|
36
|
-
ignores = [],
|
|
37
|
-
importCoreModules = [],
|
|
38
|
-
rules = {},
|
|
39
|
-
tsconfigPath = './tsconfig.json',
|
|
40
|
-
tsconfigRootDir: tsconfigRootDirectory = process.cwd()
|
|
41
|
-
} = options;
|
|
42
|
-
|
|
43
|
-
return defineConfig(
|
|
44
|
-
// Linting scope, strict TypeScript type-checking, and module resolver.
|
|
45
|
-
{
|
|
46
|
-
files,
|
|
47
|
-
extends: [...tseslint.configs.strictTypeChecked, ...tseslint.configs.stylisticTypeChecked],
|
|
48
|
-
languageOptions: {
|
|
49
|
-
parserOptions: { project: tsconfigPath, tsconfigRootDir: tsconfigRootDirectory }
|
|
50
|
-
},
|
|
51
|
-
settings: {
|
|
52
|
-
'import-x/core-modules': importCoreModules,
|
|
53
|
-
'import-x/resolver': {
|
|
54
|
-
typescript: { project: [tsconfigPath] }
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
// Ignores.
|
|
60
|
-
globalIgnores(['bundle-analysis-reports/**', 'dependency-check-bin/**', 'dependency-check-reports/**', 'dist/**', 'licenses/**', ...ignores]),
|
|
61
|
-
|
|
62
|
-
// Plugin configurations.
|
|
63
|
-
{
|
|
64
|
-
// '@eslint-community/eslint-comments' only ships a legacy config; manually convert to flat format.
|
|
65
|
-
plugins: { '@eslint-community/eslint-comments': pluginComments },
|
|
66
|
-
rules: {
|
|
67
|
-
'@eslint-community/eslint-comments/disable-enable-pair': 'error',
|
|
68
|
-
'@eslint-community/eslint-comments/no-aggregating-enable': 'error',
|
|
69
|
-
'@eslint-community/eslint-comments/no-duplicate-disable': 'error',
|
|
70
|
-
'@eslint-community/eslint-comments/no-unlimited-disable': 'error',
|
|
71
|
-
'@eslint-community/eslint-comments/no-unused-enable': 'error'
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
pluginImportFlatConfigs.recommended,
|
|
75
|
-
pluginRegexpConfigs['flat/recommended'],
|
|
76
|
-
pluginSecurity.configs.recommended,
|
|
77
|
-
pluginSonarJS.configs.recommended,
|
|
78
|
-
pluginUnicorn.configs.recommended,
|
|
79
|
-
skipFormatting,
|
|
80
|
-
|
|
81
|
-
// Rule overrides.
|
|
82
|
-
{
|
|
83
|
-
files,
|
|
84
|
-
rules: {
|
|
85
|
-
'sort-imports': ['warn', { allowSeparatedGroups: true, ignoreCase: true, memberSyntaxSortOrder: ['none', 'all', 'single', 'multiple'] }],
|
|
86
|
-
|
|
87
|
-
'@typescript-eslint/no-unused-vars': 'warn',
|
|
88
|
-
|
|
89
|
-
'@eslint-community/eslint-comments/require-description': 'warn',
|
|
90
|
-
|
|
91
|
-
'security/detect-object-injection': 'off', // Generates too many false positives.
|
|
92
|
-
|
|
93
|
-
'sonarjs/no-commented-code': 'warn',
|
|
94
|
-
'sonarjs/no-dead-store': 'warn',
|
|
95
|
-
'sonarjs/no-unused-vars': 'warn',
|
|
96
|
-
'sonarjs/todo-tag': 'warn',
|
|
97
|
-
|
|
98
|
-
'unicorn/filename-case': ['error', { cases: { camelCase: true, pascalCase: true } }],
|
|
99
|
-
'unicorn/no-null': 'off', // Null is required for JSON interop.
|
|
100
|
-
'unicorn/switch-case-braces': ['warn', 'avoid'],
|
|
101
|
-
|
|
102
|
-
...rules
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export default dpuseESLintConfig;
|
package/tsconfig.build.json
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"declaration": true,
|
|
4
|
-
"declarationMap": true,
|
|
5
|
-
"esModuleInterop": true,
|
|
6
|
-
"exactOptionalPropertyTypes": true,
|
|
7
|
-
"incremental": true,
|
|
8
|
-
"lib": ["ESNext"],
|
|
9
|
-
"module": "NodeNext",
|
|
10
|
-
"moduleDetection": "force",
|
|
11
|
-
"moduleResolution": "NodeNext",
|
|
12
|
-
"noImplicitOverride": true,
|
|
13
|
-
"noPropertyAccessFromIndexSignature": true,
|
|
14
|
-
"noUncheckedIndexedAccess": true,
|
|
15
|
-
"outDir": "dist",
|
|
16
|
-
"resolveJsonModule": true,
|
|
17
|
-
"rootDir": "src",
|
|
18
|
-
"skipLibCheck": true,
|
|
19
|
-
"sourceMap": true,
|
|
20
|
-
"strict": true,
|
|
21
|
-
"target": "ESNext",
|
|
22
|
-
"tsBuildInfoFile": "./node_modules/.cache/tsconfig.build.tsbuildinfo",
|
|
23
|
-
"types": ["node"],
|
|
24
|
-
"verbatimModuleSyntax": true
|
|
25
|
-
},
|
|
26
|
-
"include": ["src/**/*.ts"]
|
|
27
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"allowJs": true,
|
|
4
|
-
"allowImportingTsExtensions": true,
|
|
5
|
-
"esModuleInterop": true,
|
|
6
|
-
"exactOptionalPropertyTypes": true,
|
|
7
|
-
"incremental": true,
|
|
8
|
-
"lib": ["ESNext"],
|
|
9
|
-
"module": "NodeNext",
|
|
10
|
-
"moduleDetection": "force",
|
|
11
|
-
"moduleResolution": "NodeNext",
|
|
12
|
-
"noEmit": true,
|
|
13
|
-
"noImplicitOverride": true,
|
|
14
|
-
"noPropertyAccessFromIndexSignature": true,
|
|
15
|
-
"noUncheckedIndexedAccess": true,
|
|
16
|
-
"paths": { "@/*": ["./src/*"] },
|
|
17
|
-
"resolveJsonModule": true,
|
|
18
|
-
"skipLibCheck": true,
|
|
19
|
-
"strict": true,
|
|
20
|
-
"target": "ESNext",
|
|
21
|
-
"tsBuildInfoFile": "./node_modules/.cache/tsconfig.tsbuildinfo",
|
|
22
|
-
"types": ["node"],
|
|
23
|
-
"verbatimModuleSyntax": true
|
|
24
|
-
},
|
|
25
|
-
"include": ["eslint.config.js", "src/**/*.ts"]
|
|
26
|
-
}
|