1
- // eslint-disable-next-line no-undef
1
+ /** @type { import('dependency-cruiser').IConfiguration } */
2
2
module . exports = {
3
3
forbidden : [
4
- /* rules from the 'recommended' preset: */
5
4
{
6
5
name : "no-circular" ,
7
6
severity : "warn" ,
@@ -18,16 +17,16 @@ module.exports = {
18
17
"This is an orphan module - it's likely not used (anymore?). Either use it or " +
19
18
"remove it. If it's logical this module is an orphan (i.e. it's a config file), " +
20
19
"add an exception for it in your dependency-cruiser configuration. By default " +
21
- "this rule does not scrutinize dotfiles (e.g. .eslintrc.js), TypeScript declaration " +
20
+ "this rule does not scrutinize dot-files (e.g. .eslintrc.js), TypeScript declaration " +
22
21
"files (.d.ts), tsconfig.json and some of the babel and webpack configs." ,
23
22
severity : "warn" ,
24
23
from : {
25
24
orphan : true ,
26
25
pathNot : [
27
- "(^|/)\\ .[^/]+\\ .(js|cjs|mjs|ts|json)$" , // dot files
28
- "\\.d\\ .ts$" , // TypeScript declaration files
29
- "(^|/)tsconfig\\ .json$" , // TypeScript config
30
- "(^|/)(babel|webpack)\\ .config\\ .(js|cjs|mjs|ts|json)$" , // other configs
26
+ "(^|/).[^/]+.(js|cjs|mjs|ts|json)$" , // dot files
27
+ ".d .ts$" , // TypeScript declaration files
28
+ "(^|/)tsconfig.json$" , // TypeScript config
29
+ "(^|/)(babel|webpack).config.(js|cjs|mjs|ts|json)$" , // other configs
31
30
] ,
32
31
} ,
33
32
to : { } ,
@@ -39,7 +38,28 @@ module.exports = {
39
38
from : { } ,
40
39
to : {
41
40
dependencyTypes : [ "core" ] ,
42
- path : "^(punycode|domain|constants|sys|_linklist|_stream_wrap)$" ,
41
+ path : [
42
+ "^(v8/tools/codemap)$" ,
43
+ "^(v8/tools/consarray)$" ,
44
+ "^(v8/tools/csvparser)$" ,
45
+ "^(v8/tools/logreader)$" ,
46
+ "^(v8/tools/profile_view)$" ,
47
+ "^(v8/tools/profile)$" ,
48
+ "^(v8/tools/SourceMap)$" ,
49
+ "^(v8/tools/splaytree)$" ,
50
+ "^(v8/tools/tickprocessor-driver)$" ,
51
+ "^(v8/tools/tickprocessor)$" ,
52
+ "^(node-inspect/lib/_inspect)$" ,
53
+ "^(node-inspect/lib/internal/inspect_client)$" ,
54
+ "^(node-inspect/lib/internal/inspect_repl)$" ,
55
+ "^(async_hooks)$" ,
56
+ "^(punycode)$" ,
57
+ "^(domain)$" ,
58
+ "^(constants)$" ,
59
+ "^(sys)$" ,
60
+ "^(_linklist)$" ,
61
+ "^(_stream_wrap)$" ,
62
+ ] ,
43
63
} ,
44
64
} ,
45
65
{
@@ -80,17 +100,22 @@ module.exports = {
80
100
{
81
101
name : "no-duplicate-dep-types" ,
82
102
comment :
83
- "Likeley this module depends on an external ('npm') package that occurs more than once " +
103
+ "Likely this module depends on an external ('npm') package that occurs more than once " +
84
104
"in your package.json i.e. bot as a devDependencies and in dependencies. This will cause " +
85
105
"maintenance problems later on." ,
86
106
severity : "warn" ,
87
107
from : { } ,
88
108
to : {
89
109
moreThanOneDependencyType : true ,
110
+ // as it's pretty common to have a type import be a type only import
111
+ // _and_ (e.g.) a devDependency - don't consider type-only dependency
112
+ // types for this rule
113
+ dependencyTypesNot : [ "type-only" ] ,
90
114
} ,
91
115
} ,
92
116
93
117
/* rules you might want to tweak for your specific situation: */
118
+
94
119
{
95
120
name : "not-to-spec" ,
96
121
comment :
@@ -100,7 +125,7 @@ module.exports = {
100
125
severity : "error" ,
101
126
from : { } ,
102
127
to : {
103
- path : "\\. spec\\ .(js|mjs|cjs|ts|ls|coffee|litcoffee|coffee\\ .md)$" ,
128
+ path : ".( spec|test) .(js|mjs|cjs|ts|ls|coffee|litcoffee|coffee.md)$" ,
104
129
} ,
105
130
} ,
106
131
{
@@ -114,7 +139,7 @@ module.exports = {
114
139
"from.pathNot re of the not-to-dev-dep rule in the dependency-cruiser configuration" ,
115
140
from : {
116
141
path : "^(src)" ,
117
- pathNot : "\\. spec\\ .(js|mjs|cjs|ts|ls|coffee|litcoffee|coffee\\ .md)$" ,
142
+ pathNot : ".( spec|test) .(js|mjs|cjs|ts|ls|coffee|litcoffee|coffee.md)$" ,
118
143
} ,
119
144
to : {
120
145
dependencyTypes : [ "npm-dev" ] ,
@@ -127,7 +152,7 @@ module.exports = {
127
152
"This module depends on an npm package that is declared as an optional dependency " +
128
153
"in your package.json. As this makes sense in limited situations only, it's flagged here. " +
129
154
"If you're using an optional dependency here by design - add an exception to your" +
130
- "depdency -cruiser configuration." ,
155
+ "dependency -cruiser configuration." ,
131
156
from : { } ,
132
157
to : {
133
158
dependencyTypes : [ "npm-optional" ] ,
@@ -150,12 +175,11 @@ module.exports = {
150
175
options : {
151
176
/* conditions specifying which files not to follow further when encountered:
152
177
- path: a regular expression to match
153
- - dependencyTypes: see https://github.com/sverweij/dependency-cruiser/blob/master /doc/rules-reference.md#dependencytypes
178
+ - dependencyTypes: see https://github.com/sverweij/dependency-cruiser/blob/main /doc/rules-reference.md#dependencytypes-and-dependencytypesnot
154
179
for a complete list
155
180
*/
156
181
doNotFollow : {
157
182
path : "node_modules" ,
158
- dependencyTypes : [ "npm" , "npm-dev" , "npm-optional" , "npm-peer" , "npm-bundled" , "npm-no-pkg" ] ,
159
183
} ,
160
184
161
185
/* conditions specifying which dependencies to exclude
@@ -182,14 +206,24 @@ module.exports = {
182
206
/* list of module systems to cruise */
183
207
// moduleSystems: ['amd', 'cjs', 'es6', 'tsd'],
184
208
185
- /* prefix for links in html and svg output (e.g. https://github.com/you/yourrepo/blob/develop/) */
209
+ /* prefix for links in html and svg output (e.g. 'https://github.com/you/yourrepo/blob/develop/'
210
+ to open it on your online repo or `vscode://file/${process.cwd()}/` to
211
+ open it in visual studio code),
212
+ */
186
213
// prefix: '',
187
214
188
215
/* false (the default): ignore dependencies that only exist before typescript-to-javascript compilation
189
216
true: also detect dependencies that only exist before typescript-to-javascript compilation
190
217
"specify": for each dependency identify whether it only exists before compilation or also after
191
218
*/
192
- // tsPreCompilationDeps: false,
219
+ tsPreCompilationDeps : true ,
220
+
221
+ /*
222
+ list of extensions to scan that aren't javascript or compile-to-javascript.
223
+ Empty by default. Only put extensions in here that you want to take into
224
+ account that are _not_ parsable.
225
+ */
226
+ // extraExtensionsToScan: [".json", ".jpg", ".png", ".svg", ".webp"],
193
227
194
228
/* if true combines the package.jsons found from the module up to the base
195
229
folder the cruise is initiated from. Useful for how (some) mono-repos
@@ -218,14 +252,14 @@ module.exports = {
218
252
to dependency-cruiser's current working directory. When not provided defaults
219
253
to './webpack.conf.js'.
220
254
221
- The (optional) `env` and `args ` attributes contain the parameters to be passed if
255
+ The (optional) `env` and `arguments ` attributes contain the parameters to be passed if
222
256
your webpack config is a function and takes them (see webpack documentation
223
257
for details)
224
258
*/
225
259
// webpackConfig: {
226
- // fileName: './ webpack.config.js',
260
+ // fileName: 'webpack.config.js',
227
261
// env: {},
228
- // args : {},
262
+ // arguments : {}
229
263
// },
230
264
231
265
/* Babel config ('.babelrc', '.babelrc.json', '.babelrc.json5', ...) to use
@@ -235,30 +269,72 @@ module.exports = {
235
269
systems) without dependency-cruiser getting a major version bump.
236
270
*/
237
271
// babelConfig: {
238
- // fileName: './. babelrc'
272
+ // fileName: '.babelrc',
239
273
// },
240
274
241
- /* How to resolve external modules - use "yarn-pnp" if you're using yarn's Plug'n'Play.
242
- otherwise leave it out (or set to the default, which is 'node_modules')
243
- */
244
- // externalModuleResolutionStrategy: 'node_modules',
245
275
/* List of strings you have in use in addition to cjs/ es6 requires
246
276
& imports to declare module dependencies. Use this e.g. if you've
247
- redeclared require, use a require-wrapper or use window.require as
277
+ re-declared require, use a require-wrapper or use window.require as
248
278
a hack.
249
279
*/
250
280
// exoticRequireStrings: [],
281
+ /* options to pass on to enhanced-resolve, the package dependency-cruiser
282
+ uses to resolve module references to disk. You can set most of these
283
+ options in a webpack.conf.js - this section is here for those
284
+ projects that don't have a separate webpack config file.
285
+
286
+ Note: settings in webpack.conf.js override the ones specified here.
287
+ */
288
+ enhancedResolveOptions : {
289
+ /* List of strings to consider as 'exports' fields in package.json. Use
290
+ ['exports'] when you use packages that use such a field and your environment
291
+ supports it (e.g. node ^12.19 || >=14.7 or recent versions of webpack).
292
+
293
+ If you have an `exportsFields` attribute in your webpack config, that one
294
+ will have precedence over the one specified here.
295
+ */
296
+ exportsFields : [ "exports" ] ,
297
+ /* List of conditions to check for in the exports field. e.g. use ['imports']
298
+ if you're only interested in exposed es6 modules, ['require'] for commonjs,
299
+ or all conditions at once `(['import', 'require', 'node', 'default']`)
300
+ if anything goes for you. Only works when the 'exportsFields' array is
301
+ non-empty.
302
+
303
+ If you have a 'conditionNames' attribute in your webpack config, that one will
304
+ have precedence over the one specified here.
305
+ */
306
+ conditionNames : [ "import" , "require" , "node" , "default" ] ,
307
+ /*
308
+ The extensions, by default are the same as the ones dependency-cruiser
309
+ can access (run `npx depcruise --info` to see which ones that are in
310
+ _your_ environment. If that list is larger than what you need (e.g.
311
+ it contains .js, .jsx, .ts, .tsx, .cts, .mts - but you don't use
312
+ TypeScript you can pass just the extensions you actually use (e.g.
313
+ [".js", ".jsx"]). This can speed up the most expensive step in
314
+ dependency cruising (module resolution) quite a bit.
315
+ */
316
+ // extensions: [".js", ".jsx", ".ts", ".tsx", ".d.ts"],
317
+ /*
318
+ If your TypeScript project makes use of types specified in 'types'
319
+ fields in package.jsons of external dependencies, specify "types"
320
+ in addition to "main" in here, so enhanced-resolve (the resolver
321
+ dependency-cruiser uses) knows to also look there. You can also do
322
+ this if you're not sure, but still use TypeScript. In a future version
323
+ of dependency-cruiser this will likely become the default.
324
+ */
325
+ mainFields : [ "main" , "types" , "typings" ] ,
326
+ } ,
251
327
reporterOptions : {
252
328
dot : {
253
329
/* pattern of modules that can be consolidated in the detailed
254
330
graphical dependency graph. The default pattern in this configuration
255
331
collapses everything in node_modules to one folder deep so you see
256
332
the external modules, but not the innards your app depends upon.
257
333
*/
258
- collapsePattern : "node_modules/[^/]+" ,
334
+ collapsePattern : "node_modules/(@ [^/]+/[^/]+|[^/]+) " ,
259
335
260
336
/* Options to tweak the appearance of your graph.See
261
- https://github.com/sverweij/dependency-cruiser/blob/master /doc/rules -reference.md#dot
337
+ https://github.com/sverweij/dependency-cruiser/blob/main /doc/options -reference.md#reporteroptions
262
338
for details and some examples. If you don't specify a theme
263
339
don't worry - dependency-cruiser will fall back to the default one.
264
340
*/
@@ -272,13 +348,39 @@ module.exports = {
272
348
// },
273
349
// modules: [
274
350
// {
351
+ // criteria: { matchesFocus: true },
352
+ // attributes: {
353
+ // fillcolor: "lime",
354
+ // penwidth: 2,
355
+ // },
356
+ // },
357
+ // {
358
+ // criteria: { matchesFocus: false },
359
+ // attributes: {
360
+ // fillcolor: "lightgrey",
361
+ // },
362
+ // },
363
+ // {
364
+ // criteria: { matchesReaches: true },
365
+ // attributes: {
366
+ // fillcolor: "lime",
367
+ // penwidth: 2,
368
+ // },
369
+ // },
370
+ // {
371
+ // criteria: { matchesReaches: false },
372
+ // attributes: {
373
+ // fillcolor: "lightgrey",
374
+ // },
375
+ // },
376
+ // {
275
377
// criteria: { source: "^src/model" },
276
378
// attributes: { fillcolor: "#ccccff" }
277
379
// },
278
380
// {
279
381
// criteria: { source: "^src/view" },
280
382
// attributes: { fillcolor: "#ccffcc" }
281
- // }
383
+ // },
282
384
// ],
283
385
// dependencies: [
284
386
// {
@@ -310,18 +412,21 @@ module.exports = {
310
412
dependency graph reporter (`archi`) you probably want to tweak
311
413
this collapsePattern to your situation.
312
414
*/
313
- collapsePattern : "^(node_modules| packages|src|lib|app|bin|test(s?)|spec(s?))/[^/]+" ,
415
+ collapsePattern : "^(packages|src|lib|app|bin|test(s?)|spec(s?))/[^/]+|node_modules/(@[^/]+/[^/]+|[^/]+) " ,
314
416
315
417
/* Options to tweak the appearance of your graph.See
316
- https://github.com/sverweij/dependency-cruiser/blob/master /doc/rules -reference.md#dot
418
+ https://github.com/sverweij/dependency-cruiser/blob/main /doc/options -reference.md#reporteroptions
317
419
for details and some examples. If you don't specify a theme
318
420
for 'archi' dependency-cruiser will use the one specified in the
319
421
dot section (see above), if any, and otherwise use the default one.
320
422
*/
321
423
// theme: {
322
424
// },
323
425
} ,
426
+ text : {
427
+ highlightFocused : true ,
428
+ } ,
324
429
} ,
325
430
} ,
326
431
} ;
327
- // generated: dependency-cruiser@9.9.2 on 2020-11-12T22:29:07.287Z
432
+ // generated: dependency-cruiser@13.1.5 on 2023-09-10T03:31:28.165Z
0 commit comments