-
Notifications
You must be signed in to change notification settings - Fork 68
Rewrite Gatsby API from gatsby folder to TS #369
Rewrite Gatsby API from gatsby folder to TS #369
Conversation
Deploy preview ready! ( ͡° ͜ʖ ͡°) Built with commit c43443d |
@@ -132,8 +134,7 @@ | |||
"git add" | |||
], | |||
"src/**/*.{ts,tsx}": [ | |||
"tslint -c tslint.json --project tsconfig.json --format verbose --fix", | |||
"prettier --config .prettierrc --write", | |||
"npm run lint-fix", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
npm run lint-fix
does not accept arguments, it's just a command. previous instruction lints just those files that are commited
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
npm run lint-fix
is short command of tslint and pretiier, so I think it works like with options.
options: { | ||
source: `${__dirname}/../../content`, | ||
destination: "/assets", | ||
extensions: ["jpeg", "jpg", "gif", "png", "svg", "json", "yaml", "yml"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extract this to const
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use it in one place, so extracting is unnecessary.
interface OnCreateDocsNode { | ||
node: Node; | ||
relativePath: string; | ||
createNodeField: Function; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not use Function
type
|
||
module.exports = async ({ graphql, createPage, createRedirect }) => { | ||
export const getPosts = async (graphql: Function): Promise<PostQL[]> => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function
@@ -31,6 +31,6 @@ | |||
}, | |||
"jsRules": {}, | |||
"linterOptions": { | |||
"exclude": ["node_modules/**/*", "tools/**/*"] | |||
"exclude": ["*/node_modules/**/*"] | |||
} | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add this:
"ban-types": [
true,
["Object", "Use {} instead."],
["String"],
["Function", "Use more precise type"]
]
to rules please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
even though it doesn't lint ./gatsby
, just for the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that String
object may be used in code 😄
08dce61
to
a4e1ea7
Compare
gatsby/config/rss-feed.ts
Outdated
excerpt: string; | ||
html: string; | ||
fields: { | ||
slug: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
slug: string?
, at least from what you said to me
Description
Changes proposed in this pull request:
Related issue(s)
#287