-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix prettier glob to correctly navigate recursively and format missin…
…g files (#107)
- Loading branch information
1 parent
e2b0859
commit 89c194b
Showing
9 changed files
with
965 additions
and
962 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
// @flow | ||
|
||
import Prism from "./vendor/prism"; | ||
import theme from "./themes/duotoneDark"; | ||
|
||
import type { PrismLib } from "./types"; | ||
|
||
const defaultProps = { | ||
// $FlowFixMe | ||
Prism: (Prism: PrismLib), | ||
theme | ||
}; | ||
|
||
export default defaultProps; | ||
// @flow | ||
|
||
import Prism from "./vendor/prism"; | ||
import theme from "./themes/duotoneDark"; | ||
|
||
import type { PrismLib } from "./types"; | ||
|
||
const defaultProps = { | ||
// $FlowFixMe | ||
Prism: (Prism: PrismLib), | ||
theme, | ||
}; | ||
|
||
export default defaultProps; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
// @flow | ||
|
||
import Prism from './vendor/prism' | ||
import defaultProps from './defaultProps' | ||
import Highlight from './components/Highlight' | ||
|
||
export { | ||
Prism, | ||
defaultProps | ||
} | ||
|
||
export default Highlight | ||
// @flow | ||
|
||
import Prism from "./vendor/prism"; | ||
import defaultProps from "./defaultProps"; | ||
import Highlight from "./components/Highlight"; | ||
|
||
export { Prism, defaultProps }; | ||
|
||
export default Highlight; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,112 +1,116 @@ | ||
// @flow | ||
|
||
import type { Key } from "react"; | ||
import includedLangs from "./vendor/prism/includeLangs"; | ||
|
||
export type Language = $Keys<typeof includedLangs>; | ||
|
||
type PrismGrammar = { | ||
[key: string]: mixed | ||
}; | ||
|
||
type LanguagesDict = { | ||
[lang: Language]: PrismGrammar | ||
}; | ||
|
||
export type PrismToken = { | ||
type: string | string[], | ||
alias: string | string[], | ||
content: Array<PrismToken | string> | string | ||
}; | ||
|
||
export type Token = { | ||
types: string[], | ||
content: string, | ||
empty?: boolean | ||
}; | ||
|
||
export type PrismLib = { | ||
languages: LanguagesDict, | ||
tokenize: ( | ||
code: string, | ||
grammar: PrismGrammar, | ||
language: Language | ||
) => Array<PrismToken | string>, | ||
highlight: (code: string, grammar: PrismGrammar, language: Language) => string | ||
}; | ||
|
||
export type StyleObj = { | ||
[key: string]: string | number | null | ||
}; | ||
|
||
export type LineInputProps = { | ||
key?: Key, | ||
style?: StyleObj, | ||
className?: string, | ||
line: Token[], | ||
[key: string]: mixed | ||
}; | ||
|
||
export type LineOutputProps = { | ||
key?: Key, | ||
style?: StyleObj, | ||
className: string, | ||
[key: string]: mixed | ||
}; | ||
|
||
export type TokenInputProps = { | ||
key?: Key, | ||
style?: StyleObj, | ||
className?: string, | ||
token: Token, | ||
[key: string]: mixed | ||
}; | ||
|
||
export type TokenOutputProps = { | ||
key?: Key, | ||
style?: StyleObj, | ||
className: string, | ||
children: string, | ||
[key: string]: mixed | ||
}; | ||
|
||
export type RenderProps = { | ||
tokens: Token[][], | ||
className: string, | ||
getLineProps: (input: LineInputProps) => LineOutputProps, | ||
getTokenProps: (input: TokenInputProps) => TokenOutputProps | ||
}; | ||
|
||
export type PrismThemeEntry = { | ||
color?: string, | ||
backgroundColor?: string, | ||
fontStyle?: "normal" | "italic", | ||
fontWeight?: | ||
| "normal" | ||
| "bold" | ||
| "100" | ||
| "200" | ||
| "300" | ||
| "400" | ||
| "500" | ||
| "600" | ||
| "700" | ||
| "800" | ||
| "900", | ||
textDecorationLine?: | ||
| "none" | ||
| "underline" | ||
| "line-through" | ||
| "underline line-through", | ||
opacity?: number, | ||
[styleKey: string]: string | number | void | ||
}; | ||
|
||
export type PrismTheme = { | ||
plain: PrismThemeEntry, | ||
styles: Array<{ | ||
types: string[], | ||
style: PrismThemeEntry, | ||
languages?: Language[] | ||
}> | ||
}; | ||
// @flow | ||
|
||
import type { Key } from "react"; | ||
import includedLangs from "./vendor/prism/includeLangs"; | ||
|
||
export type Language = $Keys<typeof includedLangs>; | ||
|
||
type PrismGrammar = { | ||
[key: string]: mixed, | ||
}; | ||
|
||
type LanguagesDict = { | ||
[lang: Language]: PrismGrammar, | ||
}; | ||
|
||
export type PrismToken = { | ||
type: string | string[], | ||
alias: string | string[], | ||
content: Array<PrismToken | string> | string, | ||
}; | ||
|
||
export type Token = { | ||
types: string[], | ||
content: string, | ||
empty?: boolean, | ||
}; | ||
|
||
export type PrismLib = { | ||
languages: LanguagesDict, | ||
tokenize: ( | ||
code: string, | ||
grammar: PrismGrammar, | ||
language: Language | ||
) => Array<PrismToken | string>, | ||
highlight: ( | ||
code: string, | ||
grammar: PrismGrammar, | ||
language: Language | ||
) => string, | ||
}; | ||
|
||
export type StyleObj = { | ||
[key: string]: string | number | null, | ||
}; | ||
|
||
export type LineInputProps = { | ||
key?: Key, | ||
style?: StyleObj, | ||
className?: string, | ||
line: Token[], | ||
[key: string]: mixed, | ||
}; | ||
|
||
export type LineOutputProps = { | ||
key?: Key, | ||
style?: StyleObj, | ||
className: string, | ||
[key: string]: mixed, | ||
}; | ||
|
||
export type TokenInputProps = { | ||
key?: Key, | ||
style?: StyleObj, | ||
className?: string, | ||
token: Token, | ||
[key: string]: mixed, | ||
}; | ||
|
||
export type TokenOutputProps = { | ||
key?: Key, | ||
style?: StyleObj, | ||
className: string, | ||
children: string, | ||
[key: string]: mixed, | ||
}; | ||
|
||
export type RenderProps = { | ||
tokens: Token[][], | ||
className: string, | ||
getLineProps: (input: LineInputProps) => LineOutputProps, | ||
getTokenProps: (input: TokenInputProps) => TokenOutputProps, | ||
}; | ||
|
||
export type PrismThemeEntry = { | ||
color?: string, | ||
backgroundColor?: string, | ||
fontStyle?: "normal" | "italic", | ||
fontWeight?: | ||
| "normal" | ||
| "bold" | ||
| "100" | ||
| "200" | ||
| "300" | ||
| "400" | ||
| "500" | ||
| "600" | ||
| "700" | ||
| "800" | ||
| "900", | ||
textDecorationLine?: | ||
| "none" | ||
| "underline" | ||
| "line-through" | ||
| "underline line-through", | ||
opacity?: number, | ||
[styleKey: string]: string | number | void, | ||
}; | ||
|
||
export type PrismTheme = { | ||
plain: PrismThemeEntry, | ||
styles: Array<{ | ||
types: string[], | ||
style: PrismThemeEntry, | ||
languages?: Language[], | ||
}>, | ||
}; |
Oops, something went wrong.