diff --git a/docs/dev.md b/docs/dev.md index e016c70cdf882faec9b6943860f4b8b8c3487166..2949b3f3570c551402501299aed70ec4b141d1ff 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 512cac273a58a3ee754ce176585b27cb145ef4bc..8e62b1b3d20b67ad6a7c514a7b958246bb19fb55 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 0000000000000000000000000000000000000000..2c085c181673687956ac9d6de6ccea4049d97f89 --- /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 60e7ac2309647610958629f72e8851371ce0e22e..0000000000000000000000000000000000000000 --- 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 60e7ac2309647610958629f72e8851371ce0e22e..a9a3393e037005e774f2b5e3451d0d6f08e4f1fd 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 265baa1aa67128371d36d89eb5adec68c740866b..69c0a71e22549c577cf064dc80a9ea595bf10506 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 60e7ac2309647610958629f72e8851371ce0e22e..a9a3393e037005e774f2b5e3451d0d6f08e4f1fd 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, };