Skip to content
This repository has been archived by the owner on Nov 25, 2021. It is now read-only.

Commit

Permalink
style: properly check prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfbecker committed Jul 18, 2019
1 parent c21c0da commit 47adbe8
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -11,7 +11,7 @@ jobs:
include:
- stage: test
script:
- yarn run prettier
- yarn run prettier-check
- yarn run typecheck
- yarn run tslint
- yarn run build
Expand Down
2 changes: 1 addition & 1 deletion .vscode/extensions.json
@@ -1,3 +1,3 @@
{
"recommendations": ["esbenp.prettier-vscode", "EditorConfig.EditorConfig"]
"recommendations": ["esbenp.prettier-vscode", "EditorConfig.EditorConfig"],
}
4 changes: 2 additions & 2 deletions .vscode/settings.json
Expand Up @@ -4,6 +4,6 @@
"**/node_modules": true,
"**/bower_components": true,
"lib/": true,
"coverage/": true
}
"coverage/": true,
},
}
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Expand Up @@ -2,5 +2,5 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": []
"tasks": [],
}
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -15,6 +15,7 @@
"scripts": {
"semantic-release": "semantic-release",
"prettier": "prettier '**/{*.{js?(on),ts?(x),scss,yml},.*.js?(on),.*.yml}' --write --list-different",
"prettier-check": "npm run prettier -- --write=false",
"typecheck": "tsc -p tsconfig.json",
"tslint": "tslint -c tslint.json -p tsconfig.json './src/*.ts?(x)' './testdata/*.ts?(x)' './*.ts?(x)'",
"build": "yarn run tsc && cpy 'src/**/*.scss' lib/",
Expand Down
79 changes: 38 additions & 41 deletions src/hoverifier.ts
Expand Up @@ -433,25 +433,24 @@ export function createHoverifier<C extends object, D, A>({
debounceTime(MOUSEOVER_DELAY),
// Do not consider mouseovers while overlay is pinned
filter(() => !container.values.hoverOverlayIsFixed),
switchMap(
({ adjustPosition, codeView, resolveContext, position, ...rest }) =>
adjustPosition && position
? from(
adjustPosition({
codeView,
position: { ...position, ...resolveContext(position) },
direction: AdjustmentDirection.CodeViewToActual,
})
).pipe(
map(({ line, character }) => ({
codeView,
resolveContext,
position: { ...position, line, character },
adjustPosition,
...rest,
}))
)
: of({ adjustPosition, codeView, resolveContext, position, ...rest })
switchMap(({ adjustPosition, codeView, resolveContext, position, ...rest }) =>
adjustPosition && position
? from(
adjustPosition({
codeView,
position: { ...position, ...resolveContext(position) },
direction: AdjustmentDirection.CodeViewToActual,
})
).pipe(
map(({ line, character }) => ({
codeView,
resolveContext,
position: { ...position, line, character },
adjustPosition,
...rest,
}))
)
: of({ adjustPosition, codeView, resolveContext, position, ...rest })
),
share()
)
Expand All @@ -462,25 +461,24 @@ export function createHoverifier<C extends object, D, A>({
target: event.target as HTMLElement,
...rest,
})),
switchMap(
({ adjustPosition, codeView, resolveContext, position, ...rest }) =>
adjustPosition && position
? from(
adjustPosition({
codeView,
position: { ...position, ...resolveContext(position) },
direction: AdjustmentDirection.CodeViewToActual,
})
).pipe(
map(({ line, character }) => ({
codeView,
resolveContext,
position: { ...position, line, character },
adjustPosition,
...rest,
}))
)
: of({ adjustPosition, codeView, resolveContext, position, ...rest })
switchMap(({ adjustPosition, codeView, resolveContext, position, ...rest }) =>
adjustPosition && position
? from(
adjustPosition({
codeView,
position: { ...position, ...resolveContext(position) },
direction: AdjustmentDirection.CodeViewToActual,
})
).pipe(
map(({ line, character }) => ({
codeView,
resolveContext,
position: { ...position, line, character },
adjustPosition,
...rest,
}))
)
: of({ adjustPosition, codeView, resolveContext, position, ...rest })
),
share()
)
Expand Down Expand Up @@ -583,9 +581,8 @@ export function createHoverifier<C extends object, D, A>({
: target,
...rest,
})),
map(
({ hoverOverlayElement, relativeElement, target }) =>
target ? calculateOverlayPosition({ relativeElement, target, hoverOverlayElement }) : undefined
map(({ hoverOverlayElement, relativeElement, target }) =>
target ? calculateOverlayPosition({ relativeElement, target, hoverOverlayElement }) : undefined
)
)
.subscribe(hoverOverlayPosition => {
Expand Down
2 changes: 1 addition & 1 deletion src/token_position.ts
Expand Up @@ -482,7 +482,7 @@ export const getTokenAtPosition = (
isFirstCharacterDiffIndicator,
}: Pick<DOMFunctions, 'getCodeElementFromLineNumber' | 'isFirstCharacterDiffIndicator'>,
part?: DiffPart,
tokenize = true,
tokenize = true
): HTMLElement | undefined => {
const codeElement = getCodeElementFromLineNumber(codeView, line, part)
if (!codeElement) {
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.dist.json
Expand Up @@ -5,8 +5,8 @@
"declaration": true,
"declarationMap": true,
"inlineSourceMap": true,
"inlineSources": true
"inlineSources": true,
},
"include": ["src/**/*"],
"exclude": ["src/**/*.test.ts", "src/testutils"]
"exclude": ["src/**/*.test.ts", "src/testutils"],
}
4 changes: 2 additions & 2 deletions tsconfig.json
Expand Up @@ -9,6 +9,6 @@
"outDir": "lib",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"lib": ["es2017", "dom", "dom.iterable"]
}
"lib": ["es2017", "dom", "dom.iterable"],
},
}

0 comments on commit 47adbe8

Please sign in to comment.