-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle aliases in graphql-flow. (#68)
## Summary: This adds a new option to the config for graphql-flow so that you can specify aliases to map to, to help resolve imports. I used the same format as Vite to keep things simple. This will make it so that we can support our `~/`-style imports. In the process I realized a number of things about this repo were broken, so I fixed them: - We weren't running tsc, so I fixed that, and then fixed a bunch of TS failures that were hidden. - The ESLint config was broken, so I fixed that (and then fixed all the failures that came up). - Prettier was broken (still expecting Flow), so I fixed that. - VS Code wasn't set up properly, so I fixed that. - The Github PR Workflow was broken, still expecting Flow/.js files, so I fixed that. Hopefully this helps things to run more smoothly! Issue: FEI-5745 ## Test plan: I ran `yarn tsc` and `yarn eslint src/**/*.ts` and they both passed. Author: jeresig Reviewers: jeresig, kevinb-khan Required Reviewers: Approved By: kevinb-khan Checks: ✅ Lint & Test (ubuntu-latest, 20.x) Pull Request URL: #68
- Loading branch information
Showing
28 changed files
with
1,284 additions
and
1,214 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@khanacademy/graphql-flow": minor | ||
--- | ||
|
||
Add alias resolution. |
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,9 +1,20 @@ | ||
module.exports = { | ||
extends: ['@khanacademy'], | ||
root: true, | ||
parser: '@babel/eslint-parser', | ||
plugins: ['flowtype-errors'], | ||
plugins: ["prettier", "jest"], | ||
extends: ["eslint:recommended", "prettier"], | ||
parser: "@typescript-eslint/parser", | ||
parserOptions: { | ||
sourceType: "module", | ||
ecmaVersion: 2020, | ||
}, | ||
rules: { | ||
'prettier/prettier': ['error', {singleQuote: true}], | ||
"prettier/prettier": "error", | ||
"no-unused-vars": "off", | ||
"no-case-declarations": "off", | ||
}, | ||
env: { | ||
es6: true, | ||
node: true, | ||
jest: true, | ||
}, | ||
}; |
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 |
---|---|---|
|
@@ -31,12 +31,10 @@ jobs: | |
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v4 | ||
- uses: Khan/actions@shared-node-cache-v2 | ||
with: | ||
fetch-depth: 0 | ||
- uses: Khan/[email protected] | ||
with: | ||
node-version: 16.x | ||
node-version: 20.x | ||
|
||
- name: Create Release Pull Request or Publish to npm | ||
id: changesets | ||
|
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,7 +1,7 @@ | ||
{ | ||
"parser": "flow", | ||
"parser": "typescript", | ||
"tabWidth": 4, | ||
"trailingComma": "all", | ||
"bracketSpacing": false, | ||
"singleQuote": true | ||
"singleQuote": false | ||
} |
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,6 @@ | ||
{ | ||
"editor.defaultFormatter": "dbaeumer.vscode-eslint", | ||
"editor.formatOnPaste": true, | ||
"editor.formatOnSave": true, | ||
"eslint.format.enable": true | ||
} |
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.