Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
fix: handle ts 3.1 fallout
Browse files Browse the repository at this point in the history
  • Loading branch information
marionebl committed Sep 10, 2018
1 parent 9876af9 commit bdb1a24
Show file tree
Hide file tree
Showing 9 changed files with 9,979 additions and 9 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@
"@types/node": "9.6.5",
"@types/node-fetch": "2.1.1",
"@types/object-path": "0.9.29",
"@types/react": "16.3.10",
"@types/react-dom": "16.0.5",
"@types/react": "16.4.7",
"@types/react-dom": "16.0.6",
"@types/react-helmet": "5.0.6",
"@types/read-pkg": "3.0.0",
"@types/readdir-enhanced": "2.2.0",
Expand Down Expand Up @@ -204,7 +204,7 @@
"styled-components": "3.2.5",
"tag-hoc": "1.0.0",
"tslib": "1.9.0",
"typescript": "2.8.1",
"typescript": "3.0.1",
"typescript-simple": "8.0.6",
"url-search-params": "0.10.0",
"username": "3.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ function createBooleanProperty(
ctx: PropertyAnalyzeContext
): Types.SerializedPatternBooleanProperty | undefined {
return {
model: Types.ModelName.PatternProperty,
contextId: args.symbol.name,
description: '',
example: '',
Expand Down Expand Up @@ -156,6 +157,7 @@ function createEnumProperty(
const enumId = ctx.getPropertyId(args.symbol.name);

return {
model: Types.ModelName.PatternProperty,
contextId: args.symbol.name,
description: '',
example: '',
Expand Down Expand Up @@ -194,6 +196,7 @@ function createNumberProperty(
ctx: PropertyAnalyzeContext
): Types.SerializedPatternNumberProperty {
return {
model: Types.ModelName.PatternProperty,
contextId: args.symbol.name,
description: '',
example: '',
Expand All @@ -217,6 +220,7 @@ function createStringProperty(
| Types.SerializedStringProperty {
if (TypescriptUtils.hasJsDocTagFromSymbol(args.symbol, 'asset')) {
return {
model: Types.ModelName.PatternProperty,
contextId: args.symbol.name,
description: '',
example: '',
Expand All @@ -233,6 +237,7 @@ function createStringProperty(

if (TypescriptUtils.hasJsDocTagFromSymbol(args.symbol, 'href')) {
return {
model: Types.ModelName.PatternProperty,
contextId: args.symbol.name,
description: '',
example: '',
Expand All @@ -248,6 +253,7 @@ function createStringProperty(
}

return {
model: Types.ModelName.PatternProperty,
contextId: args.symbol.name,
description: '',
example: '',
Expand All @@ -269,6 +275,7 @@ function createEventHandlerProperty(
const eventType = ReactUtils.getEventType(args, { typechecker: ctx.program.getTypeChecker() });

return {
model: Types.ModelName.PatternProperty,
contextId: args.symbol.name,
description: '',
example: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ function analyzePatternExport(
return {
path: ctx.candidate.artifactPath,
pattern: {
model: Types.ModelName.Pattern,
contextId,
description: ctx.candidate.description,
exportName,
Expand Down
4 changes: 3 additions & 1 deletion src/analyzer/typescript-utils/is-export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ export function isExport(node: TypeScript.Node): boolean {
return false;
}

const modifiers = TypeScript.getCombinedModifierFlags(node);
// tslint:disable-next-line:no-any
const modifiers = TypeScript.getCombinedModifierFlags(node as any);

if ((modifiers & TypeScript.ModifierFlags.Export) === TypeScript.ModifierFlags.Export) {
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/persistence/persistence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class Persistence {
try {
resolve({
state: PersistenceState.Success,
contents: Yaml.load(String(contents)) as T
contents: (Yaml.load(String(contents)) as unknown) as T
});
} catch (error) {
return resolve({
Expand Down
4 changes: 3 additions & 1 deletion src/preview/preview-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ interface StringMap {
}

export function alvaEntryLoader(this: loader.LoaderContext): string {
const options = getOptions(this);
// tslint:disable-next-line:no-any
const options = getOptions(this as any);

const components: StringMap = JSON.parse(options.components);
const componentDirs = Object.values(components);

Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"skipLibCheck": true,
"allowJs": false,
"allowSyntheticDefaultImports": false,
"alwaysStrict": true,
Expand Down
3 changes: 0 additions & 3 deletions tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,6 @@
true,
"LF"
],
"max-classes-per-file": [
false
],
"max-file-line-count": [
false
],
Expand Down
Loading

0 comments on commit bdb1a24

Please sign in to comment.