-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP - Add scripts support #24
Closed
devinrhode2
wants to merge
18
commits into
justinfagnani:master
from
devinrhode2:devin/add-scripts-support
Closed
Changes from 15 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
2cd3777
Set node version to latest 16.x
devinrhode2 02c34bb
Run `npm audit fix`
devinrhode2 cefe79d
Docs on intended changes for fork
devinrhode2 b65c1da
tsconfig.json
devinrhode2 3ab0981
format
devinrhode2 df2b8e1
copy in vscode settings
devinrhode2 c31ec84
`constructUrl` helper/util
devinrhode2 ebdcca6
Copy in eslint/prettier from 2022, add basic tsconfig.json
devinrhode2 fab2e00
clear/safe changes
devinrhode2 e652788
wip changes
devinrhode2 d22c426
markdown lint autofix
devinrhode2 4dd2925
correct(?) "fetch() documents" to "fetch() documentation"
devinrhode2 5047688
Document suspension of `no-shadow` support
devinrhode2 2cdd793
tweak comments
devinrhode2 1de451f
clarify code around `load` event
devinrhode2 2da847b
cleanup confused scripts-loaded code
devinrhode2 959452f
initial foray into SSR support
devinrhode2 d0aedcd
wip - abandoning this approach for now
devinrhode2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.history |
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** @type {import('eslint').Linter.BaseConfig} */ | ||
const conf = { | ||
reportUnusedDisableDirectives: true, | ||
parser: '@typescript-eslint/parser', | ||
extends: [ | ||
'plugin:@typescript-eslint/eslint-recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:@typescript-eslint/strict', | ||
], | ||
plugins: ['@typescript-eslint'], | ||
// https://github.com/typescript-eslint/typescript-eslint/blob/6c3816b3831e6e683c1a7842196b34248803d69b/packages/eslint-plugin/docs/rules/explicit-function-return-type.md#configuring-in-a-mixed-jsts-codebase | ||
rules: { | ||
'@typescript-eslint/no-unused-vars': [ | ||
'error', | ||
{ argsIgnorePattern: '^_' }, | ||
], | ||
|
||
// disabled globally, because it's not possible to satisfy these rules in js files (even with jsdoc comments) | ||
// These are enabled specifically for TS in `overrides` below. | ||
// TS may still complain about implicit any, etc in js code. | ||
'@typescript-eslint/explicit-function-return-type': 'off', | ||
'@typescript-eslint/explicit-module-boundary-types': 'off', | ||
'@typescript-eslint/no-var-requires': 'off', | ||
|
||
// Types created with `type` keyword can expand inline to become unreadable. | ||
// Empty interfaces solve this problem - type hover boxes instead show the interface name, | ||
// Instead of expanding full type inline. | ||
'@typescript-eslint/no-empty-interface': 'off', | ||
}, | ||
overrides: [ | ||
{ | ||
// enable the rule specifically for TypeScript files | ||
files: ['*.ts', '*.tsx'], | ||
rules: { | ||
'@typescript-eslint/explicit-function-return-type': [ | ||
'error', | ||
], | ||
'@typescript-eslint/explicit-module-boundary-types': [ | ||
'error', | ||
], | ||
'@typescript-eslint/no-var-requires': ['error'], | ||
}, | ||
}, | ||
], | ||
} | ||
|
||
module.exports = conf |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
16.20.1 |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
.history |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Prettier config to reduce merge conflicts: https://gist.github.com/devinrhode2/08c84e175c61b282b76f4766a94e4a01 | ||
|
||
/** @type {import('prettier').Options} */ | ||
const conf = { | ||
endOfLine: 'lf', | ||
singleQuote: true, | ||
semi: false, | ||
|
||
// avoid even more merge conflicts: https://prettier.io/blog/2020/03/21/2.0.0.html#change-default-value-for-trailingcomma-to-es5-6963httpsgithubcomprettierprettierpull6963-by-fiskerhttpsgithubcomfisker | ||
trailingComma: 'all', | ||
printWidth: 65, | ||
// Less code per line means: | ||
// - less likely to have conflict on any given line | ||
// - easier to spot changes in git (e.g. getListThing->getListsThing) | ||
// - Encourages modularity | ||
// - jsx components with 20 indent levels will not look good | ||
// - This encourages creating smaller components | ||
// - Still can opt-out with `// prettier-ignore` comments above component | ||
// - OR, create a `.prettierrc.js` file in code you edit the most | ||
// - This exact number will always be somewhat arbitrary, it's not set in stone. | ||
} | ||
|
||
module.exports = conf |
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 |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{ | ||
// Allow committing to any branch, until we need to establish a pr process | ||
"git.branchProtectionPrompt": "alwaysPrompt", | ||
|
||
"files.associations": { | ||
".babelrc": "json5", | ||
".git-blame-ignore-revs": "git-commit", | ||
"*.template": "properties" // nginx.template | ||
}, | ||
|
||
// Format markdown correctly: | ||
"[markdown]": { | ||
"editor.defaultFormatter": "DavidAnson.vscode-markdownlint" | ||
}, | ||
|
||
// Nice to have for any repo: | ||
// (use `typescript` version that's inside `node_modules`) | ||
"typescript.tsdk": "node_modules/typescript/lib", | ||
"typescript.enablePromptUseWorkspaceTsdk": true, | ||
|
||
// Better safe than sorry: | ||
"git.useForcePushWithLease": true, | ||
|
||
// Generic settings for our repo: | ||
"editor.tabSize": 2, | ||
|
||
// By default, format ALL file types with prettier onSave: | ||
"editor.formatOnSave": true, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
|
||
// Enable eslint vscode extension: | ||
"eslint.enable": true, | ||
"eslint.format.enable": false, // assert default | ||
"eslint.validate": [ | ||
"javascript", | ||
"javascriptreact", | ||
"typescript", | ||
"typescriptreact" | ||
], | ||
"prettier.useEditorConfig": true, | ||
"eslint.useESLintClass": true, | ||
"eslint.probe": [], | ||
|
||
// To improve performance a little bit, comment out rest of settings, and un-comment this line. | ||
"editor.codeActionsOnSave": ["source.fixAll.eslint"] | ||
// There is a small risk of hitting bugs like this: https://github.com/prettier/prettier-vscode/issues/1555 | ||
|
||
// Run eslint on save, then prettier afterwards | ||
// Apologies if this affects any of your personal extensions - maybe we can add them into the repo? | ||
// "editor.codeActionsOnSave": {}, | ||
// "[typescript]": { | ||
// "editor.formatOnSave": false, | ||
// "editor.codeActionsOnSave": [ | ||
// "source.fixAll.eslint", | ||
// "source.formatDocument" | ||
// ] | ||
// }, | ||
// "[typescriptreact]": { | ||
// "editor.formatOnSave": false, | ||
// "editor.codeActionsOnSave": [ | ||
// "source.fixAll.eslint", | ||
// "source.formatDocument" | ||
// ] | ||
// }, | ||
// "[javascript]": { | ||
// "editor.formatOnSave": false, | ||
// "editor.codeActionsOnSave": [ | ||
// "source.fixAll.eslint", | ||
// "source.formatDocument" | ||
// ] | ||
// }, | ||
// "[javascriptreact]": { | ||
// "editor.formatOnSave": false, | ||
// "editor.codeActionsOnSave": [ | ||
// "source.fixAll.eslint", | ||
// "source.formatDocument" | ||
// ] | ||
// } | ||
} |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
let's keep the PR focused on one thing, and make project setup changes a different PR.