diff --git a/docs/dev.md b/docs/dev.md index e016c70cd..2949b3f35 100644 --- a/docs/dev.md +++ b/docs/dev.md @@ -32,8 +32,3 @@ To see what packages depend on each other locally, use ```sh yarn workspaces info ``` - -## Tips - -- Too see what tsc is seeing (say when it is trying to type-check `@/utils`), - use `yarn workspace @/utils tsc --showConfig`. diff --git a/packages/build-config/README.md b/packages/build-config/README.md index 512cac273..8e62b1b3d 100644 --- a/packages/build-config/README.md +++ b/packages/build-config/README.md @@ -7,3 +7,16 @@ exports various config files that our packages use at build time. This is _not_ a TypeScript package, nor is it linted. It is not meant to be transpiled, it just exports static files that can be included verbatim. + +### Debugging + +Too see what tsc is seeing (say when it is trying to type-check `@/utils`), use +`yarn workspace @/utils tsc --showConfig`. + +Similarly, to verify what ESLint is trying to do, use `yarn workspace @/utils +eslint --debug .` + +If the issue is in VSCode, open the output window of the corresponding plugin, +it might be telling us what's going wrong there. In particular, when changing +the settings here, you might need to "Developer: Reload Window" in VSCode to get +it to pick up the changes. diff --git a/packages/build-config/eslintrc-typescript.js b/packages/build-config/eslintrc-typescript.js new file mode 100644 index 000000000..2c085c181 --- /dev/null +++ b/packages/build-config/eslintrc-typescript.js @@ -0,0 +1,13 @@ +module.exports = { + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended-type-checked', + ], + plugins: ['@typescript-eslint'], + parser: '@typescript-eslint/parser', + parserOptions: { + project: true, + }, + ignorePatterns: ['.eslintrc.js'], + root: true, +}; diff --git a/packages/build-config/eslintrc.typescript.js b/packages/build-config/eslintrc.typescript.js deleted file mode 100644 index 60e7ac230..000000000 --- a/packages/build-config/eslintrc.typescript.js +++ /dev/null @@ -1,15 +0,0 @@ -/* eslint-env node */ -module.exports = { - extends: [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended-type-checked", - ], - plugins: ["@typescript-eslint"], - parser: "@typescript-eslint/parser", - parserOptions: { - project: true, - tsconfigRootDir: __dirname, - }, - ignorePatterns: [".eslintrc.js"], - root: true, -}; diff --git a/packages/ui/.eslintrc.js b/packages/ui/.eslintrc.js index 60e7ac230..a9a3393e0 100644 --- a/packages/ui/.eslintrc.js +++ b/packages/ui/.eslintrc.js @@ -1,15 +1,6 @@ -/* eslint-env node */ module.exports = { - extends: [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended-type-checked", - ], - plugins: ["@typescript-eslint"], - parser: "@typescript-eslint/parser", + extends: ["@/build-config/eslintrc-typescript"], parserOptions: { - project: true, tsconfigRootDir: __dirname, }, - ignorePatterns: [".eslintrc.js"], - root: true, }; diff --git a/packages/ui/README.md b/packages/ui/README.md index 265baa1aa..69c0a71e2 100644 --- a/packages/ui/README.md +++ b/packages/ui/README.md @@ -4,5 +4,5 @@ Like [@/utils](../utils/README.md), but for things that require React. ### Packaging -This (internal) package exports a vanilla TypeScript library. We rely on the +This (internal) package exports a React TypeScript library. We rely on the importing project to transpile and bundle it. diff --git a/packages/utils/.eslintrc.js b/packages/utils/.eslintrc.js index 60e7ac230..a9a3393e0 100644 --- a/packages/utils/.eslintrc.js +++ b/packages/utils/.eslintrc.js @@ -1,15 +1,6 @@ -/* eslint-env node */ module.exports = { - extends: [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended-type-checked", - ], - plugins: ["@typescript-eslint"], - parser: "@typescript-eslint/parser", + extends: ["@/build-config/eslintrc-typescript"], parserOptions: { - project: true, tsconfigRootDir: __dirname, }, - ignorePatterns: [".eslintrc.js"], - root: true, };