Skip to content

Commit

Permalink
Merge pull request #5870 from aloisklink/chore/set-tsconfig-preserveS…
Browse files Browse the repository at this point in the history
…ymlinks-to-false

build(types): disable `preserveSymlinks` in tsconfig
  • Loading branch information
sidharthv96 authored Sep 17, 2024
2 parents 7a86fd7 + b74842c commit 2b12a65
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 17 deletions.
6 changes: 3 additions & 3 deletions docs/config/setup/classes/mermaid.UnknownDiagramError.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Error.prepareStackTrace

#### Defined in

node_modules/@types/node/globals.d.ts:28
node_modules/.pnpm/@types+node\@20.16.2/node_modules/@types/node/globals.d.ts:28

---

Expand All @@ -141,7 +141,7 @@ Error.stackTraceLimit

#### Defined in

node_modules/@types/node/globals.d.ts:30
node_modules/.pnpm/@types+node\@20.16.2/node_modules/@types/node/globals.d.ts:30

## Methods

Expand All @@ -168,4 +168,4 @@ Error.captureStackTrace

#### Defined in

node_modules/@types/node/globals.d.ts:21
node_modules/.pnpm/@types+node\@20.16.2/node_modules/@types/node/globals.d.ts:21
2 changes: 0 additions & 2 deletions packages/mermaid/src/diagrams/class/classDb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,6 @@ const setupToolTips = function (element: Element) {
// @ts-ignore - getBoundingClientRect is not part of the d3 type definition
const rect = this.getBoundingClientRect();

// @ts-expect-error - Incorrect types
tooltipElem.transition().duration(200).style('opacity', '.9');
tooltipElem
.text(el.attr('title'))
Expand All @@ -399,7 +398,6 @@ const setupToolTips = function (element: Element) {
el.classed('hover', true);
})
.on('mouseout', function () {
// @ts-expect-error - Incorrect types
tooltipElem.transition().duration(500).style('opacity', 0);
const el = select(this);
el.classed('hover', false);
Expand Down
2 changes: 0 additions & 2 deletions packages/mermaid/src/diagrams/flowchart/flowDb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,6 @@ const setupToolTips = function (element: Element) {
}
const rect = (this as Element)?.getBoundingClientRect();

// @ts-ignore TODO: fix this
tooltipElem.transition().duration(200).style('opacity', '.9');
tooltipElem
.text(el.attr('title'))
Expand All @@ -435,7 +434,6 @@ const setupToolTips = function (element: Element) {
el.classed('hover', true);
})
.on('mouseout', function () {
// @ts-ignore TODO: fix this
tooltipElem.transition().duration(500).style('opacity', 0);
const el = select(this);
el.classed('hover', false);
Expand Down
7 changes: 3 additions & 4 deletions packages/mermaid/src/diagrams/gantt/parser/gantt.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { parser } from './gantt.jison';
import ganttDb from '../ganttDb.js';
import { convert } from '../../../tests/util.js';
import { vi } from 'vitest';
import { vi, it } from 'vitest';
const spyOn = vi.spyOn;
const parserFnConstructor = (str) => {
return () => {
Expand Down Expand Up @@ -150,14 +149,14 @@ describe('when parsing a gantt diagram it', function () {
expect(tasks[3].id).toEqual('d');
expect(tasks[3].task).toEqual('task D');
});
it.each(convert`
it.each`
tags | milestone | done | crit | active
${'milestone'} | ${true} | ${false} | ${false} | ${false}
${'done'} | ${false} | ${true} | ${false} | ${false}
${'crit'} | ${false} | ${false} | ${true} | ${false}
${'active'} | ${false} | ${false} | ${false} | ${true}
${'crit,milestone,done'} | ${true} | ${true} | ${true} | ${false}
`)('should handle a task with tags $tags', ({ tags, milestone, done, crit, active }) => {
`('should handle a task with tags $tags', ({ tags, milestone, done, crit, active }) => {
const str =
'gantt\n' +
'dateFormat YYYY-MM-DD\n' +
Expand Down
4 changes: 2 additions & 2 deletions packages/mermaid/src/diagrams/pie/pie.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ describe('pie', () => {
expect(sections.get('bat')).toBe(40);
});

it('should handle simple pie with negative decimal', () => {
expect(async () => {
it('should handle simple pie with negative decimal', async () => {
await expect(async () => {
await parser.parse(`pie
"ash" : -60.67
"bat" : 40.12
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2063,8 +2063,8 @@ participant Alice`;
});
});

it.each(['__proto__', 'constructor'])('should allow %s as an actor name', function (prop) {
expect(
it.each(['__proto__', 'constructor'])('should allow %s as an actor name', async function (prop) {
await expect(
mermaidAPI.parse(`
sequenceDiagram
${prop}-->>A: Hello, how are you?`)
Expand Down
1 change: 0 additions & 1 deletion packages/parser/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"rootDir": ".",
"outDir": "./dist",
"allowJs": false,
"preserveSymlinks": false,
"strictPropertyInitialization": false
},
"include": ["./src/**/*.ts", "./tests/**/*.ts"],
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */,
"preserveSymlinks": true /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */,
// "preserveSymlinks": true /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */,
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,

/* Type Checking */
Expand Down

0 comments on commit 2b12a65

Please sign in to comment.