@dpuse/eslint-config-dpuse 1.0.84 → 1.0.92
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/.gitattributes +2 -0
- package/config.json +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/{eslint.config.ts → eslint.config.js} +5 -2
- package/package.json +2 -3
- package/src/index.ts +4 -1
- package/tsconfig.json +1 -0
- package/eslint.config OLD.ts +0 -75
package/.gitattributes
CHANGED
package/config.json
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -14,7 +14,6 @@ export interface DPUseESLintConfigOptions {
|
|
|
14
14
|
/** The consuming project's root directory, e.g. `import.meta.dirname` from its own `eslint.config.ts`. */
|
|
15
15
|
tsconfigRootDir: string;
|
|
16
16
|
}
|
|
17
|
-
/** Configuration export. */
|
|
18
17
|
export declare function dpuseESLintConfig(options: DPUseESLintConfigOptions): Linter.Config[];
|
|
19
18
|
export default dpuseESLintConfig;
|
|
20
19
|
//# 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;AAarC,yEAAyE;AACzE,MAAM,WAAW,wBAAwB;IACrC,8FAA8F;IAC9F,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,4FAA4F;IAC5F,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,6GAA6G;IAC7G,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,sGAAsG;IACtG,KAAK,CAAC,EAAE,MAAM,CAAC,WAAW,CAAC;IAC3B,qGAAqG;IACrG,YAAY,EAAE,MAAM,CAAC;IACrB,0GAA0G;IAC1G,eAAe,EAAE,MAAM,CAAC;CAC3B;AAID,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,MAAM,CAAC,MAAM,EAAE,CAkEpF;AAED,eAAe,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import pluginUnicorn from 'eslint-plugin-unicorn';
|
|
|
7
7
|
import skipFormatting from 'eslint-config-prettier';
|
|
8
8
|
import tseslint from 'typescript-eslint';
|
|
9
9
|
import { defineConfig, globalIgnores } from 'eslint/config';
|
|
10
|
-
|
|
10
|
+
// ── ESLint Configuration ─────────────────────────────────────────────────────────────────────────────────────────────
|
|
11
11
|
export function dpuseESLintConfig(options) {
|
|
12
12
|
const { files = ['eslint.config.*', 'src/**/*.ts'], ignores = [], importCoreModules = [], rules = {}, tsconfigPath, tsconfigRootDir } = options;
|
|
13
13
|
return defineConfig(
|
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","sour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fig } from './src/index.ts';
|
|
3
3
|
|
|
4
4
|
// ── DPUse ESLint Configuration ───────────────────────────────────────────────────────────────────────────────────────
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
/** @type {import('eslint').Linter.Config[]} */
|
|
7
|
+
const config = dpuseESLintConfig({ tsconfigPath: './tsconfig.json', tsconfigRootDir: import.meta.dirname });
|
|
8
|
+
|
|
9
|
+
export default config;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dpuse/eslint-config-dpuse",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.92",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Common ESLint configuration used in most DPUse projects.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,11 +45,10 @@
|
|
|
45
45
|
"typescript-eslint": "^8.62.1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@dpuse/dpuse-development": "^0.3.
|
|
48
|
+
"@dpuse/dpuse-development": "^0.3.646",
|
|
49
49
|
"@types/eslint-plugin-security": "^3.0.1",
|
|
50
50
|
"@types/node": "^26.1.0",
|
|
51
51
|
"eslint": "^10.6.0",
|
|
52
|
-
"jiti": "^2.7.0",
|
|
53
52
|
"prettier": "^3.9.4",
|
|
54
53
|
"typescript": "^6.0.3",
|
|
55
54
|
"typescript-eslint": "^8.62.1"
|
package/src/index.ts
CHANGED
|
@@ -10,6 +10,8 @@ import skipFormatting from 'eslint-config-prettier';
|
|
|
10
10
|
import tseslint from 'typescript-eslint';
|
|
11
11
|
import { defineConfig, globalIgnores } from 'eslint/config';
|
|
12
12
|
|
|
13
|
+
// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
14
|
+
|
|
13
15
|
/** Options accepted by the shared DPUse ESLint configuration factory. */
|
|
14
16
|
export interface DPUseESLintConfigOptions {
|
|
15
17
|
/** Glob patterns for the files to type-check. Defaults to the common DPUse project layout. */
|
|
@@ -26,7 +28,8 @@ export interface DPUseESLintConfigOptions {
|
|
|
26
28
|
tsconfigRootDir: string;
|
|
27
29
|
}
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
// ── ESLint Configuration ─────────────────────────────────────────────────────────────────────────────────────────────
|
|
32
|
+
|
|
30
33
|
export function dpuseESLintConfig(options: DPUseESLintConfigOptions): Linter.Config[] {
|
|
31
34
|
const { files = ['eslint.config.*', 'src/**/*.ts'], ignores = [], importCoreModules = [], rules = {}, tsconfigPath, tsconfigRootDir } = options;
|
|
32
35
|
|
package/tsconfig.json
CHANGED
package/eslint.config OLD.ts
DELETED
|
@@ -1,75 +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
|
-
// ── ESLint Configuration ─────────────────────────────────────────────────────────────────────────────────────────────
|
|
14
|
-
|
|
15
|
-
export default defineConfig(
|
|
16
|
-
// Linting scope, strict TypeScript type-checking, and module resolver.
|
|
17
|
-
{
|
|
18
|
-
files: ['eslint.config.*', 'src/**/*.ts', 'vite.config.ts', 'vitest.config.ts'],
|
|
19
|
-
extends: [...tseslint.configs.strictTypeChecked, ...tseslint.configs.stylisticTypeChecked],
|
|
20
|
-
languageOptions: {
|
|
21
|
-
parserOptions: { project: './tsconfig.json' }
|
|
22
|
-
},
|
|
23
|
-
settings: {
|
|
24
|
-
'import-x/core-modules': ['cloudflare:workers'],
|
|
25
|
-
'import-x/resolver': {
|
|
26
|
-
typescript: { project: ['./tsconfig.json'] }
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
// Ignores.
|
|
32
|
-
globalIgnores(['bundle-analysis-reports/**', 'dependency-check-bin/**', 'dependency-check-reports/**', 'dist/**', 'licenses/**']),
|
|
33
|
-
|
|
34
|
-
// Plugin configurations.
|
|
35
|
-
{
|
|
36
|
-
// '@eslint-community/eslint-comments' only ships a legacy config; manually convert to flat format.
|
|
37
|
-
plugins: { '@eslint-community/eslint-comments': pluginComments },
|
|
38
|
-
rules: {
|
|
39
|
-
'@eslint-community/eslint-comments/disable-enable-pair': 'error',
|
|
40
|
-
'@eslint-community/eslint-comments/no-aggregating-enable': 'error',
|
|
41
|
-
'@eslint-community/eslint-comments/no-duplicate-disable': 'error',
|
|
42
|
-
'@eslint-community/eslint-comments/no-unlimited-disable': 'error',
|
|
43
|
-
'@eslint-community/eslint-comments/no-unused-enable': 'error'
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
pluginImportFlatConfigs.recommended,
|
|
47
|
-
pluginRegexpConfigs['flat/recommended'],
|
|
48
|
-
pluginSecurity.configs.recommended,
|
|
49
|
-
(pluginSonarJS.configs?.['recommended'] ?? {}) as Linter.Config,
|
|
50
|
-
pluginUnicorn.configs.recommended,
|
|
51
|
-
skipFormatting,
|
|
52
|
-
|
|
53
|
-
// Rule overrides.
|
|
54
|
-
{
|
|
55
|
-
rules: {
|
|
56
|
-
'sort-imports': ['warn', { allowSeparatedGroups: true, ignoreCase: true, memberSyntaxSortOrder: ['none', 'all', 'single', 'multiple'] }],
|
|
57
|
-
|
|
58
|
-
'@typescript-eslint/no-unused-vars': 'warn',
|
|
59
|
-
|
|
60
|
-
'@eslint-community/eslint-comments/require-description': 'warn',
|
|
61
|
-
|
|
62
|
-
'security/detect-object-injection': 'off',
|
|
63
|
-
|
|
64
|
-
'sonarjs/no-commented-code': 'warn',
|
|
65
|
-
'sonarjs/no-dead-store': 'warn',
|
|
66
|
-
'sonarjs/no-unused-vars': 'warn',
|
|
67
|
-
'sonarjs/todo-tag': 'warn',
|
|
68
|
-
|
|
69
|
-
'unicorn/filename-case': ['error', { cases: { camelCase: true, pascalCase: true }, ignore: ['updateDPUseDependencies'] }],
|
|
70
|
-
'unicorn/no-null': 'off',
|
|
71
|
-
'unicorn/no-process-exit': 'off', // This package only contains scripts that are run as package.json scripts.
|
|
72
|
-
'unicorn/switch-case-braces': ['warn', 'avoid']
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
);
|