@stride.it/appoint-lint-governance 0.1.10 → 0.1.11
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 +10 -1
- package/dist/index.js +56 -19
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,11 @@ interface TypescriptBaseOptions {
|
|
|
6
6
|
}
|
|
7
7
|
declare function typescriptBase(options?: TypescriptBaseOptions): typescript_eslint.FlatConfig.ConfigArray;
|
|
8
8
|
|
|
9
|
+
interface TypescriptConventionsOptions {
|
|
10
|
+
files?: string[];
|
|
11
|
+
}
|
|
12
|
+
declare function typescriptConventions(options?: TypescriptConventionsOptions): typescript_eslint.FlatConfig.ConfigArray;
|
|
13
|
+
|
|
9
14
|
type TypescriptConfigFiles = string[];
|
|
10
15
|
interface TypescriptMinimalOptions {
|
|
11
16
|
files?: TypescriptConfigFiles;
|
|
@@ -42,6 +47,10 @@ interface TypescriptRecommendedOptions {
|
|
|
42
47
|
*/
|
|
43
48
|
tsconfigRootDir?: string;
|
|
44
49
|
files?: string[];
|
|
50
|
+
/**
|
|
51
|
+
* When true (default), enables strict conventions (e.g. no default exports).
|
|
52
|
+
*/
|
|
53
|
+
enableConventions?: boolean;
|
|
45
54
|
}
|
|
46
55
|
declare function typescriptRecommended(options?: TypescriptRecommendedOptions): typescript_eslint.FlatConfig.ConfigArray;
|
|
47
56
|
|
|
@@ -62,4 +71,4 @@ declare function typescriptSizeComplexity(options?: TypescriptSizeComplexityOpti
|
|
|
62
71
|
*/
|
|
63
72
|
declare const plugin: ESLint.Plugin;
|
|
64
73
|
|
|
65
|
-
export { type TypescriptBaseOptions, type TypescriptMinimalOptions, type TypescriptPrettierOptions, type TypescriptRecommendedOptions, type TypescriptSecurityOptions, type TypescriptSizeComplexityOptions, plugin, typescriptBase, typescriptMinimal, typescriptPrettierInterop, typescriptRecommended, typescriptSizeComplexity };
|
|
74
|
+
export { type TypescriptBaseOptions, type TypescriptConventionsOptions, type TypescriptMinimalOptions, type TypescriptPrettierOptions, type TypescriptRecommendedOptions, type TypescriptSecurityOptions, type TypescriptSizeComplexityOptions, plugin, typescriptBase, typescriptConventions, typescriptMinimal, typescriptPrettierInterop, typescriptRecommended, typescriptSizeComplexity };
|
package/dist/index.js
CHANGED
|
@@ -27,13 +27,46 @@ function typescriptBase(options = {}) {
|
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
// src/configs/typescript/conventions.ts
|
|
31
|
+
import importPlugin from "eslint-plugin-import";
|
|
32
|
+
import tseslint2 from "typescript-eslint";
|
|
33
|
+
function typescriptConventions(options = {}) {
|
|
34
|
+
const files = options.files ?? ["**/*.{ts,tsx,mts,cts}"];
|
|
35
|
+
return tseslint2.config(
|
|
36
|
+
{
|
|
37
|
+
files,
|
|
38
|
+
plugins: {
|
|
39
|
+
import: importPlugin
|
|
40
|
+
},
|
|
41
|
+
rules: {
|
|
42
|
+
// 6.1 Rule table
|
|
43
|
+
"import/no-default-export": "error",
|
|
44
|
+
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
|
|
45
|
+
"@typescript-eslint/consistent-type-imports": "error",
|
|
46
|
+
"@typescript-eslint/consistent-type-exports": "error"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
// 6.2 Overrides
|
|
50
|
+
{
|
|
51
|
+
files: [
|
|
52
|
+
"**/*.config.{js,mjs,ts}",
|
|
53
|
+
"**/app/**/{page,layout,template,not-found,global-error,loading,error}.tsx",
|
|
54
|
+
"**/*.stories.tsx"
|
|
55
|
+
],
|
|
56
|
+
rules: {
|
|
57
|
+
"import/no-default-export": "off"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
30
63
|
// src/configs/typescript/docs.ts
|
|
31
64
|
import comments from "@eslint-community/eslint-plugin-eslint-comments";
|
|
32
65
|
import jsdoc from "eslint-plugin-jsdoc";
|
|
33
|
-
import
|
|
66
|
+
import tseslint3 from "typescript-eslint";
|
|
34
67
|
function typescriptDocs(options = {}) {
|
|
35
68
|
const files = options.files ?? ["**/*.{ts,tsx,mts,cts}"];
|
|
36
|
-
return
|
|
69
|
+
return tseslint3.config({
|
|
37
70
|
files,
|
|
38
71
|
plugins: {
|
|
39
72
|
jsdoc,
|
|
@@ -51,15 +84,15 @@ function typescriptDocs(options = {}) {
|
|
|
51
84
|
}
|
|
52
85
|
|
|
53
86
|
// src/configs/typescript/imports.ts
|
|
54
|
-
import
|
|
87
|
+
import importPlugin2 from "eslint-plugin-import";
|
|
55
88
|
import simpleImportSort from "eslint-plugin-simple-import-sort";
|
|
56
|
-
import
|
|
89
|
+
import tseslint4 from "typescript-eslint";
|
|
57
90
|
function typescriptImports(options = {}) {
|
|
58
91
|
const files = options.files ?? ["**/*.{ts,tsx,mts,cts}"];
|
|
59
|
-
return
|
|
92
|
+
return tseslint4.config({
|
|
60
93
|
files,
|
|
61
94
|
plugins: {
|
|
62
|
-
import:
|
|
95
|
+
import: importPlugin2,
|
|
63
96
|
"simple-import-sort": simpleImportSort
|
|
64
97
|
},
|
|
65
98
|
settings: {
|
|
@@ -95,10 +128,10 @@ function typescriptMinimal(options = {}) {
|
|
|
95
128
|
|
|
96
129
|
// src/configs/typescript/prettier.ts
|
|
97
130
|
import eslintConfigPrettier from "eslint-config-prettier";
|
|
98
|
-
import
|
|
131
|
+
import tseslint5 from "typescript-eslint";
|
|
99
132
|
function typescriptPrettierInterop(options = {}) {
|
|
100
133
|
const files = options.files ?? ["**/*.{ts,tsx,mts,cts}"];
|
|
101
|
-
return
|
|
134
|
+
return tseslint5.config({
|
|
102
135
|
files,
|
|
103
136
|
rules: {
|
|
104
137
|
...eslintConfigPrettier.rules
|
|
@@ -107,15 +140,15 @@ function typescriptPrettierInterop(options = {}) {
|
|
|
107
140
|
}
|
|
108
141
|
|
|
109
142
|
// src/configs/typescript/recommended.ts
|
|
110
|
-
import
|
|
143
|
+
import tseslint10 from "typescript-eslint";
|
|
111
144
|
|
|
112
145
|
// src/configs/typescript/quality.ts
|
|
113
146
|
import sonarjs from "eslint-plugin-sonarjs";
|
|
114
147
|
import unicorn from "eslint-plugin-unicorn";
|
|
115
|
-
import
|
|
148
|
+
import tseslint6 from "typescript-eslint";
|
|
116
149
|
function typescriptQuality(options = {}) {
|
|
117
150
|
const files = options.files ?? ["**/*.{ts,tsx,mts,cts}"];
|
|
118
|
-
return
|
|
151
|
+
return tseslint6.config({
|
|
119
152
|
files,
|
|
120
153
|
plugins: {
|
|
121
154
|
unicorn,
|
|
@@ -162,10 +195,10 @@ function typescriptQuality(options = {}) {
|
|
|
162
195
|
// src/configs/typescript/security.ts
|
|
163
196
|
import regexpPlugin from "eslint-plugin-regexp";
|
|
164
197
|
import securityPlugin from "eslint-plugin-security";
|
|
165
|
-
import
|
|
198
|
+
import tseslint7 from "typescript-eslint";
|
|
166
199
|
function typescriptSecurity(options = {}) {
|
|
167
200
|
const files = options.files ?? ["**/*.{ts,tsx,mts,cts}"];
|
|
168
|
-
return
|
|
201
|
+
return tseslint7.config({
|
|
169
202
|
files,
|
|
170
203
|
plugins: {
|
|
171
204
|
security: securityPlugin,
|
|
@@ -184,10 +217,10 @@ function typescriptSecurity(options = {}) {
|
|
|
184
217
|
}
|
|
185
218
|
|
|
186
219
|
// src/configs/typescript/size-complexity.ts
|
|
187
|
-
import
|
|
220
|
+
import tseslint8 from "typescript-eslint";
|
|
188
221
|
function typescriptSizeComplexity(options = {}) {
|
|
189
222
|
const files = options.files ?? ["**/*.{ts,tsx,mts,cts}"];
|
|
190
|
-
return
|
|
223
|
+
return tseslint8.config({
|
|
191
224
|
files,
|
|
192
225
|
rules: {
|
|
193
226
|
"max-lines": [
|
|
@@ -207,10 +240,10 @@ function typescriptSizeComplexity(options = {}) {
|
|
|
207
240
|
}
|
|
208
241
|
|
|
209
242
|
// src/configs/typescript/type-aware.ts
|
|
210
|
-
import
|
|
243
|
+
import tseslint9 from "typescript-eslint";
|
|
211
244
|
function typescriptTypeAware(options = {}) {
|
|
212
245
|
const files = options.files ?? ["**/*.{ts,tsx,mts,cts}"];
|
|
213
|
-
return
|
|
246
|
+
return tseslint9.config({
|
|
214
247
|
files,
|
|
215
248
|
languageOptions: {
|
|
216
249
|
parserOptions: {
|
|
@@ -233,19 +266,22 @@ function typescriptTypeAware(options = {}) {
|
|
|
233
266
|
// src/configs/typescript/recommended.ts
|
|
234
267
|
function typescriptRecommended(options = {}) {
|
|
235
268
|
const files = options.files ?? ["**/*.{ts,tsx,mts,cts}"];
|
|
236
|
-
const
|
|
269
|
+
const enableConventions = options.enableConventions ?? true;
|
|
270
|
+
const upstreamConfigs = options.typeChecked ? tseslint10.configs.recommendedTypeChecked : tseslint10.configs.recommended;
|
|
237
271
|
const typeAwareConfig = options.typeChecked ? typescriptTypeAware({
|
|
238
272
|
files,
|
|
239
273
|
tsconfigPath: options.tsconfigPath,
|
|
240
274
|
tsconfigRootDir: options.tsconfigRootDir
|
|
241
275
|
}) : [];
|
|
242
|
-
|
|
276
|
+
const conventionsConfig = enableConventions ? typescriptConventions({ files }) : [];
|
|
277
|
+
return tseslint10.config(
|
|
243
278
|
...typescriptBase({ files }),
|
|
244
279
|
...typescriptQuality({ files }),
|
|
245
280
|
...typescriptImports({ files }),
|
|
246
281
|
...typescriptSecurity({ files }),
|
|
247
282
|
...typescriptDocs({ files }),
|
|
248
283
|
...typescriptSizeComplexity({ files }),
|
|
284
|
+
...conventionsConfig,
|
|
249
285
|
...typeAwareConfig,
|
|
250
286
|
...upstreamConfigs.map((config) => ({
|
|
251
287
|
...config,
|
|
@@ -261,6 +297,7 @@ var plugin = {
|
|
|
261
297
|
export {
|
|
262
298
|
plugin,
|
|
263
299
|
typescriptBase,
|
|
300
|
+
typescriptConventions,
|
|
264
301
|
typescriptMinimal,
|
|
265
302
|
typescriptPrettierInterop,
|
|
266
303
|
typescriptRecommended,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/configs/typescript/base.ts","../src/configs/typescript/docs.ts","../src/configs/typescript/imports.ts","../src/configs/typescript/minimal.ts","../src/configs/typescript/prettier.ts","../src/configs/typescript/recommended.ts","../src/configs/typescript/quality.ts","../src/configs/typescript/security.ts","../src/configs/typescript/size-complexity.ts","../src/configs/typescript/type-aware.ts","../src/plugin/index.ts"],"sourcesContent":["import tseslint from \"typescript-eslint\";\r\n\r\nexport interface TypescriptBaseOptions {\r\n files?: string[];\r\n}\r\n\r\nexport function typescriptBase(options: TypescriptBaseOptions = {}) {\r\n const files = options.files ?? [\"**/*.{ts,tsx,mts,cts}\"];\r\n\r\n return tseslint.config({\r\n files,\r\n plugins: {\r\n \"@typescript-eslint\": tseslint.plugin,\r\n },\r\n languageOptions: {\r\n parser: tseslint.parser,\r\n parserOptions: {\r\n ecmaVersion: \"latest\",\r\n sourceType: \"module\",\r\n },\r\n },\r\n rules: {\r\n \"@typescript-eslint/consistent-type-imports\": \"error\",\r\n \"@typescript-eslint/no-unused-vars\": \"error\",\r\n \"@typescript-eslint/no-shadow\": \"error\",\r\n \"@typescript-eslint/ban-ts-comment\": \"error\",\r\n \"@typescript-eslint/no-explicit-any\": \"warn\",\r\n \"@typescript-eslint/no-inferrable-types\": \"error\",\r\n \"no-undef\": \"off\",\r\n \"no-unused-vars\": \"off\",\r\n },\r\n });\r\n}\r\n","import comments from \"@eslint-community/eslint-plugin-eslint-comments\";\r\nimport jsdoc from \"eslint-plugin-jsdoc\";\r\nimport tseslint from \"typescript-eslint\";\r\n\r\nexport interface TypescriptDocsOptions {\r\n files?: string[];\r\n}\r\n\r\nexport function typescriptDocs(options: TypescriptDocsOptions = {}) {\r\n const files = options.files ?? [\"**/*.{ts,tsx,mts,cts}\"];\r\n\r\n return tseslint.config({\r\n files,\r\n plugins: {\r\n jsdoc: jsdoc,\r\n \"eslint-comments\": comments,\r\n },\r\n rules: {\r\n \"eslint-comments/no-unused-disable\": \"error\",\r\n \"eslint-comments/require-description\": \"error\",\r\n \"eslint-comments/disable-enable-pair\": \"error\",\r\n \"jsdoc/check-alignment\": \"error\",\r\n \"jsdoc/require-param\": \"error\",\r\n \"jsdoc/require-returns\": \"error\",\r\n },\r\n });\r\n}\r\n","import importPlugin from \"eslint-plugin-import\";\r\nimport simpleImportSort from \"eslint-plugin-simple-import-sort\";\r\nimport tseslint from \"typescript-eslint\";\r\n\r\nexport interface TypescriptImportsOptions {\r\n files?: string[];\r\n}\r\n\r\nexport function typescriptImports(options: TypescriptImportsOptions = {}) {\r\n const files = options.files ?? [\"**/*.{ts,tsx,mts,cts}\"];\r\n\r\n return tseslint.config({\r\n files,\r\n plugins: {\r\n import: importPlugin,\r\n \"simple-import-sort\": simpleImportSort,\r\n },\r\n settings: {\r\n \"import/parsers\": {\r\n \"@typescript-eslint/parser\": [\".ts\", \".tsx\", \".mts\", \".cts\"],\r\n },\r\n \"import/resolver\": {\r\n typescript: {\r\n alwaysTryTypes: true,\r\n project: [\"tsconfig.json\", \"*/tsconfig.json\"],\r\n },\r\n node: true,\r\n },\r\n },\r\n rules: {\r\n // Import Correctness\r\n \"import/no-duplicates\": \"error\",\r\n \"import/no-cycle\": \"error\",\r\n \"import/no-mutable-exports\": \"error\",\r\n \"import/first\": \"error\",\r\n \"import/newline-after-import\": \"error\",\r\n\r\n // Sorting\r\n \"simple-import-sort/imports\": \"error\",\r\n \"simple-import-sort/exports\": \"error\",\r\n },\r\n });\r\n}\r\n","import { typescriptBase } from \"./base.js\";\r\n\r\nexport type TypescriptConfigFiles = string[];\r\n\r\nexport interface TypescriptMinimalOptions {\r\n files?: TypescriptConfigFiles;\r\n}\r\n\r\n/**\r\n * MVP TypeScript profile.\r\n *\r\n * Intentionally minimal: enables TypeScript parsing and one rule to prove\r\n * end-to-end packaging + consumption.\r\n * @param options - Configuration options.\r\n * @returns The ESLint configuration.\r\n */\r\nexport function typescriptMinimal(options: TypescriptMinimalOptions = {}) {\r\n return typescriptBase(options);\r\n}\r\n","import eslintConfigPrettier from \"eslint-config-prettier\";\r\nimport tseslint from \"typescript-eslint\";\r\n\r\nexport interface TypescriptPrettierOptions {\r\n files?: string[];\r\n}\r\n\r\nexport function typescriptPrettierInterop(\r\n options: TypescriptPrettierOptions = {}\r\n) {\r\n const files = options.files ?? [\"**/*.{ts,tsx,mts,cts}\"];\r\n\r\n return tseslint.config({\r\n files,\r\n rules: {\r\n ...eslintConfigPrettier.rules,\r\n },\r\n });\r\n}\r\n","import tseslint from \"typescript-eslint\";\r\n\r\nimport { typescriptBase } from \"./base.js\";\r\nimport { typescriptDocs } from \"./docs.js\";\r\nimport { typescriptImports } from \"./imports.js\";\r\nimport { typescriptQuality } from \"./quality.js\";\r\nimport { typescriptSecurity } from \"./security.js\";\r\nimport { typescriptSizeComplexity } from \"./size-complexity.js\";\r\nimport { typescriptTypeAware } from \"./type-aware.js\";\r\n\r\nexport interface TypescriptRecommendedOptions {\r\n /**\r\n * When set, enables type-aware rules (more powerful, can be slower).\r\n *\r\n * Recommended for mature codebases, but not required for MVP.\r\n */\r\n typeChecked?: boolean;\r\n\r\n /**\r\n * Type-aware linting requires a project TSConfig.\r\n * Example: \"./tsconfig.json\".\r\n */\r\n tsconfigPath?: string | string[];\r\n\r\n /**\r\n * tsconfigRootDir should usually be import.meta.dirname from the consumer repo.\r\n */\r\n tsconfigRootDir?: string;\r\n\r\n files?: string[];\r\n}\r\n\r\nexport function typescriptRecommended(\r\n options: TypescriptRecommendedOptions = {}\r\n) {\r\n const files = options.files ?? [\"**/*.{ts,tsx,mts,cts}\"];\r\n\r\n const upstreamConfigs = options.typeChecked\r\n ? tseslint.configs.recommendedTypeChecked\r\n : tseslint.configs.recommended;\r\n\r\n const typeAwareConfig = options.typeChecked\r\n ? typescriptTypeAware({\r\n files,\r\n tsconfigPath: options.tsconfigPath,\r\n tsconfigRootDir: options.tsconfigRootDir,\r\n })\r\n : [];\r\n\r\n return tseslint.config(\r\n ...typescriptBase({ files }),\r\n ...typescriptQuality({ files }),\r\n ...typescriptImports({ files }),\r\n ...typescriptSecurity({ files }),\r\n ...typescriptDocs({ files }),\r\n ...typescriptSizeComplexity({ files }),\r\n ...typeAwareConfig,\r\n ...upstreamConfigs.map((config) => ({\r\n ...config,\r\n files,\r\n }))\r\n );\r\n}\r\n","import sonarjs from \"eslint-plugin-sonarjs\";\r\nimport unicorn from \"eslint-plugin-unicorn\";\r\nimport tseslint from \"typescript-eslint\";\r\n\r\nexport interface TypescriptQualityOptions {\r\n files?: string[];\r\n}\r\n\r\nexport function typescriptQuality(options: TypescriptQualityOptions = {}) {\r\n const files = options.files ?? [\"**/*.{ts,tsx,mts,cts}\"];\r\n\r\n return tseslint.config({\r\n files,\r\n plugins: {\r\n unicorn,\r\n sonarjs,\r\n },\r\n rules: {\r\n // Unicorn\r\n \"unicorn/prefer-node-protocol\": \"error\",\r\n \"unicorn/no-useless-undefined\": \"error\",\r\n \"unicorn/no-lonely-if\": \"error\",\r\n \"unicorn/prefer-optional-catch-binding\": \"error\",\r\n \"unicorn/prefer-string-replace-all\": \"error\",\r\n \"unicorn/prevent-abbreviations\": [\r\n \"warn\",\r\n {\r\n allowList: {\r\n Props: true,\r\n props: true,\r\n Ref: true,\r\n ref: true,\r\n Src: true,\r\n src: true,\r\n Params: true,\r\n params: true,\r\n Env: true,\r\n env: true,\r\n Args: true,\r\n args: true,\r\n Docs: true,\r\n docs: true,\r\n },\r\n },\r\n ],\r\n\r\n // SonarJS\r\n \"sonarjs/cognitive-complexity\": [\"error\", 15],\r\n \"sonarjs/no-identical-functions\": \"error\",\r\n \"sonarjs/no-duplicated-branches\": \"error\",\r\n \"sonarjs/no-redundant-boolean\": \"error\",\r\n \"sonarjs/no-inverted-boolean-check\": \"error\",\r\n },\r\n });\r\n}\r\n","import regexpPlugin from \"eslint-plugin-regexp\";\r\nimport securityPlugin from \"eslint-plugin-security\";\r\nimport tseslint, { type FlatConfig } from \"typescript-eslint\";\r\n\r\nexport interface TypescriptSecurityOptions {\r\n files?: string[];\r\n}\r\n\r\nexport function typescriptSecurity(options: TypescriptSecurityOptions = {}) {\r\n const files = options.files ?? [\"**/*.{ts,tsx,mts,cts}\"];\r\n\r\n return tseslint.config({\r\n files,\r\n plugins: {\r\n security: securityPlugin as unknown as FlatConfig.Plugin,\r\n regexp: regexpPlugin,\r\n },\r\n rules: {\r\n // eslint-plugin-security\r\n \"security/detect-object-injection\": \"error\",\r\n \"security/detect-unsafe-regex\": \"error\",\r\n\r\n // eslint-plugin-regexp\r\n \"regexp/no-super-linear-backtracking\": \"error\",\r\n \"regexp/no-useless-escape\": \"error\",\r\n \"regexp/no-empty-capturing-group\": \"error\",\r\n },\r\n });\r\n}\r\n","import tseslint from \"typescript-eslint\";\r\n\r\nexport interface TypescriptSizeComplexityOptions {\r\n files?: string[];\r\n}\r\n\r\nexport function typescriptSizeComplexity(\r\n options: TypescriptSizeComplexityOptions = {}\r\n) {\r\n const files = options.files ?? [\"**/*.{ts,tsx,mts,cts}\"];\r\n\r\n return tseslint.config({\r\n files,\r\n rules: {\r\n \"max-lines\": [\r\n \"error\",\r\n { max: 100, skipBlankLines: true, skipComments: true },\r\n ],\r\n \"max-lines-per-function\": [\r\n \"error\",\r\n { max: 50, skipBlankLines: true, skipComments: true },\r\n ],\r\n complexity: [\"error\", 15],\r\n \"max-params\": [\"error\", 3],\r\n \"no-var\": \"error\",\r\n \"prefer-const\": \"warn\",\r\n },\r\n });\r\n}\r\n","import tseslint from \"typescript-eslint\";\r\n\r\nexport interface TypescriptTypeAwareOptions {\r\n /**\r\n * Type-aware linting requires a project TSConfig.\r\n * Example: \"./tsconfig.json\".\r\n */\r\n tsconfigPath?: string | string[];\r\n\r\n /**\r\n * tsconfigRootDir should usually be import.meta.dirname from the consumer repo.\r\n */\r\n tsconfigRootDir?: string;\r\n\r\n files?: string[];\r\n}\r\n\r\nexport function typescriptTypeAware(options: TypescriptTypeAwareOptions = {}) {\r\n const files = options.files ?? [\"**/*.{ts,tsx,mts,cts}\"];\r\n\r\n return tseslint.config({\r\n files,\r\n languageOptions: {\r\n parserOptions: {\r\n project: options.tsconfigPath ?? \"./tsconfig.json\",\r\n tsconfigRootDir: options.tsconfigRootDir,\r\n },\r\n },\r\n rules: {\r\n \"@typescript-eslint/require-await\": \"error\",\r\n \"@typescript-eslint/no-floating-promises\": \"error\",\r\n \"@typescript-eslint/no-misused-promises\": \"error\",\r\n \"@typescript-eslint/await-thenable\": \"error\",\r\n \"@typescript-eslint/no-unnecessary-condition\": \"warn\",\r\n \"@typescript-eslint/no-unnecessary-type-assertion\": \"error\",\r\n \"@typescript-eslint/restrict-template-expressions\": \"error\",\r\n },\r\n });\r\n}\r\n","import type { ESLint } from \"eslint\";\r\n\r\n/**\r\n * Placeholder for future custom rules.\r\n *\r\n * Exporting a plugin object now keeps the package structure stable as you add\r\n * domain-specific rules later.\r\n */\r\nexport const plugin: ESLint.Plugin = {\r\n rules: {},\r\n};\r\n"],"mappings":";AAAA,OAAO,cAAc;AAMd,SAAS,eAAe,UAAiC,CAAC,GAAG;AAClE,QAAM,QAAQ,QAAQ,SAAS,CAAC,uBAAuB;AAEvD,SAAO,SAAS,OAAO;AAAA,IACrB;AAAA,IACA,SAAS;AAAA,MACP,sBAAsB,SAAS;AAAA,IACjC;AAAA,IACA,iBAAiB;AAAA,MACf,QAAQ,SAAS;AAAA,MACjB,eAAe;AAAA,QACb,aAAa;AAAA,QACb,YAAY;AAAA,MACd;AAAA,IACF;AAAA,IACA,OAAO;AAAA,MACL,8CAA8C;AAAA,MAC9C,qCAAqC;AAAA,MACrC,gCAAgC;AAAA,MAChC,qCAAqC;AAAA,MACrC,sCAAsC;AAAA,MACtC,0CAA0C;AAAA,MAC1C,YAAY;AAAA,MACZ,kBAAkB;AAAA,IACpB;AAAA,EACF,CAAC;AACH;;;AChCA,OAAO,cAAc;AACrB,OAAO,WAAW;AAClB,OAAOA,eAAc;AAMd,SAAS,eAAe,UAAiC,CAAC,GAAG;AAClE,QAAM,QAAQ,QA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QAAQ,cAC5BC,UAAS,QAAQ,yBACjBA,UAAS,QAAQ;AAErB,QAAM,kBAAkB,QAAQ,cAC5B,oBAAoB;AAAA,IAClB;AAAA,IACA,cAAc,QAAQ;AAAA,IACtB,iBAAiB,QAAQ;AAAA,EAC3B,CAAC,IACD,CAAC;AAEL,SAAOA,UAAS;AAAA,IACd,GAAG,eAAe,EAAE,MAAM,CAAC;AAAA,IAC3B,GAAG,kBAAkB,EAAE,MAAM,CAAC;AAAA,IAC9B,GAAG,kBAAkB,EAAE,MAAM,CAAC;AAAA,IAC9B,GAAG,mBAAmB,EAAE,MAAM,CAAC;AAAA,IAC/B,GAAG,eAAe,EAAE,MAAM,CAAC;AAAA,IAC3B,GAAG,yBAAyB,EAAE,MAAM,CAAC;AAAA,IACrC,GAAG;AAAA,IACH,GAAG,gBAAgB,IAAI,CAAC,YAAY;AAAA,MAClC,GAAG;AAAA,MACH;AAAA,IACF,EAAE;AAAA,EACJ;AACF;;;AKtDO,IAAM,SAAwB;AAAA,EACnC,OAAO,CAAC;AACV;","names":["tseslint","tseslint","tseslint","tseslint","tseslint","tseslint","tseslint","tseslint","tseslint"]}
|
|
1
|
+
{"version":3,"sources":["../src/configs/typescript/base.ts","../src/configs/typescript/conventions.ts","../src/configs/typescript/docs.ts","../src/configs/typescript/imports.ts","../src/configs/typescript/minimal.ts","../src/configs/typescript/prettier.ts","../src/configs/typescript/recommended.ts","../src/configs/typescript/quality.ts","../src/configs/typescript/security.ts","../src/configs/typescript/size-complexity.ts","../src/configs/typescript/type-aware.ts","../src/plugin/index.ts"],"sourcesContent":["import tseslint from \"typescript-eslint\";\r\n\r\nexport interface TypescriptBaseOptions {\r\n files?: string[];\r\n}\r\n\r\nexport function typescriptBase(options: TypescriptBaseOptions = {}) {\r\n const files = options.files ?? [\"**/*.{ts,tsx,mts,cts}\"];\r\n\r\n return tseslint.config({\r\n files,\r\n plugins: {\r\n \"@typescript-eslint\": tseslint.plugin,\r\n },\r\n languageOptions: {\r\n parser: tseslint.parser,\r\n parserOptions: {\r\n ecmaVersion: \"latest\",\r\n sourceType: \"module\",\r\n },\r\n },\r\n rules: {\r\n \"@typescript-eslint/consistent-type-imports\": \"error\",\r\n \"@typescript-eslint/no-unused-vars\": \"error\",\r\n \"@typescript-eslint/no-shadow\": \"error\",\r\n \"@typescript-eslint/ban-ts-comment\": \"error\",\r\n \"@typescript-eslint/no-explicit-any\": \"warn\",\r\n \"@typescript-eslint/no-inferrable-types\": \"error\",\r\n \"no-undef\": \"off\",\r\n \"no-unused-vars\": \"off\",\r\n },\r\n });\r\n}\r\n","import importPlugin from \"eslint-plugin-import\";\r\nimport tseslint from \"typescript-eslint\";\r\n\r\nexport interface TypescriptConventionsOptions {\r\n files?: string[];\r\n}\r\n\r\nexport function typescriptConventions(\r\n options: TypescriptConventionsOptions = {}\r\n) {\r\n const files = options.files ?? [\"**/*.{ts,tsx,mts,cts}\"];\r\n\r\n return tseslint.config(\r\n {\r\n files,\r\n plugins: {\r\n import: importPlugin,\r\n },\r\n rules: {\r\n // 6.1 Rule table\r\n \"import/no-default-export\": \"error\",\r\n \"@typescript-eslint/consistent-type-definitions\": [\"error\", \"type\"],\r\n \"@typescript-eslint/consistent-type-imports\": \"error\",\r\n \"@typescript-eslint/consistent-type-exports\": \"error\",\r\n },\r\n },\r\n // 6.2 Overrides\r\n {\r\n files: [\r\n \"**/*.config.{js,mjs,ts}\",\r\n \"**/app/**/{page,layout,template,not-found,global-error,loading,error}.tsx\",\r\n \"**/*.stories.tsx\",\r\n ],\r\n rules: {\r\n \"import/no-default-export\": \"off\",\r\n },\r\n }\r\n );\r\n}\r\n","import comments from \"@eslint-community/eslint-plugin-eslint-comments\";\r\nimport jsdoc from \"eslint-plugin-jsdoc\";\r\nimport tseslint from \"typescript-eslint\";\r\n\r\nexport interface TypescriptDocsOptions {\r\n files?: string[];\r\n}\r\n\r\nexport function typescriptDocs(options: TypescriptDocsOptions = {}) {\r\n const files = options.files ?? [\"**/*.{ts,tsx,mts,cts}\"];\r\n\r\n return tseslint.config({\r\n files,\r\n plugins: {\r\n jsdoc: jsdoc,\r\n \"eslint-comments\": comments,\r\n },\r\n rules: {\r\n \"eslint-comments/no-unused-disable\": \"error\",\r\n \"eslint-comments/require-description\": \"error\",\r\n \"eslint-comments/disable-enable-pair\": \"error\",\r\n \"jsdoc/check-alignment\": \"error\",\r\n \"jsdoc/require-param\": \"error\",\r\n \"jsdoc/require-returns\": \"error\",\r\n },\r\n });\r\n}\r\n","import importPlugin from \"eslint-plugin-import\";\r\nimport simpleImportSort from \"eslint-plugin-simple-import-sort\";\r\nimport tseslint from \"typescript-eslint\";\r\n\r\nexport interface TypescriptImportsOptions {\r\n files?: string[];\r\n}\r\n\r\nexport function typescriptImports(options: TypescriptImportsOptions = {}) {\r\n const files = options.files ?? [\"**/*.{ts,tsx,mts,cts}\"];\r\n\r\n return tseslint.config({\r\n files,\r\n plugins: {\r\n import: importPlugin,\r\n \"simple-import-sort\": simpleImportSort,\r\n },\r\n settings: {\r\n \"import/parsers\": {\r\n \"@typescript-eslint/parser\": [\".ts\", \".tsx\", \".mts\", \".cts\"],\r\n },\r\n \"import/resolver\": {\r\n typescript: {\r\n alwaysTryTypes: true,\r\n project: [\"tsconfig.json\", \"*/tsconfig.json\"],\r\n },\r\n node: true,\r\n },\r\n },\r\n rules: {\r\n // Import Correctness\r\n \"import/no-duplicates\": \"error\",\r\n \"import/no-cycle\": \"error\",\r\n \"import/no-mutable-exports\": \"error\",\r\n \"import/first\": \"error\",\r\n \"import/newline-after-import\": \"error\",\r\n\r\n // Sorting\r\n \"simple-import-sort/imports\": \"error\",\r\n \"simple-import-sort/exports\": \"error\",\r\n },\r\n });\r\n}\r\n","import { typescriptBase } from \"./base.js\";\r\n\r\nexport type TypescriptConfigFiles = string[];\r\n\r\nexport interface TypescriptMinimalOptions {\r\n files?: TypescriptConfigFiles;\r\n}\r\n\r\n/**\r\n * MVP TypeScript profile.\r\n *\r\n * Intentionally minimal: enables TypeScript parsing and one rule to prove\r\n * end-to-end packaging + consumption.\r\n * @param options - Configuration options.\r\n * @returns The ESLint configuration.\r\n */\r\nexport function typescriptMinimal(options: TypescriptMinimalOptions = {}) {\r\n return typescriptBase(options);\r\n}\r\n","import eslintConfigPrettier from \"eslint-config-prettier\";\r\nimport tseslint from \"typescript-eslint\";\r\n\r\nexport interface TypescriptPrettierOptions {\r\n files?: string[];\r\n}\r\n\r\nexport function typescriptPrettierInterop(\r\n options: TypescriptPrettierOptions = {}\r\n) {\r\n const files = options.files ?? [\"**/*.{ts,tsx,mts,cts}\"];\r\n\r\n return tseslint.config({\r\n files,\r\n rules: {\r\n ...eslintConfigPrettier.rules,\r\n },\r\n });\r\n}\r\n","import tseslint from \"typescript-eslint\";\r\n\r\nimport { typescriptBase } from \"./base.js\";\r\nimport { typescriptConventions } from \"./conventions.js\";\r\nimport { typescriptDocs } from \"./docs.js\";\r\nimport { typescriptImports } from \"./imports.js\";\r\nimport { typescriptQuality } from \"./quality.js\";\r\nimport { typescriptSecurity } from \"./security.js\";\r\nimport { typescriptSizeComplexity } from \"./size-complexity.js\";\r\nimport { typescriptTypeAware } from \"./type-aware.js\";\r\n\r\nexport interface TypescriptRecommendedOptions {\r\n /**\r\n * When set, enables type-aware rules (more powerful, can be slower).\r\n *\r\n * Recommended for mature codebases, but not required for MVP.\r\n */\r\n typeChecked?: boolean;\r\n\r\n /**\r\n * Type-aware linting requires a project TSConfig.\r\n * Example: \"./tsconfig.json\".\r\n */\r\n tsconfigPath?: string | string[];\r\n\r\n /**\r\n * tsconfigRootDir should usually be import.meta.dirname from the consumer repo.\r\n */\r\n tsconfigRootDir?: string;\r\n\r\n files?: string[];\r\n\r\n /**\r\n * When true (default), enables strict conventions (e.g. no default exports).\r\n */\r\n enableConventions?: boolean;\r\n}\r\n\r\nexport function typescriptRecommended(\r\n options: TypescriptRecommendedOptions = {}\r\n) {\r\n const files = options.files ?? [\"**/*.{ts,tsx,mts,cts}\"];\r\n const enableConventions = options.enableConventions ?? true;\r\n\r\n const upstreamConfigs = options.typeChecked\r\n ? tseslint.configs.recommendedTypeChecked\r\n : tseslint.configs.recommended;\r\n\r\n const typeAwareConfig = options.typeChecked\r\n ? typescriptTypeAware({\r\n files,\r\n tsconfigPath: options.tsconfigPath,\r\n tsconfigRootDir: options.tsconfigRootDir,\r\n })\r\n : [];\r\n\r\n const conventionsConfig = enableConventions\r\n ? typescriptConventions({ files })\r\n : [];\r\n\r\n return tseslint.config(\r\n ...typescriptBase({ files }),\r\n ...typescriptQuality({ files }),\r\n ...typescriptImports({ files }),\r\n ...typescriptSecurity({ files }),\r\n ...typescriptDocs({ files }),\r\n ...typescriptSizeComplexity({ files }),\r\n ...conventionsConfig,\r\n ...typeAwareConfig,\r\n ...upstreamConfigs.map((config) => ({\r\n ...config,\r\n files,\r\n }))\r\n );\r\n}\r\n","import sonarjs from \"eslint-plugin-sonarjs\";\r\nimport unicorn from \"eslint-plugin-unicorn\";\r\nimport tseslint from \"typescript-eslint\";\r\n\r\nexport interface TypescriptQualityOptions {\r\n files?: string[];\r\n}\r\n\r\nexport function typescriptQuality(options: TypescriptQualityOptions = {}) {\r\n const files = options.files ?? [\"**/*.{ts,tsx,mts,cts}\"];\r\n\r\n return tseslint.config({\r\n files,\r\n plugins: {\r\n unicorn,\r\n sonarjs,\r\n },\r\n rules: {\r\n // Unicorn\r\n \"unicorn/prefer-node-protocol\": \"error\",\r\n \"unicorn/no-useless-undefined\": \"error\",\r\n \"unicorn/no-lonely-if\": \"error\",\r\n \"unicorn/prefer-optional-catch-binding\": \"error\",\r\n \"unicorn/prefer-string-replace-all\": \"error\",\r\n \"unicorn/prevent-abbreviations\": [\r\n \"warn\",\r\n {\r\n allowList: {\r\n Props: true,\r\n props: true,\r\n Ref: true,\r\n ref: true,\r\n Src: true,\r\n src: true,\r\n Params: true,\r\n params: true,\r\n Env: true,\r\n env: true,\r\n Args: true,\r\n args: true,\r\n Docs: true,\r\n docs: true,\r\n },\r\n },\r\n ],\r\n\r\n // SonarJS\r\n \"sonarjs/cognitive-complexity\": [\"error\", 15],\r\n \"sonarjs/no-identical-functions\": \"error\",\r\n \"sonarjs/no-duplicated-branches\": \"error\",\r\n \"sonarjs/no-redundant-boolean\": \"error\",\r\n \"sonarjs/no-inverted-boolean-check\": \"error\",\r\n },\r\n });\r\n}\r\n","import regexpPlugin from \"eslint-plugin-regexp\";\r\nimport securityPlugin from \"eslint-plugin-security\";\r\nimport tseslint, { type FlatConfig } from \"typescript-eslint\";\r\n\r\nexport interface TypescriptSecurityOptions {\r\n files?: string[];\r\n}\r\n\r\nexport function typescriptSecurity(options: TypescriptSecurityOptions = {}) {\r\n const files = options.files ?? [\"**/*.{ts,tsx,mts,cts}\"];\r\n\r\n return tseslint.config({\r\n files,\r\n plugins: {\r\n security: securityPlugin as unknown as FlatConfig.Plugin,\r\n regexp: regexpPlugin,\r\n },\r\n rules: {\r\n // eslint-plugin-security\r\n \"security/detect-object-injection\": \"error\",\r\n \"security/detect-unsafe-regex\": \"error\",\r\n\r\n // eslint-plugin-regexp\r\n \"regexp/no-super-linear-backtracking\": \"error\",\r\n \"regexp/no-useless-escape\": \"error\",\r\n \"regexp/no-empty-capturing-group\": \"error\",\r\n },\r\n });\r\n}\r\n","import tseslint from \"typescript-eslint\";\r\n\r\nexport interface TypescriptSizeComplexityOptions {\r\n files?: string[];\r\n}\r\n\r\nexport function typescriptSizeComplexity(\r\n options: TypescriptSizeComplexityOptions = {}\r\n) {\r\n const files = options.files ?? [\"**/*.{ts,tsx,mts,cts}\"];\r\n\r\n return tseslint.config({\r\n files,\r\n rules: {\r\n \"max-lines\": [\r\n \"error\",\r\n { max: 100, skipBlankLines: true, skipComments: true },\r\n ],\r\n \"max-lines-per-function\": [\r\n \"error\",\r\n { max: 50, skipBlankLines: true, skipComments: true },\r\n ],\r\n complexity: [\"error\", 15],\r\n \"max-params\": [\"error\", 3],\r\n \"no-var\": \"error\",\r\n \"prefer-const\": \"warn\",\r\n },\r\n });\r\n}\r\n","import tseslint from \"typescript-eslint\";\r\n\r\nexport interface TypescriptTypeAwareOptions {\r\n /**\r\n * Type-aware linting requires a project TSConfig.\r\n * Example: \"./tsconfig.json\".\r\n */\r\n tsconfigPath?: string | string[];\r\n\r\n /**\r\n * tsconfigRootDir should usually be import.meta.dirname from the consumer repo.\r\n */\r\n tsconfigRootDir?: string;\r\n\r\n files?: string[];\r\n}\r\n\r\nexport function typescriptTypeAware(options: TypescriptTypeAwareOptions = {}) {\r\n const files = options.files ?? [\"**/*.{ts,tsx,mts,cts}\"];\r\n\r\n return tseslint.config({\r\n files,\r\n languageOptions: {\r\n parserOptions: {\r\n project: options.tsconfigPath ?? \"./tsconfig.json\",\r\n tsconfigRootDir: options.tsconfigRootDir,\r\n },\r\n },\r\n rules: {\r\n \"@typescript-eslint/require-await\": \"error\",\r\n \"@typescript-eslint/no-floating-promises\": \"error\",\r\n \"@typescript-eslint/no-misused-promises\": \"error\",\r\n \"@typescript-eslint/await-thenable\": \"error\",\r\n \"@typescript-eslint/no-unnecessary-condition\": \"warn\",\r\n \"@typescript-eslint/no-unnecessary-type-assertion\": \"error\",\r\n \"@typescript-eslint/restrict-template-expressions\": \"error\",\r\n },\r\n });\r\n}\r\n","import type { ESLint } from \"eslint\";\r\n\r\n/**\r\n * Placeholder for future custom rules.\r\n *\r\n * Exporting a plugin object now keeps the package structure stable as you add\r\n * domain-specific rules later.\r\n */\r\nexport const plugin: ESLint.Plugin = {\r\n rules: {},\r\n};\r\n"],"mappings":";AAAA,OAAO,cAAc;AAMd,SAAS,eAAe,UAAiC,CAAC,GAAG;AAClE,QAAM,QAAQ,QAAQ,SAAS,CAAC,uBAAuB;AAEvD,SAAO,SAAS,OAAO;AAAA,IACrB;AAAA,IACA,SAAS;AAAA,MACP,sBAAsB,SAAS;AAAA,IACjC;AAAA,IACA,iBAAiB;AAAA,MACf,QAAQ,SAAS;AAAA,MACjB,eAAe;AAAA,QACb,aAAa;AAAA,QACb,YAAY;AAAA,MACd;AAAA,IACF;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,MAAM,CAAC;AAAA,IAC9B,GAAG,kBAAkB,EAAE,MAAM,CAAC;AAAA,IAC9B,GAAG,mBAAmB,EAAE,MAAM,CAAC;AAAA,IAC/B,GAAG,eAAe,EAAE,MAAM,CAAC;AAAA,IAC3B,GAAG,yBAAyB,EAAE,MAAM,CAAC;AAAA,IACrC,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG,gBAAgB,IAAI,CAAC,YAAY;AAAA,MAClC,GAAG;AAAA,MACH;AAAA,IACF,EAAE;AAAA,EACJ;AACF;;;AKlEO,IAAM,SAAwB;AAAA,EACnC,OAAO,CAAC;AACV;","names":["tseslint","tseslint","importPlugin","tseslint","tseslint","tseslint","tseslint","tseslint","tseslint","tseslint","tseslint"]}
|
package/package.json
CHANGED